Category scales
Typical bar and line charts use a category scale for the x axis, and a numeric scale for the y axis. Multiple datasets reuse the same category data. In these charts, the values used for the category axis are obtained from the labels
property of the data object. If a dataset has a labels
property, its x axis will automatically be defined as type:category
.
Configuring the axes
Category scales share the same axis configuration as numeric charts, but support some additional properties in the axis
and axis.ticks
objects. The axis
object has one additional property that can be used to override the data object labels
for an axis:
Property | Value | Description |
| Array of String | An array of labels to display. Overrides any other definition for labels, including data object properties: |
Additional axis configuration for category scales
The following code fragment shows category labels defined in three different properties. Since the single x axis contains a labels...