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 expressions for what condition that color should match on. If more than one expression matches, then the last match decides the color of the bar.

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.

In the JSON, custom color palettes can be declared as either an array or an object, as follows:

  • Array: Select the colors based on the order of the data (for example, the first series is the first color).
    "palette": ["red", "#abcdef", "green"]
  • Object: Select colors based on the series label.
    "palette": { "EC2": "red", "Lambda": "#abcdef", "CloudWatch": "blue" }

To apply a custom palette using the JSON:

  1. Edit the tile, and click the More Options ellipsis button, then select Edit JSON.
  2. Enter the JSON for the palette you want to apply under visualisation/config/data-stream-bar-chart. For example:
    "visualisation": {
        "type": "data-stream-bar-chart",
        "config": {
          "data-stream-bar-chart": {
            "horizontalLayout": "vertical",
            "grouping": false,
            "showValue": false,
            "displayMode": "actual",
            "xAxisLabel": "",
            "yAxisLabel": "",
            "range": {
              "type": "auto"
            },
            "showGrid": true,
            "showLegend": false,
            "legendPosition": "bottom",
            "palette": {
              "EC2": "red",
              "Lambda": "#abcdef",
              "CloudWatch": "blue"
            }
          }
        }
      },
  3. Click Save to apply the changes.

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?