Simulates prefers-reduced-motion for the demo. Off follows your system setting.
Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.
1
| month | Free | Pro | Team |
|---|---|---|---|
| Jan | 120 | 40 | 12 |
| Feb | 150 | 52 | 18 |
| Mar | 170 | 61 | 25 |
| Apr | 165 | 70 | 31 |
| May | 198 | 84 | 36 |
| Jun | 230 | 96 | 47 |
A bar chart that stacks each series into one column per label.
npx shadcn@latest add ikislay/pixel-ui/stacked-bar-chartimport { StackedBarChart } from "@/components/ui/stacked-bar-chart"const data = [{ month: "Jan", free: 120, pro: 40, team: 12 },{ month: "Feb", free: 150, pro: 52, team: 18 },{ month: "Mar", free: 170, pro: 61, team: 25 },]export function Demo() {return (<StackedBarChartlabel="Plans by month"data={data}index="month"series={[
1// Loading…
Options you can pass to customize this component.
data*Record<string, string | number>[]One object per point along the x axis.
index*stringThe key in each object that labels the x axis.
series*{ key: string; label?: string; color?: string }[]The keys to plot. Colors follow the chart palette in order unless you set one. Negative values count as zero.
label*stringNames the chart for screen readers and captions its data table.
heightnumberHeight in pixels. The width fills the parent.
format(value: number) => stringFormats values wherever the chart shows them. Defaults to short numbers like 12.4K.
radiusnumberCorner radius at the top of each column. It shrinks to fit a short column.
classNamestringMerged onto the root element.