Components

Axes

Configure X and Y axes for cartesian charts

<XAxis> and <YAxis> render axis lines, ticks, and labels for cartesian charts.

Add axes

<BarChart :width="500" :height="300" :data="data">
  <XAxis data-key="name" />
  <YAxis />
  <Bar data-key="value" fill="#8884d8" />
</BarChart>

Domains, tick count, custom ticks, tick intervals, tick labels and hidden axis parts are explained in Axis domain and ticks.

XAxis props

PropTypeDefaultDescription
data-keystring | number | Function—Key from data
type'number' | 'category''category'Axis type
hidebooleanfalseHide the axis
orientation'top' | 'bottom''bottom'Axis position
tick-lineboolean | objecttrueShow tick lines
axis-lineboolean | objecttrueShow axis line
tick-formatterFunction—Format tick labels
tick-countnumber5Number of ticks
min-tick-gapnumber5Minimum gap between ticks
domainArray | Function—Axis domain [min, max]

YAxis props

PropTypeDefaultDescription
data-keystring | number | Function—Key from data
type'number' | 'category''number'Axis type
hidebooleanfalseHide the axis
orientation'left' | 'right''left'Axis position
widthnumber | 'auto'60Axis width
tick-lineboolean | objecttrueShow tick lines
axis-lineboolean | objecttrueShow axis line
tick-formatterFunction—Format tick labels
tick-countnumber5Number of ticks
domainArray | Function—Axis domain [min, max]

Shared axis props

AxisProps describes the common props; XAxisProps and YAxisProps add the axis-specific settings.

PropTypeDefaultDescription
tickboolean | SVGAttributestrueShow or style tick text; use #tick for custom content
anglenumber0Tick text rotation in degrees
labelstring | number | LabelProps—Axis label
namestring—Axis name used in tooltip data
strokestringvar(--v-charts-axis, #666)Axis and tick-line stroke
tick-sizenumber6Tick-line length in pixels
scaleScaleType | custom scale'auto'Scale name or a callable scale with copy, domain and range methods
paddingobject | 'gap' | 'no-gap'Zero paddingX uses left/right; Y uses top/bottom
x-axis-id / y-axis-idstring | number0Associate a series with its axis
<XAxis data-key="day" :tick="false" :angle="-45" label="Day" />

<YAxis orientation="right" :padding="{ top: 8, bottom: 8 }" />

CartesianAxis

<CartesianAxis> is the low-level axis that XAxis and YAxis draw. It has no scale of its own: you pass the position (x, y, width, height, orientation) and the ticks as { value, coordinate } items. Use it only to draw an axis at a place that the chart does not manage, for example inside a composable overlay; in all other cases use XAxis and YAxis.

Copyright © 2026