Get StartedComponentsStylingThemingMath & Science
MCP

Charts

Pie & Donut

Pie and donut charts with angle padding, center text and detached slices.

Markdown

Import

tsx
import { DonutChart, PieChart } from "@indoku/ui"

Examples

Pie

Donut

Angle padding

padAngle leaves a gap between slices.

Radial text

radialText prints a label in the hole.

1,000visits

Detached segments

Push slices out with detached.

Props

PieChart / DonutChart

PropTypeDefaultDescription
dataPieDatum[]–Slices: name, value, color?
innerRadiusRationumber–0 = pie; DonutChart defaults to 0.6.
padAnglenumber0Degrees between slices.
detachednumber[]–Slice indexes pushed outwards.
radialText{ label: string; sublabel?: string }–Text in the center.

* required. Style props and HTML attributes are accepted as well.

Created by @indokudev