Sunburst chart
Nested data, one ring per level: if both rings count out of the same total, each part lines up with its category on its own.
How it's built
- Two rings, two levels:
orbit-6for categories andorbit-10for their parts.--o-size-ratio: 3.6on the.gravity-spotmakes each band 3.6 lanes thick; the rings are four lanes apart, which leaves a thin line between levels. - Every
<o-arc>gets its share of the whole week asvalue. Arcs with values stack in DOM order, so when the parts are listed in the same order as their categories, each one lands inside its parent with no angles to compute. - The names are the arcs' own text.
flipturns the text of arcs on the lower half so it reads the right way up, and--o-colorsets its color. - Each part is a shade of its category made with
color-mix(), so a branch reads as one without a legend. interactiveandtabindexmake every slice hoverable and focusable; the center tells you what you are on.
Related
- Donut chart: one level
- Pie chart
- Arcs