Skip to main content

Axis Configuration Options

Axis options control the behavior, appearance, and scale of chart axes (xAxis, yAxis, colorAxis, etc.). Source: ts/Core/Axis/AxisOptions.ts

Basic Configuration

Core Options

type

string
default:"linear"
The axis type: ‘linear’, ‘logarithmic’, ‘datetime’, or ‘category’

categories

Array<string>
Category names for categorical axes

title

object
Axis title configuration
Source: Referenced in ts/Core/Axis/AxisOptions.ts:30

Scale Options

min

number | null
Minimum value of the axis. If null, automatically calculated.

max

number | null
Maximum value of the axis. If null, automatically calculated.

minPadding

number
default:"0.01"
Padding below the minimum value (fraction of axis range)

maxPadding

number
default:"0.01"
Padding above the maximum value (fraction of axis range)

startOnTick

boolean
default:"true"
Whether to force the axis to start on a tick

endOnTick

boolean
default:"true"
Whether to force the axis to end on a tick

tickInterval

number
The interval between ticks

tickAmount

number
Approximate number of ticks to show

Appearance Options

lineColor

ColorType
default:"#ccd6eb"
Color of the axis line

lineWidth

number
default:"1"
Width of the axis line in pixels

gridLineColor

ColorType
default:"#e6e6e6"
Color of the grid lines

gridLineWidth

number
default:"1"
Width of the grid lines

gridLineDashStyle

string
default:"Solid"
Dash style of the grid lines

minorGridLineColor

ColorType
default:"#f2f2f2"
Color of minor grid lines

minorGridLineWidth

number
default:"1"
Width of minor grid lines

minorTickInterval

number | 'auto'
Interval for minor ticks

Label Options

labels

object
Axis label configuration
Source: Referenced in ts/Core/Axis/AxisOptions.ts:26-27

Tick Options

tickColor

ColorType
default:"#ccd6eb"
Color of the tick marks

tickWidth

number
default:"1"
Width of the tick marks in pixels

tickLength

number
default:"10"
Length of the tick marks in pixels

tickPosition

string
default:"outside"
Position of tick marks: ‘inside’ or ‘outside’

tickPositions

Array<number>
Explicit tick positions

Crosshair

crosshair

boolean | object
default:"false"
Crosshair configuration for highlighting axis values
Source: Referenced in ts/Core/Axis/AxisOptions.ts:25

Plot Lines & Bands

plotLines

Array<object>
Array of plot lines to draw on the axis

plotBands

Array<object>
Array of plot bands to highlight ranges

Positioning

opposite

boolean
default:"false"
Whether to display the axis on the opposite side

offset

number
default:"0"
Distance in pixels to offset the axis from the default position

width

number | string
Width of the axis in pixels or percentage

height

number | string
Height of the axis in pixels or percentage

left

number | string
Left position of the axis

top

number | string
Top position of the axis

Breaks

breaks

Array<object>
Axis breaks for skipping ranges

Events

events

object
Event handlers for axis events
Source: Referenced in chart events

Datetime Options

dateTimeLabelFormats

object
Format strings for datetime labels

minRange

number
Minimum range to display (prevents zooming too far in)

Advanced Options

reversed

boolean
default:"false"
Whether to reverse the axis direction

alignTicks

boolean
default:"true"
Whether to align ticks with other axes

allowDecimals

boolean
default:"true"
Whether to allow decimals in the axis values

softMin / softMax

number
Soft minimum - only applied if no data is below this value
number
Soft maximum - only applied if no data is above this value

visible

boolean
default:"true"
Whether the axis is visible

Complete Example

See Also