Charts

Bar Chart

Build bar charts with stacking, labels, and custom shapes

Bar charts compare values across categories using rectangular bars.

Simple Bar Chart

A basic bar chart with two data series.

Stacked Bar Chart

Use stack-id to stack bars within the same category.

When stacked values can be negative, set stack-offset="sign" on the chart. The default 'none' (the same as Recharts) adds the values as one running total, so a negative bar is drawn over the positive bar below it. With 'sign', positive values stack up from zero and negative values stack down from zero.

<BarChart :data="data" stack-offset="sign">
  <Bar data-key="income" stack-id="flow" />
  <Bar data-key="costs" stack-id="flow" />
</BarChart>

Horizontal Bar Chart

Set layout="vertical" on <BarChart> for horizontal bars.

Bar Chart with Labels

Place <LabelList> as a child inside <Bar>:

Negative Values

Use <Cell> to color positive and negative bars differently.

BarChart props

<BarChart> takes the chart container props, including bar sizing.

Bar props

PropTypeDefaultDescription
data-keyrow path or accessorrequiredField with the value
fillstringseries paletteBar fill
stroke, stroke-widthstring, number—Bar outline
stack-idstring | number—Bars with the same id stack
bar-sizenumber | stringthe chart's valueBar width
max-bar-sizenumberthe chart's valueUpper limit of the bar width
min-point-sizenumber | function0Minimum bar length, so small values stay visible
radiusnumber | [tl, tr, br, bl]—Corner radius
backgroundboolean | objectfalseDraw a background bar across the full range
active-barboolean | objectfalseHighlight the active bar; an object sets its attributes
active-indexnumber | null—Active bar, for v-model:active-index
labelboolean | objectfalseShow a value label on every bar
dataArraythe chart's dataRows for this series only
x-axis-id, y-axis-idstring | number0Axes this series uses
namestring | number—Name in the legend and tooltip
unitstring | number—Unit after tooltip values
legend-typeLegendType'rect'Legend icon
tooltip-type'none'—Set 'none' to leave the series out of the tooltip
hidebooleanfalseHide the series
classstring—Class on the series layer
is-animation-activebooleanthe chart's valueAnimate this series
transitionChartTransitionthe chart's valueTiming and easing of data changes

Events: @click, @mouseenter, @mouseleave with (bar, index, event), update:activeIndex, and @animation-start, @animation-end.

Bar slots

SlotPropsDescription
#shapeBarRectangleItem with numeric x, y, width, heightReplace a bar
#activeBarsame as #shapeReplace the active bar
#labelLabelListSlotPropsReplace a bar label
default—<Cell> for per-bar colors, <LabelList>, <ErrorBar>
Copyright © 2026