Data structures
If the labels
property of the main data
property is used, it has to contain the same amount of elements as the dataset with the most values. These labels are used to label the index axis (default x axes). The values for the labels have to be provided in an array. The provides labels can be of the type string or number to be rendered correctly. In case you want multiline labels you can provide an array with each line as one entry in the array.
data: [{x: 10, y: 20}, {x: 15, y: null}, {x: 20, y: 10}]
This is also the internal format used for parsed data. In this mode, parsing can be disabled by specifying parsing: false
at chart options or dataset. If parsing is disabled, data must be sorted and in the formats the associated chart type and scales use internally.
data: {
January: 10,
February: 20
In this mode, property name is used for index
scale and value for value
scale. For vertical charts, index scale is x
and value scale is y
.