Search for a command to run...
Traffic Sources
Visitors by acquisition channel
Used for proportional breakdowns — share of voice, traffic by source, allocation by category — wherever the parts-of-a-whole story matters more than absolute values.
donut (centered total), legend (slice list), label (inline labels)npx shadcn@latest add https://ui.heygaia.io/r/pie-chart.jsonimport { PieChart } from "@/components/ui/pie-chart";
const data = [
{ source: "Direct", visitors: 1240 },
{ source: "Search", visitors: 980 },
{ source: "Social", visitors: 620 },
];
export default function Example() {
return (
<PieChart
data={data}
nameKey="source"
valueKey="visitors"
title="Traffic Sources"
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| data | Array<Record<string, string | number>> | - | Chart data rows |
| nameKey | string | - | Key for slice name |
| valueKey | string | - | Key for numeric slice value |
| title | string | - | Card title |
| description | string | - | Card description |
| footer | string | - | Optional footer text |
| mode | "donut" | "legend" | "label" | "donut" | Display mode |