Bar chart visualization

Bar chart settings

Mapping

Setting
Description
X-Axis
Choose which data to show on the x-axis. Auto <column> shows the column which was selected automatically for you, usually a time field for the x-axis.
Y-Axis
Choose which data to show on the y-axis. Auto <column> shows the column which was selected automatically for you, usually a numerical field for the y-axis.
Series
Select the column used to split the x-axis values into series.

Type

Setting
Description
Show as groups
Toggle whether to display the Series as grouped bars. This option is only enabled when a Series is selected.
Mode
Percentage mode displays a series as a percentage of the overall bar, only available when a Series is selected.
Layout
Vertical or horizontal.

X-Axis

Setting
Description
Label
Allows you to override the default and enter a label, for example Date or Time.

Y-Axis

Setting
Description
Label
Allows you to override the default and enter a label, for example Tickets or ms.
Range
Auto - graph is fitted to the data automatically

Percentage - shows 0-100

Fit to data from zero - shows from 0 to the data maximum

Custom - allows you to specify the min and max

Color

Setting the Color to Custom allows you to choose a color and write an expression for the condition that a color should match. If more than one expression matches, then the last match decides the color.

Using 'value' expressions to show custom colors ("value <= 5" shows red, and "value > 5 && value <= 90" shows green).

Expressions can use the following:

Expression
Description
Use case
Examples
value
The value of the bar segment
A cpu usage bar chart, where colors match based on how high the cpu usage goes.
Green:
value < 40
Yellow:
value >= 40
Red:
value >= 80
label
The x-axis label of the bar segment
A specific month of a year marked, e.g. start of the financial year marked on a multi-year revenue diagram.
Red:
label == "jan"
series
The name of the series the bar segment is a part of.
Specific servers/objects being consistently colored.
Red:
series == "Server 1"
Blue:
series == "Server 2"
seriesIndex
The index of the series the bar segment is a part of.
Color series based on the order in which they appear. Combined with the modulo operator `%` this can be used to define a custom palette.
Blue:
seriesIndex % 3 == 0
Cyan:
seriesIndex % 3 == 1
Purple:
seriesIndex % 3 == 2
barIndex
barIndex is used to specify the bar position from left to right starting at 0. So 0, 1, 2, 3, 4 etc.
Color the bars based on the order in which they appear.
barIndex % 4 ==0 will use your selected color for bar 0 (the first bar), then bar 4, bar 8 etc.
Red:
barIndex % 4 == 0

For backwards compatibility, if the palette property was used in the JSON, this is converted to expressions and shown in the Color panel.

Using JavaScript in custom color expressions

You can also use builtin Javascript functions such as value.includes() and Math.round(value), but most expressions will probably just be simple comparisons of the values such as >, < and ==.

Expressions should contain a single mustache that resolves to a true or false value.

JavaScript
What it does
label.includes('TEST')
This returns true if a string contains a specified string (TEST in this example).
series.indexOf('Sales') !== -1
This checks if the text Sales exists inside the series. The JavaScript checks if the result is not equal to -1, so if Sales is found then the expression evaluates to true, and if Sales is not found then it resolves to false.
Math.round(value)
This returns the value of a number rounded to the nearest integer.

Legend

Setting
Description
Show legend
Toggle whether to display a colored legend for each series of data in the graph. Enabling the toggle displays the Legend position field below.
Position
Select where the legend is displayed in relation to the graph. This field is only visible when the Show legend toggle is enabled.

Annotations

Setting
Description
Show values
Displays an annotation of the value for each bar / series in the chart. This annotation may be hidden depending on the space available.
Series total
Displays an annotation of the total value for each series in the chart. This annotation may be hidden depending on the space available.

Options

Setting
Description
Grid lines
Select whether to include grid lines.
Annotation
Display an annotation showing the value for each series.

Was this article helpful?


Have more questions or facing an issue?