Skip to main content
The axes section controls how each position scale is drawn: its label, side, grid lines and ticks. It is keyed by axis: x, y, and ySecondary for combo charts.

Per-axis options

string | null
default:"null"
Axis title. With null the axis shows the column’s label from the data when one is declared, otherwise no title. With '' the axis shows no title, whatever the column declares.
boolean
default:"true"
Whether the axis is drawn at all.
'left' | 'right' | 'top' | 'bottom'
Which side the axis sits on. Defaults to 'bottom' for x and 'right' for y. A side that does not match the axis orientation is ignored: on a flipped graph x runs vertically, so 'bottom' gives way to the side the coord assigns.
object
Grid lines for this axis — see below.
object
Ticks for this axis — see below.

Grid lines

Each axis owns its grid. Config decides whether the lines are drawn:
boolean | null
default:"null"
true or false forces visibility. null lets the geom decide: bars hide the band-axis grid, tiles hide both. With nothing to decide from, the x and y grids show and a secondary y grid stays hidden.
How the lines look (color, width, dash pattern) comes from the stylesheet’s gridLine target. The built-in stylesheet draws y grid lines dashed and gives x grid lines strokeWidth: 0, so vertical grid lines appear only once you give them a width, even where config allows them:
See Styling for the full target list.

Ticks

boolean
Whether tick marks, the short lines that step out of the axis, are drawn. Defaults to true for x and false for y. Tick labels render either way. Their paint lives on the stylesheet’s tickLabel target; the marks’ paint on tickLine.
The built-in tickLine has strokeWidth: 0 and length: 0, so tick marks stay invisible until the stylesheet sizes them. ticks.visible then decides whether they are drawn and whether their length reserves space:
'auto' | 'edges'
default:"auto"
'auto' places ticks across the axis. 'edges' keeps only the two domain endpoints of a continuous or datetime axis. Discrete axes keep their full domain either way.
The axis controls labels, ticks and grid. The range comes from its scale: use scale.y.continuous({ domainMin: 0, nice: true }) to pin bounds.

The second y axis

ySecondary is a sparse override of the primary y axis, for combo charts that pair two value scales. Every field you leave unset is inherited at compile time:
A field you set stays set: once you give ySecondary.position, it keeps that side however y moves.

Axis lines

Use axisLine to draw a line along each axis. Lines are hidden by default. This example replaces the built-in panel border with axis lines:
Use style.axisLine.x or style.axisLine.y to style one axis. Secondary y axes use the y style. Lines follow axis positions, including flipped charts, and disappear when their axis is hidden. Polar axes draw no axis lines. Set cornerRadius on style.axisLine to round shared corners. It defaults to 0. lineCap controls stroke ends and defaults to 'butt'; use 'round' for rounded ends or dots. If you also draw a panel border, matching its radius keeps the corners aligned. The layout reserves the wider of the axis line and border on each edge. Grid lines at occupied edges are omitted.

Panel border

Use panelBorder for a frame around the plot:
stroke, strokeWidth and dashArray apply to all four sides. Set strokeWidth: 0 to hide the frame and reserve no space. Use axis lines for lines beside axes. Round the frame with cornerRadius:
The built-in default is a dashed border with cornerRadius: 6. See Styling for how entries resolve.