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
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.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.Grid lines
Each axis owns its grid. Config decides whether the lines are drawn: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.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:
Ticks
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.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' 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:
ySecondary.position, it keeps that side however y moves.
Axis lines
UseaxisLine to draw a line along each axis. Lines are hidden by default.
This example replaces the built-in panel border with axis lines:
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
UsepanelBorder 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:
cornerRadius: 6. See
Styling for how entries resolve.
Related
- Scales — the axis range and type
- Styling — grid, tick, panel-border and frame paint
- Layout › Panel overflow — how the panel makes room for labels that spill past its edge

