Groups
infoj
entries can be grouped for a more structured visual display in the location's info drawer.
Groups are created by defining an entry as "type" : "group"
. A group must have a unique label. Any subsequent entry can be added to a previously defined group by assigning the group's label to the group
key of the entry that should be added to the group.
By default, groups are displayed in a collapsed state that shows just the group label and hides all its entries. To overwrite this behaviour, set the group's expanded
option to true
.
Charts
Grouped integer and numeric values can be displayed as a chart by defining the chart type in the group's entry. Default chart settings:
Chart "type"
defaults to "line"
. Charts are built using Chart.js where all supported chart types are documented. If data values run in big numbers and take space on left margin they can be scaled by setting "unit"
property. Supported values are "k"
for thousands and "M"
for millions.
In order to give chart data series colours set the following properties:
Both properties take either single colour as string or array of colours. Colours can be given in either Hex, RGB or HSL.
Legend is hidden by default. In order to display legend:
By default, a group is displayed in table view, and can be switched to chart view when clicking an icon. To swap this behaviour, i.e. show a chart by default and allow switching to table view with the icon, add the active
option to the chart object:
Chart can be set to custom height with custom tooltip alignment - to enable more readable layout.
Stacked bar chart
Charts of type bar
and horizontalBar
support data visualised in stacks.
In order to define a stacked chart:
set
"stack"
property to one of thestacks
values in each group itemset
"backgroundColor"
or"borderColor"
to array of colours to use for respective stacksimportant:
label
within group must be consistent across stacks.
Last updated