A stacked bar chart displays categorical quantities as segments within bars, allowing component values to form a total. It can turn raw counts or percentages into an immediately readable comparison. section 1.4.1
Use one when the audience needs to understand how parts contribute to a whole. A clear chart should expose the intended insight rather than merely display every available category. section 1.4.1
Build the chart progressively:
- Check scale and ordering before presenting the result. Large differences between variables can make a stacked chart narrow, unclear, and difficult to interpret. section 4.5.1
Pets at an event
A participation table contains 1,138 cats, 130 dogs, and 17 other pets. Focusing on the relevant categories gives approximately 90% cats and 10% dogs, or one dog for every nine cats. A stacked percentage bar communicates that relationship at a glance. section 1.4.1
Training-time comparison
For competition data, reshape Record Time and Our Best Time into stacked series with Altair. If their scales obscure the comparison, calculate percentage difference instead, sort categories descending, and constrain the y-scale to 0–100.




