Back to Chart Js

Common Ticks

docs/axes/cartesian/_common_ticks.md

4.5.12.3 KB
Original Source

Common tick options to all cartesian axes

Namespace: options.scales[scaleId].ticks

NameTypeDefaultDescription
alignstring'center'The tick alignment along the axis. Can be 'start', 'center', 'end', or 'inner'. inner alignment means align start for first tick and end for the last tick of horizontal axis
crossAlignstring'near'The tick alignment perpendicular to the axis. Can be 'near', 'center', or 'far'. See Tick Alignment
sampleSizenumberticks.lengthThe number of ticks to examine when deciding how many labels will fit. Setting a smaller value will be faster, but may be less accurate when there is large variability in label length.
autoSkipbooleantrueIf true, automatically calculates how many labels can be shown and hides labels accordingly. Labels will be rotated up to maxRotation before skipping any. Turn autoSkip off to show all labels no matter what.
autoSkipPaddingnumber3Padding between the ticks on the horizontal axis when autoSkip is enabled.
includeBoundsbooleantrueShould the defined min and max values be presented as ticks even if they are not "nice".
labelOffsetnumber0Distance in pixels to offset the label from the centre point of the tick (in the x-direction for the x-axis, and the y-direction for the y-axis). Note: this can cause labels at the edges to be cropped by the edge of the canvas
maxRotationnumber50Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. Note: Only applicable to horizontal scales.
minRotationnumber0Minimum rotation for tick labels. Note: Only applicable to horizontal scales.
mirrorbooleanfalseFlips tick labels around axis, displaying the labels inside the chart instead of outside. Note: Only applicable to vertical scales.
paddingnumber0Padding between the tick label and the axis. When set on a vertical axis, this applies in the horizontal (X) direction. When set on a horizontal axis, this applies in the vertical (Y) direction.
maxTicksLimitnumber11Maximum number of ticks and gridlines to show.