Donut Chart

Categorical share donut with PlotCard top bar, range tabs, toggleable legend, and sr-only data table.

Default

Pass a title and slices. Each slice needs an id, label, value and color; the legend shows values by default.

Call outcomes
Call outcomes
CategoryValue
Answered1,122
Unanswered214
Cancelled76
Failed38

With ranges

ranges adds tabs to the top bar. The card only reports the change; fetch the totals for the new range yourself.

Call channels
Call channels
CategoryValue
Inbound420
Outbound280
Callback95

Best practices

When to use

  • Use for part-to-whole breakdowns with two to six categories: call outcomes, channel mix.
  • Use Breakdown Chart for more categories, ranked rows or several metric columns, and Plot for change over time.

Behavior

  • Pass title and slices ({ id, label, value, color }). The legend shows values by default; set showLegendValues={false} for labels only.
  • ranges adds top-bar tabs, but the card only reports rangeId. Fetch the new totals yourself.
  • Legend buttons hide slices and the ring renormalizes. The last visible slice cannot be hidden.
  • When every value is 0, emptyState replaces the ring and the legend stays.

Content

  • Order slices by importance, not size. Give neutral outcomes (Unanswered) a neutral color and failures a danger color.

Accessibility

  • An sr-only table of categories and values ships with the chart, and legend buttons expose aria-pressed.
  • Set accessibleLabel when the title is not a sufficient description.