
Usage
import { BarChart } from "@/registry/components/bar-chart/bar-chart";
<BarChart data={[/* … */]} x={/* … */} series={[/* … */]} label="…" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | T[] | ||
x | keyof T & string | ||
series | BarSeries[] | ||
label | string | Accessible summary of the chart | |
stacked? | boolean | false | |
height? | number | 240 | |
formatValue? | (v: number) => string | (v) => v.toLocaleString() |
When to use
Comparing amounts across a handful of categories or periods (up to about 20 bars), grouped or stacked.
When not to use
Long continuous series (use line-chart); a single value (use gauge or number-ticker).
Related
Line chart · Gauge · Data grid