Charts guide
SunburstChart
Nested data shown as concentric weighted arcs.
Install
npx shadcn@latest add @foldcn/sunburst-chartSunburstChart parameters
| Parameter | Type / props | Behavior |
|---|---|---|
data | HierarchyNode | HierarchyNode[] | Nested { name, value?, children? } nodes. |
dataKey / nameKey | string | Numeric value and label fields. Defaults to value / name. |
width / height | number | SVG dimensions. |
responsive | boolean | Fits the SVG to the available width. |
padding / nodeInset / nodeGap / aspectRatio | number | Treemap cell inset, gap, and squarify ratio. |
type / content / focusPath / onNodeClick | flat | nest / callback / number[] / callback | Treemap rendering and caller-owned drill-down state. |
onNodeHover / activeTooltip | callback / { name, value, x, y, color } | null | Caller-owned treemap hover state and tooltip display. |
innerRadius / outerRadius / ringPadding | number | Sunburst ring limits and spacing. |
cx / cy / startAngle / endAngle | number | Sunburst center and angular span. |
textOptions | { fill?: string } | Sunburst value label color; none hides labels. |
title / className | string | Accessible SVG label and wrapper class. |
Supports weighted hierarchy rings, inherited colors, value labels, and source angle/radius defaults. Tooltip details and navigation remain open.
Examples
The first example is open. Expand Source inside an example to view its code. Other examples load when opened.
Measured entry: www/src/views/IndexView/IndexLineChart.tsx
Tree-shaken total: 906.15 KB
Minified + gzip: 98.70 KB
Source data is ported. Visual details or interactions may still differ from Recharts.
View the Recharts example