Bar chart visualization
Bar chart settings
Mapping
Type
X-Axis
Y-Axis
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:
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:
- Edit the tile, and click the More Options ellipsis button, then select Edit JSON.
- 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" } } } }, - Click Save to apply the changes.