Charts guide

SunburstChart

Nested data shown as concentric weighted arcs.

Install

npx shadcn@latest add @foldcn/sunburst-chart

SunburstChart parameters

ParameterType / propsBehavior
dataHierarchyNode | HierarchyNode[]Nested { name, value?, children? } nodes.
dataKey / nameKeystringNumeric value and label fields. Defaults to value / name.
width / heightnumberSVG dimensions.
responsivebooleanFits the SVG to the available width.
padding / nodeInset / nodeGap / aspectRationumberTreemap cell inset, gap, and squarify ratio.
type / content / focusPath / onNodeClickflat | nest / callback / number[] / callbackTreemap rendering and caller-owned drill-down state.
onNodeHover / activeTooltipcallback / { name, value, x, y, color } | nullCaller-owned treemap hover state and tooltip display.
innerRadius / outerRadius / ringPaddingnumberSunburst ring limits and spacing.
cx / cy / startAngle / endAnglenumberSunburst center and angular span.
textOptions{ fill?: string }Sunburst value label color; none hides labels.
title / classNamestringAccessible 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