Bar Chart Component

Bar Chart

Function: a!barChartField()

Displays numerical data as horizontal bars. Use a bar chart to display several values at the same point in time.

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

Parameters

Name Keyword Types Description

Label

label

Text

Text to display as the field label.

Instructions

instructions

Text

Supplemental text about this field.

Categories

categories

Text Array

Text to display on the x-axis next to each bar.

Series

series

Chart Series Array

Array of data series created with a!chartSeries().

X-Axis Title

xAxisTitle

Text

Title for the independent (vertical) axis.

Y-Axis Title

yAxisTitle

Text

Title for the dependent (horizontal) axis.

Min Y-Axis

yAxisMin

Number (Decimal)

Determines the minimum displayed point on the horizontal axis.

Max Y-Axis

yAxisMax

Number (Decimal)

Determines the maximum displayed point on the horizontal axis.

Stacking

stacking

Text

Determines if series values display as separate bars or stacked within one bar. Valid values: "NONE" (default), "NORMAL".

Reference Lines

referenceLines

Chart Reference Lines Array

Array of reference line values for each threshold to be defined on the chart. Configured using a!chartReferenceLine().

Show legend

showLegend

Boolean

Determines if a color legend displays below the chart. Default: true.

Show data labels

showDataLabels

Boolean

Determines if data values are displayed next to each bar. Default: false.

Show tooltips

showTooltips

Boolean

Determines if a tooltip displays the data value for a bar. Default: true.

Allow decimal axis labels

allowDecimalAxisLabels

Boolean

Allows dependent (horizontal) values to display as decimal numbers instead of integers. Default: false.

Label Position

labelPosition

Text

Determines where the label appears. Valid values:

  • "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.

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".

Accessibility Text

accessibilityText

Text

Additional text to be announced by screen readers. Used only for accessibility; produces no visible change.

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 order of items in the Categories array determines the display order of categories on the chart with the left-most item in the array appearing at the top of the x-axis. The x-axis is the vertical axis since the bar data displays horizontally.
  • For each null or empty item in the array passed to Categories, [Category #] displays on the x-axis with # as the index number in the Categories array of the null or empty item. For example, [Category 1].
  • The index of each item in the Categories array must match with the index of its Series data value. You can retrieve a dictionary from the data field of a queryrecord() function result, and then use a!chartSeries() to create the Chart Series array.
  • A single Series item produces a single bar for each Categories item with all bars the same color.
  • Multiple Series items when Stacking is NONE or null produces a set of bars for each Categories item - one bar for each Series item with each bar in that set a different color. The order of the label items determine the display order of the columns in each set with the first label item appearing at the top of the set.
  • Multiple Series items when Stacking is NORMAL produces a single bar for each categories item with each Series item displayed as a different segment of the bar in a different color, so they appear stacked on top of each other. The order of the label items determine the display order of the bar segments with the first label item appearing closest to the axis.
  • If the Series argument has a non-null label value paired with a 0, null, or empty data value, the data value still displays in the legend.
  • If the Series argument has a null or empty label value paired with a non-null data value, the label value displays as [Series #] with # as the index number of the data value. For example, [Series 1].
  • If data values are small and less than a whole number, Appian recommends settings allowDecimalAxisLabels to true.

Examples

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

Single Series Bar Chart with Label, Y-Axis Title, and No Legend

1
2
3
4
5
6
7
8
9
=a!barChartField(
  categories: {"Red", "Green", "Blue"},
  series: {
    a!chartSeries(label: "Points", data: {20.3, 12.5, 18.2})
  },
  yAxisTitle: "Average Point Velocity",
  showLegend: false,
  showDataLabels: true
)

Displays the following:

Multiple Series Bar Chart with Label, Y-Axis Title, and No Stacking

1
2
3
4
5
6
7
8
9
10
=a!barChartField(
  categories: {"Americas", "EMEA", "APAC"},
  series: {
    a!chartSeries(label: "Referrals", data: {19, 8, null}),
    a!chartSeries(label: "Existing Clients", data: {11, 16, 10}),
    a!chartSeries(label: "Tradeshow Attendees", data: {14, 12, 7})
  },
  yAxisTitle: "Active Opportunities",
  showLegend: true
)

Displays the following:

*Multiple Series Bar Chart with Label, Y-Axis Title, and Stacking

1
2
3
4
5
6
7
8
9
10
11
=a!barChartField(
  categories: {"Americas", "EMEA", "APAC"},
  series: {
    a!chartSeries(label: "Referrals", data: {19, 8, null}),
    a!chartSeries(label: "Existing Clients", data: {11, 16, 10}),
    a!chartSeries(label: "Tradeshow Attendees", data: {14, 12, 7})
  },
  yAxisTitle: "Active Opportunities",
  stacking: "NORMAL",
  showLegend: true
)

Displays the following:

See also: queryrecord(), Tempo Report Best Practices

The following patterns include usage of the Bar Chart Component.

Open in Github Built: Fri, Mar 11, 2022 (04:59:07 PM)

On This Page

FEEDBACK