Pie Chart

A customizable pie chart component to visualize proportional data with support for donut charts. 🍰



Installation

pnpm dlx shadcn@latest add 'https://retroui.dev/r/pie-chart.json'


Examples

Default



Donut Chart



API Reference

PropTypeDefaultDescription
dataRecord<string, any>[][]Array of data objects to display
dataKeystring-Key for the data values
nameKeystring-Key for the category names
colorsstring[]["var(--chart-1)", ...]Array of colors for the pie segments
innerRadiusnumber0Inner radius (use > 0 for donut chart)
outerRadiusnumber80Outer radius of the pie
tooltipBgColorstring"var(--background)"Background color for tooltips
tooltipBorderColorstring"var(--border)"Border color for tooltips
valueFormatter(value: number) => string(value) => value.toString()Function to format values
showTooltipbooleantrueWhether to show tooltips on hover
classNamestring-Additional CSS classes

Last Updated: 12 Aug, 2025