Pie Chart

A React SVG pie chart with outside labels on leader lines, a legend and slices that pull out on hover or focus to show value and share, plus a hidden data table.

src/registry/ui/pie-chart.tsx/r/pie-chart.json

Installation#

bash
npx shadcn@latest add https://ui.minidev.pro/r/pie-chart.json

Usage#

tsx
import { PieChart } from "@/components/ui/pie-chart"

export function Example() {
  return <PieChart />
}

API reference#

PieChart props
PropTypeDefault
dataPieDatum[]SAMPLE
titlestring"Revenue by plan"
captionstring"Monthly recurring revenue"
format(value: number) => stringdefaultFormat
showLabelsbooleantrue
showLegendbooleantrue
pullOutnumber6
classNamestring-

Dependencies#

npm

motion

Built from

No other MiniDev files
All chart components