Pie charts
Every pie and donut from shadcn's gallery in Nelumbo's Material style: slices parted by even gaps with rounded ends, a slice that grows on a spring when it is in focus, labels on inverse chips and a big readout in the middle of a donut. The demos show blood immune cells by type from a flow panel, and reads per library in a pooled run, with illustrative numbers.
Simple and Separator None
Slices are rounded and parted by even gaps: a stroke in the card's color, so a gap keeps its width from rim to center, around a small hole so the slices never meet in a point. Drop the stroke, the hole and the corners for one continuous disc.
Label, Custom Label and Label List
Labels are small inverse chips, never bare numbers. piePillLabel draws them outside on a round-capped leader line (the value, or a name and value with a slice-colored dot) or inside the slice.
Legend and Donut
The legend is the chip row used across Nelumbo charts. A donut keeps the same gaps and pill ends around a hollow center.
Donut Active and Donut with Text
The active slice grows outward on a spring (PieActiveSector). Hover or tap to pick one, or tab to the chart: it is a single slider stop, the arrow keys move between slices and the value is read out. The center of a donut holds a readout (PieCenter).
Stacked
Two Pie series with different radii make concentric rings. The tooltip names the donor through labelFormatter.
Interactive
A connected switcher picks the library. The chart, the selector and the arrow keys share one useChartFocus selection, so the grown slice, the pressed library and the center value always agree.
Helpers
| Prop | Type | Default | Notes |
|---|---|---|---|
Pie paddingAngle, cornerRadius | number | 4, 12 | Gaps and pill ends. Use 0 and 0 with stroke none for Separator None |
piePillLabel(options) | label renderer | Pie label as an inverse pill. position outside (leader line) or inside; text(value, name); dot; offset | |
PieActiveSector | activeShape | The slice grown by grow px (default 12), settling on a spring. Use with a controlled activeIndex | |
PieCenter value, label | component | Big readout centered over a donut; place it in a relative wrapper beside the ChartContainer | |
ChartContainer focus | ChartFocus | From useChartFocus: the chart is one slider stop; arrow keys move the active slice |