Native Solid 2 fork of solid-recharts (MIT, © Thomas Guehenneux), derived from Recharts (MIT, © recharts). Adapted documentation; neither project endorses this fork.

SunburstChart

SunburstChart is a self-contained radial hierarchical chart that displays nested data as concentric rings of sectors. Each sector's angle is proportional to its value within its parent, making hierarchical proportions and structure easy to see at a glance. It is not placed inside another chart container.

30403525
() => {
const data = {
name: "Packages",
children: [
{ name: "Themes", fill: "var(--accent-9)", children: [{ name: "Layout", value: 30, fill: "var(--accent-8)" }, { name: "Forms", value: 40, fill: "var(--accent-7)" }] },
{ name: "Charts", fill: "var(--teal-9)", children: [{ name: "Cartesian", value: 35, fill: "var(--teal-8)" }, { name: "Polar", value: 25, fill: "var(--teal-7)" }] },
],
};
return <ResponsiveContainer width="100%" height={300} initialDimension={{ width: 560, height: 300 }}>
<SunburstChart data={data} innerRadius={30} />
</ResponsiveContainer>;
}

Props

PropTypeDefaultDescription
dataobject—Root node with nested children array
dataKeystring"value"Key to read each node's numeric value
nameKeystring | function"name"Key to read each node's name / label
width, heightnumber | "%"—Fixed size or percentage inside ResponsiveContainer
innerRadiusnumber50Radius of the innermost ring (center hole)
outerRadiusnumber—Outer radius of the outermost ring
paddingnumber2Space between sectors (stroke width)
ringPaddingnumber2Padding between each hierarchical level
cx, cynumber | "%""50%"Center point of the chart
fill, strokestring—Default sector colors

The base props follow the Recharts 3.9.2 SunburstChart API (reference commit b3451050) that solid-recharts tracks; see the Recharts SunburstChart reference. The next-suite release scope lists selected adaptations, not full Recharts 3.10.1 parity.

Notes

  • Data shape: The data prop is a single root node object with a nested children array. Each child can have its own children, forming an arbitrary tree.
  • Values: Each node's numeric dataKey is summed across its children. Leaf nodes should have explicit values; parent values roll up automatically.
  • Colors: Use the fill prop on nodes (in the data) to assign colors to individual sectors. The chart applies a default color palette if no node fill is set.
  • Tooltip: Sunburst supports item-type tooltips; hover a sector to see its details (name and value).
  • Animation: Entry animation is wired; nodes fade and grow on mount. Update animation is not yet ported.

See also