#191
Stacked bars
A stacked bar chart splitting six months of revenue into four acquisition channels.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Stacked bars" pattern (@codeatlasdev/ui demo #191, charts/bar) in my app.
Call get_demo({ ids: ["#191"] }) first and keep its structure. It needs @codeatlasdev/[email protected] + echarts.
Use: Showing how a total is composed of channels or segments over time.
Keep these library parts, with the props and tokens the demo uses:
- Card from "@codeatlasdev/ui"
- BarChart from "@codeatlasdev/ui/charts"
Behaviour to keep:
- `<BarChart` inside `<Card full>`
- 4 series in `series`: Organic, Paid, Referral, Direct, each with 6 values
- `categories={months}` with `'Jan'` to `'Jun'`
- `stacked` prop
- `valueFormatter={fmt}` renders `$${(v / 1000).toFixed(0)}k`
- `height="300px"`
Reduced motion: the demo handles it; keep that branch.
Keyboard: not an interactive control.
Change only the copy and the data. Use the theme tokens (--ca-*), never raw colours. Library parts
- Card
@codeatlasdev/ui - BarChart
@codeatlasdev/ui/charts
How it is built
- `<BarChart` inside `<Card full>`
- 4 series in `series`: Organic, Paid, Referral, Direct, each with 6 values
- `categories={months}` with `'Jan'` to `'Jun'`
- `stacked` prop
- `valueFormatter={fmt}` renders `$${(v / 1000).toFixed(0)}k`
- `height="300px"`
Related
Loading source.