The preview above is the live component gallery. Open it full size to switch between desktop and phone widths.
Blocks also take the usual
id, title, description and span. Pick a bar chart instead when the
categories are many, similar in size, or not parts of one whole.
What the numbers are
- Slices are the largest positive categories, largest first, ties by name. A null value in
byis a real category, shown as “(empty)”. - Other sums every positive category past
limitand says how many it holds (“Other (19 more)”). - A share is the slice divided by the whole, the sum of the positive categories, so slices and Other always add up to 100%.
- The total is recomputed from rows (SQL
ROLLUP’s grand total), never summed from the slices. For a sum or a count with no negative values it equals the whole. - Negative, zero and empty categories are left out of the circle, because they are not parts of a whole. Negative ones raise HM4061 when the dashboard builds, and the chart lists what it left out under the key (“Leaves out 1 negative value (Wholesale −$12.3K)”). The total still includes them.
- Filters recompute slices, Other and the total with the rest of the dashboard.
What it draws
- Slices start at 12 o’clock and run clockwise, largest first, in the theme’s series colours. Other is always last, in the muted context colour.
- The key beside the pie names each slice with its value and share. Long names wrap, up to four lines, instead of being shortened. On cards narrower than 440 px the key goes under the pie.
- A donut prints the total and the metric’s name in the hole.
- Hover, tap or the arrow keys highlight one slice, dim the rest, and show its value and share in a tooltip. Screen readers get the same numbers in a hidden table and hear each step through a live region.
- With nothing to divide the chart draws an empty ring that says why: “No <metric> in this period” when there is no data, “No complete day yet” when the window has no complete day (the total is then empty too), or the real total over “No positive values to divide” when every category is negative or empty, with the left-out categories listed under the key.