Skip to content
Calm motion: animations on this site only fade, with no movement

Sunburst ​

A tree of parts as rings around a center

Shows how a whole splits into parts, and how each part splits again. The inner ring is the top level, and each ring out is one level down. For the same data in rectangles that you can open, use the treemap.

Basic
Yearly budget
PartValueShare
Production84k44%
Production › Editing42k22%
Production › Gear18k9.4%
Production › Studio rent24k12.6%
Hosts and guests72k37.7%
Hosts and guests › Hosts60k31.4%
Hosts and guests › Guest travel12k6.3%
Growth29k15.2%
Growth › Ads20k10.5%
Growth › Social clips9k4.7%
Hosting6k3.1%
  • data takes the same nodes as the treemap. Each node has an id and a label. A leaf has a value, and a parent is the sum of its children.
  • Each top part gets the next chart color, or its own color. The children of a part use a lighter shade of the color of their parent.
  • The center shows the total. A hover on a part shows its path, value, and share.
  • size sets the width of the circle in pixels (default 280), and format sets the text of a value.
  • For screen readers, the chart is a table with a row for each part, such as "Production › Editing". label names the table. Change the words with labels or a label pack: part, value, share, and total.

Usage ​

ts
import { BlessSunburst } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
data*TreemapNode[]—the same nodes as the treemap: a leaf has a `value`, a parent is the sum of its children
sizenumber280the width of the circle in pixels
format((v: number) => string)—text for one value, for example `(v) => "$" + v`
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ part: string; value: string; share: string; total: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.