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>

Hide axis lines

<YAxis :tick-line="false" :axis-line="false" />

Format tick labels

<XAxis data-key="date" :tick-formatter="(value) => new Date(value).toLocaleDateString()" />

Customize tick count

<YAxis :tick-count="3" />

XAxis props

PropTypeDefaultDescription
dataKeystring | number | FunctionKey from data
type'number' | 'category''category'Axis type
hidebooleanfalseHide the axis
orientation'top' | 'bottom''bottom'Axis position
tickLineboolean | objecttrueShow tick lines
axisLineboolean | objecttrueShow axis line
tickFormatterFunctionFormat tick labels
tickCountnumberNumber of ticks
minTickGapnumber5Minimum gap between ticks
domainArrayAxis domain [min, max]

YAxis props

PropTypeDefaultDescription
dataKeystring | number | FunctionKey from data
type'number' | 'category''number'Axis type
hidebooleanfalseHide the axis
orientation'left' | 'right''left'Axis position
widthnumber60Axis width
tickLineboolean | objecttrueShow tick lines
axisLineboolean | objecttrueShow axis line
tickFormatterFunctionFormat tick labels
tickCountnumberNumber of ticks
domainArrayAxis domain [min, max]
Copyright © 2026