Linear Axis

    Namespace:

    Common options to all cartesian axes

    Namespace: options.scales[scaleId]

    NameTypeDefaultDescription
    boundsstring‘ticks’Determines the scale bounds.
    positionstringPosition of the axis. more…
    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

    NameTypeDefaultDescription
    countnumberundefinedThe number of ticks to generate. If specified, this overrides the automatic generation.
    formatobjectThe options used by the default label formatter
    maxTicksLimitnumber11Maximum number of ticks and gridlines to show.
    precisionnumberif defined and stepSize is not specified, the step size will be rounded to this many decimal places.
    stepSizenumberUser-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
    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
    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