Linear Axis

    Namespace:

    Common options to all cartesian axes

    Namespace: options.scales[scaleId]

    NameTypeDefaultDescription
    boundsstring‘ticks’Determines the scale bounds.
    positionstring | objectPosition of the axis. more…
    stackstringStack group. Axes at the same position with same stack are stacked.
    stackWeightnumber1Weight of the scale in stack group. Used to determine the amount of allocated space for the scale within the group.
    axisstringWhich 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’.
    offsetbooleanfalseIf 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.
    titleobjectScale title configuration.

    Namespace: options.scales[scaleId]

    Linear Axis specific tick options

    NameTypeScriptableDefaultDescription
    countnumberYesundefinedThe number of ticks to generate. If specified, this overrides the automatic generation.
    formatobjectYesThe options used by the default label formatter
    maxTicksLimitnumberYes11Maximum number of ticks and gridlines to show.
    precisionnumberYesif defined and stepSize is not specified, the step size will be rounded to this many decimal places.
    stepSizenumberYesUser-defined fixed step size for the scale. more…

    Namespace: options.scales[scaleId].ticks

    Common tick options to all axes

    Namespace: options.scales[scaleId].ticks

    NameTypeScriptableDefaultDescription
    backdropColorColorYes‘rgba(255, 255, 255, 0.75)’Color of label backdrops.
    backdropPadding2Padding of label backdrop.
    callbackfunctionReturns the string representation of the tick value as it should be displayed on the chart. See callback.
    displaybooleantrueIf true, show tick labels.
    colorYesChart.defaults.colorColor of ticks.
    fontFontYesChart.defaults.fontSee Fonts
    majorobject{}.
    paddingnumber3Sets the offset of the tick labels from the axis
    showLabelBackdropbooleanYestrue for radial scale, false otherwiseIf true, draw a background behind the tick labels.
    textStrokeColorColorYes``The color of the stroke around the text.
    textStrokeWidthnumberYes0Stroke width around the text.
    znumber0z-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.

    Linear Axis - 图2

    config setup