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.

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

PropTypeDefaultDescription
dataArray[]Data array
widthnumberChart width
heightnumberChart height
layout'horizontal' | 'vertical''horizontal'Layout direction
barGapnumber | string4Gap between bars in same category
barCategoryGapnumber | string'10%'Gap between bar categories
syncIdstringSync hover across charts

Bar props

PropTypeDefaultDescription
dataKeystring | number | FunctionrequiredKey from data
fillstringBar fill color
stackIdstringStack ID
barSizenumberBar width in pixels
maxBarSizenumberMaximum bar width
activeIndexnumberPin a bar as always active
hidebooleanfalseHide the bars
isAnimationActivebooleantrueEnable animation
Copyright © 2026