Pie Chart Component

Pie Chart

Function: a!pieChartField()

Represents numerical data as slices of a single circle. Use a pie chart to graphically display parts of a whole.

See also: Column Chart, Bar Chart, Line Chart,Chart Series

Parameters

Name Keyword Type Description
Label label Text Optional text to display at the top of the chart.
Label Position labelPosition Text Optional text to determine where the label appears. Valid values include
  • "ABOVE" (default) Displays the label above the component.
  • "ADJACENT" Displays the label to the left of the component.
  • "COLLAPSED" Hides the label. The label will still be read by screen readers; see accessibility considerations for more information.
  • "JUSTIFIED" Aligns the label alongside the component starting at the edge of the page.
Instructions instructions Text Optional text displayed below the field's label.
Help Tooltip helpTooltip Text Displays a help icon with the specified text as a tooltip. The tooltip displays a maximum of 500 characters. The help icon does not show when the label position is "COLLAPSED".
Series series Chart Series Array Array of chart series to display in the chart. Configured using a!chartSeries().
Show Data Labels showDataLabels Boolean Determines if the label and data arguments are displayed with each slice of the pie. For example, "Existing Client: 12". Default is false.
Show Tooltips showTooltips Boolean Determines if tooltips that show the label and data value of a pie slice, display when users hover over a slice. Default is false.
Show as Percentage showAsPercentage Boolean Determines if the data value for each slice of the pie is shown as a percentage rather than an integer or decimal amount. Default is false.
Visibility showWhen Boolean Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Notes

  • The labels and data arguments in the Series are shown in the data labels and tooltips (if enabled).
  • If a Series has a non-null label value paired with a 0, null, or empty data value, the data value is treated as 0 and is still displayed if Show data labels is set to true. For example, Americas: 0.
  • If a Series argument has a null or empty label paired with a non-null data value, the label is displayed as [Series #] with # as the label's index number in the Series if Show data labels is set to true. For example, [Series 1]: 0.
  • If a Series argument has both a null or empty label paired with a 0, null, or empty data value, the above behaviors are combined and the following is displayed if Show data labels is set to true: [Series 1]: 0.
  • If a data value is negative, the data label shows it as negative (for example -20), but it still displays as a pie slice. To avoid any confusion, negative values should only be used with bar, column, and line charts.
  • Since pie chart values do not have an x-axis for reference, Appian recommends setting Show data labels as true.
  • When values are shown as percentages, they are rounded to one decimal place. If values in the second decimal place are 5 or higher, the first decimal number is rounded up.

Examples

Copy and paste an example into the INTERFACE DEFINITION in EXPRESSION MODE to see it displayed.

Pie Chart with Label, Instructions, and Data Labels

1
2
3
4
5
6
7
8
9
10
11
12
13
=a!pieChartField(
  label: "Opportunity Sources",
  instructions: "Leads are calculated based on the initial mode of contact",
  series: {
    a!chartSeries(label: "Cold Call",       data: 2),
    a!chartSeries(label: "Existing Client", data: 12),
    a!chartSeries(label: "Inbound Call",    data: 4),
    a!chartSeries(label: "Referral",        data: 7),
    a!chartSeries(label: "Tradeshow",       data: 8),
    a!chartSeries(label: "Web Site",        data: 6)
  },
  showDataLabels: true
)

Displays the following:

Pie Chart with Label, Instructions, Data Labels, Tooltips, and Percentage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
=a!pieChartField(
  label: "Opportunity Sources",
  instructions: "Leads are calculated based on the initial mode of contact",
  series: {
    a!chartSeries(label: "Existing Client", data: 12),
    a!chartSeries(label: "Inbound Call",    data:  6),
    a!chartSeries(label: "Tradeshow",       data:  8),
    a!chartSeries(label: "Web Site",        data:  6),
    a!chartSeries(label: "Cold Call",       data:  2),
    a!chartSeries(label: "Referral",        data:  7),
    a!chartSeries(label: "Previous Client", data:  7),
    a!chartSeries(label: "Silver Team",     data:  3),
    a!chartSeries(label: "Gold Team",       data:  6),
    a!chartSeries(label: "Associate",       data:  6),
    a!chartSeries(label: "Conference",      data:  5),
    a!chartSeries(label: "Reference",       data:  4),
    a!chartSeries(label: "Partner",         data:  5),
    a!chartSeries(label: "Walk-In",         data:  1),
    a!chartSeries(label: "Search",          data:  5),
    a!chartSeries(label: "Magazine",        data:  4),
    a!chartSeries(label: "Article",         data:  5),
    a!chartSeries(label: "Radio",           data:  6),
    a!chartSeries(label: "Commercial",      data:  5),
    a!chartSeries(label: "Flyer",           data:  4)
  },
  showDataLabels: true,
  showTooltips: true,
  showAsPercentage: true
)

Displays the following:

See also: queryrecord(), Tempo Report Best Practices, Aggregate Data from a Data Store Entity and Display in a Chart

FEEDBACK