#207
Donut with center KPI
A donut chart with a total value and caption shown in the centre.
Hand this to your AI. It names the exact library parts, timings and accessibility promises of this demo.
Build the "Donut with center KPI" pattern (@codeatlasdev/ui demo #207, charts/pie) in my app.
Call get_demo({ ids: ["#207"] }) first and keep its structure. It needs @codeatlasdev/[email protected] + echarts.
Use: Summarising a total inside the donut, like total revenue split by category.
Keep these library parts, with the props and tokens the demo uses:
- Card from "@codeatlasdev/ui"
- PieChart from "@codeatlasdev/ui/charts"
Behaviour to keep:
- `<PieChart data={marketData} donut`
- `centerLabel={{ value: '$2.4M', label: 'Total Revenue' }}`
- `marketData` has 5 items: Cloud Services `38`, Enterprise SW `24`, SaaS Tools `18`, Infrastructure `12`, Other `8`
- `height="300px"` inside `<Card full>`
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 - PieChart
@codeatlasdev/ui/charts
How it is built
- `<PieChart data={marketData} donut`
- `centerLabel={{ value: '$2.4M', label: 'Total Revenue' }}`
- `marketData` has 5 items: Cloud Services `38`, Enterprise SW `24`, SaaS Tools `18`, Infrastructure `12`, Other `8`
- `height="300px"` inside `<Card full>`
Related
Loading source.