Components

Pie and Donut

Compare parts of a whole with explicit category identity and native sectors.

Loading chart…

Team allocation (1,000 hours)
TeamHoursShare of total
design42042%
engineering31031%
operations17017%
research10010%

Usage

Set categoryKey for stable slice colors and innerRadius for a donut.

Composition
<Chart.Root config={config}>
  <Chart.Legend />
  <Chart.ResponsiveContainer width="100%" height={280}>
    <Chart.PieChart animate accessibilityLayer aria-label="Team allocation">
      <Chart.PieSeries data={data} dataKey="hours" categoryKey="key" nameKey="key" innerRadius={58} outerRadius={108}>
        <Chart.LabelList dataKey="share" position="inside" fill="white" stroke="none" style={{ fill: "white", fontWeight: 600 }} />
      </Chart.PieSeries>
      <Chart.Tooltip itemKey={(entry) => String(entry.payload?.key ?? entry.name)} />
    </Chart.PieChart>
  </Chart.ResponsiveContainer>
</Chart.Root>

Use stable keys for config, categoryKey, nameKey and Tooltip.itemKey. Reordering rows preserves their configured colors. Pie has no configured wrapper or separate Donut export.

Chart-owned angular entrance respects reduced motion. animationDirection changes the sweep, preserving final angles and data order.

Controlled categories

Filter rows when legend state changes: Root.visibleSeries alone does not hide sectors. Remaining sectors use the selected total; this example allows an empty selection.

Loading chart…

Team allocation (1,000 hours)
TeamHoursShare of total
design42042%
engineering31031%
operations17017%
research10010%

Materials

Choose plain, paper, clay or glow. Percentage labels remain inside sectors; category names stay in the legend.

Loading chart…

Team allocation (1,000 hours)
TeamHoursShare of total
design42042%
engineering31031%
operations17017%
research10010%

API reference

Focused props for explicit Pie composition; upstream links cover native options.

PieChart

Use inside a sized ResponsiveContainer.

PropTypeDefaultDescription
animateboolean | PieAnimationfalseSector entrance and interaction motion; respects reduced motion.
animationDirection"clockwise" | "anticlockwise""clockwise"Continuous entrance sweep; native geometry and row order stay unchanged.
accessibilityLayerbooleantrue in RechartsEnables native keyboard inspection; set explicitly here.
aria-label / aria-labelledbystring—Accessible chart name.
childrenReactNode—Explicit PieSeries, labels and tooltip.

PieAnimation accepts revealDurationMs (default 1000), revealEasing and hoverTransition. Changing these or direction during entrance finishes it. Per-series animation is disabled. See Recharts PieChart.

PieSeries

Value and category identity use separate fields.

PropTypeDefaultDescription
dataRow[]—Consumer-owned category rows.
dataKeystring | number | ((row: Row) => unknown)"value" in RechartsNumeric value field or accessor; set explicitly here.
categoryKeystring | ((row: Row) => string)OffResolves an own top-level field or accessor into Root.config; requires explicit series data and string IDs.
nameKeystring | number | ((row: Row) => unknown)"name"Native category name; use config keys for semantic identity.
innerRadiusnumber or percentage0A positive radius produces a Donut.
outerRadiusnumber or percentage"80%"Sector size; percentages use Recharts' available radius.
startAngle / endAnglenumber0 / 360Native angular geometry in degrees.
paddingAnglenumber0Gap between sectors in degrees.
material"plain" | "paper" | "clay" | "glow""plain"Finish on default sectors; consumer rendering can take precedence.
emphasisKey(payload: unknown) => string | number | undefinedNative nameOptional semantic sector identity for paint emphasis; does not configure tooltip identity.
strokestring"none"Native sector outline.

Explicit series fill disables category defaults; datum or Cell fill wins over them. Custom shapes retain rendering control. Filter rows explicitly; PieSeries has no seriesKey. Custom shapes, filters or transforms can bypass Kind paint. See Recharts Pie.

Shared components

Root, SeriesConfig, Labels and cells, Legend, Tooltip, ResponsiveContainer.