Count versus percent stacked bars
Compare stacked bars in VectorPaint: counts and within-group percentages
Draw count and percentage stacked bars for two fictional groups, checking their different denominators.
On this page
Draw count and percentage stacked bars for two fictional groups, checking their different denominators.
Define fictional samples
Imagine group A has 40 people choosing walking 20, transit 12 and cycling 8; group B has 60 choosing walking 15, transit 30 and cycling 15. Each person chooses one mode. These values are an exercise, not a transport survey. Check 20+12+8=40 and 15+30+15=60. The different totals are central to distinguishing absolute counts from within-group shares.
Calculate within-group shares
Using 40 as denominator, A is 50%, 30%, 20%; using 60, B is 25%, 50%, 25%. Each group totals 100%, but the group sizes are not equal. The UK Office for National Statistics explains that 100% stacked bars have equal total length and compare composition. This exercise also keeps a count chart to show the size difference.
Create two chart areas
Create a landscape canvas in VectorPaint and save an editable original. Use visible rectangle, line and text controls to construct two chart areas. Title the left Counts and the right Within-group percentages; reserve room for legend, group labels and notes. Do not assume automatic aggregation or normalization: all widths come from the calculations below.
Set the count scale
Draw a common zero baseline in the count panel and scale to at least 60 people. At five canvas units per person, A is 200 units wide and B 300. Their segment widths are A 100, 60, 40 and B 75, 150, 75. Canvas units are an exercise scale, not necessarily pixels. If exact entry is unavailable, approximate with visible rulers and say so.
Draw count stacks
From left to right join A’s walking, transit and cycling segments, then use the same order for B. Segment edges should meet without a gap that might imply another value; both bars begin at zero. Label counts and place totals 40 and 60 at their ends. Do not compress B to A’s length merely because the totals differ.
Set the percentage scale
Map 0%–100% to the same total length in the percentage panel, for example 300 canvas units. A’s 50%, 30%, 20% segments are 150, 90, 60 units wide; B’s 25%, 50%, 25% are 75, 150, 75. Both total 300, but their denominators differ: A’s 100% is 40 people and B’s 100% is 60.
Draw percentage stacks
Use the same walking, transit and cycling order and draw two equal-total-width segmented bars from a common zero. Label percentages and keep sample counts beside group names so readers can see normalization and denominators. If text does not fit a narrow segment, move it outside with a short leader; do not change proportions to fit a label.
Compare one category
For walking, A has 20 people and B 15, so A has five more; their within-group shares are 50% and 25%, a difference of 25 percentage points. Do not call that a 25% difference in people or infer equal group sizes from normalized bar lengths. Transit in B has 30 people and a 50% share; read both count and share.
Check segments and totals
Count segments must add to 40 and 60; percentage segments must add to 100% for each group. Check A walking is 20 in the count panel and 50% in the percentage panel; B cycling is 15 and 25%. If a label is correct but its width is not, check the scale for that panel. Do not measure the percentage chart with the count scale or vice versa.
Explain middle-segment limits
Both panels share category order and legend, but the middle transit segment starts after the preceding segment rather than at a common zero. Compare its label or subtract endpoints; a right endpoint alone is not its length. A separate common-baseline chart may help precise middle-category comparison. The stacked view here is retained to show group composition.
Keep a text table and scope
Below the chart list A: 20/12/8, total 40, shares 50/30/20%; B: 15/30/15, total 60, shares 25/50/25%. State categories are exclusive, each person counted once and the data fictional. The chart cannot establish travel reasons, representativeness or policy effects. Missing responses or multiple choices require a newly stated denominator and categorization.
Check segment boundaries
Count-bar endpoints are 20, 32, 40 for A and 15, 45, 60 for B. Percentage endpoints are 50%, 80%, 100% for A and 25%, 75%, 100% for B. An endpoint accumulates preceding segments; it is not the current segment alone. For example, B’s transit segment runs from 15 to 45 and has length 30, not 45. Read boundaries and subtract to catch misplaced rectangles.
Check legend and accessibility
Use the same legend order and style for each travel mode in both chart areas, and retain text labels. At reduced size or in grayscale, check that group names, counts, percent signs and narrow-segment labels remain legible. Check group totals against the table; for example, do not attach B’s 60 to A. Identify whether each chart shows counts or percentages and read its axis before comparing: canvas widths on different scales cannot be compared directly as counts.
Recalculate the denominator for a pooled population
To show the combined A and B composition, first establish that each person belongs to one group only and categories have the same definitions. Walking is 20+15=35 people, bus is 12+30=42 and cycling is 8+15=23, from 40+60=100 people. The pooled shares are therefore 35%, 42% and 23%. Simply averaging group percentages gives 37.5% for walking and ignores unequal group sizes. If drawing a third pooled percentage bar, label it as pooled by headcount rather than either group’s observation; stop before pooling if category definitions differ.
Save and troubleshoot
Save the editable original and use a visible share or export control to save a separate PNG or PDF. Reopen it and inspect panel titles, groups, segments, legend, counts and percent signs for clipping. If count bars have equal total lengths, check for accidental use of percentage scale; if normalized totals differ, recalculate each denominator. No automatic computation or physical-device test is claimed.
Related guides and sources
Mirrored age bars and common denominator; Two-way table denominators.
Checked 26 November 2026: ONS stacked bar chart guidance; Apple public lookup.