Linear Axis
Namespace:
Common options to all cartesian axes
Namespace: options.scales[scaleId]
Name | Type | Default | Description |
---|---|---|---|
bounds | string | ‘ticks’ | Determines the scale bounds. |
position | string | object | Position of the axis. more… | |
stack | string | Stack group. Axes at the same position with same stack are stacked. | |
stackWeight | number | 1 | Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group. |
axis | string | Which type of axis this is. Possible values are: ‘x’ , ‘y’ . If not set, this is inferred from the first character of the ID which should be ‘x’ or ‘y’ . | |
offset | boolean | false | If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default. |
title | object | Scale title configuration. |
Namespace: options.scales[scaleId]
Linear Axis specific tick options
Name | Type | Scriptable | Default | Description |
---|---|---|---|---|
count | number | Yes | undefined | The number of ticks to generate. If specified, this overrides the automatic generation. |
format | object | Yes | The options used by the default label formatter | |
maxTicksLimit | number | Yes | 11 | Maximum number of ticks and gridlines to show. |
precision | number | Yes | if defined and stepSize is not specified, the step size will be rounded to this many decimal places. | |
stepSize | number | Yes | User-defined fixed step size for the scale. more… |
Namespace: options.scales[scaleId].ticks
Common tick options to all axes
Namespace: options.scales[scaleId].ticks
Name | Type | Scriptable | Default | Description |
---|---|---|---|---|
backdropColor | Color | Yes | ‘rgba(255, 255, 255, 0.75)’ | Color of label backdrops. |
backdropPadding | 2 | Padding of label backdrop. | ||
callback | function | Returns the string representation of the tick value as it should be displayed on the chart. See callback. | ||
display | boolean | true | If true, show tick labels. | |
color | Yes | Chart.defaults.color | Color of ticks. | |
font | Font | Yes | Chart.defaults.font | See Fonts |
major | object | {} | . | |
padding | number | 3 | Sets the offset of the tick labels from the axis | |
showLabelBackdrop | boolean | Yes | true for radial scale, false otherwise | If true, draw a background behind the tick labels. |
textStrokeColor | Color | Yes | `` | The color of the stroke around the text. |
textStrokeWidth | number | Yes | 0 | Stroke width around the text. |
z | number | 0 | z-index of tick layer. Useful when ticks are drawn on chart area. Values <= 0 are drawn under datasets, > 0 on top. |
If set, the scale ticks will be enumerated by multiple of stepSize
, having one tick per increment. If not set, the ticks are labeled automatically using the nice numbers algorithm.
If the value is string ending with , its treat as percentage. If number, its treat as value. The value is added to the maximum data value and subtracted from the minimum data. This extends the scale range as if the data values were that much greater.
config setup