Skip to content

Scale

Configure axis ticks, labels, and numeric formatting.

Options

General

OptionTypeDefaultDescription
shorthandNumericsbooleanfalseShow 9M instead of 9000000

Per-Axis (X and Y)

OptionTypeDefaultDescription
ticksnumber10Number of tick marks
tickLabelsstring[]Custom labels (cycles if needed)
drawTicksbooleantrueShow tick marks
drawLabelsbooleantrueShow tick labels
labelDirectionhorizontal|vertical|slantedhorizontalLabel orientation
axisColourstring#5e5e5eAxis line color

Y-Axis Only

OptionTypeDefaultDescription
startAtZerobooleanfalseForce scale to start at 0

Custom Labels

Replace numeric labels with text:

ts
scale: {
    x: {
        ticks: 7,
        tickLabels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        optimiseTicks: true
    }
}

Type Reference

See AxisOptions for full TypeScript definitions.

Released under the ISC License.