Skip to content
Browse docs and components

Bar Chart

bar-chart

A single or grouped column chart in plain SVG. Columns are capped at 24px with rounded tops and 2px gaps, the hovered category lifts while the rest recede, arrow keys read each category, and a hidden table carries every value.

Responsive

Install

$npxshadcnadd@forme/bar-chart

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

BarChart

A column chart, single or grouped, in plain SVG.

PropTypeDefaultDescription
data*readonly Row[]—
index*keyof Row & string—The field that names each category.
series*readonly BarSeries<Row>[]—One series is a plain column chart; more are grouped side by side.
label*string—
heightnumber240
formatValue(value: number) => string(value) => value.toLocaleString("en-US")
classNamestring—