When to Use Stacked Bar Charts

โฑ๏ธ 35 sec read ๐Ÿ“Š Visualization

Use a stacked bar chart only when the total matters and each bar is a whole made of parts โ€” like revenue by region split by product line. If readers need to compare the individual segments across bars, use grouped bars or small multiples instead.

When Should You Use a Stacked Bar Chart?

Stacked bars work when the primary message is the total and the secondary message is rough composition. The totals are easy to compare because every bar starts at zero, and the bottom segment is easy too, for the same reason.

import pandas as pd

df = pd.DataFrame({
    "SaaS":     [40, 55, 70],
    "Services": [30, 28, 25],
    "Hardware": [20, 18, 12],
}, index=["2024", "2025", "2026"])

df.plot(kind="bar", stacked=True)  # totals + composition

Why Are Middle Segments Hard to Compare?

Every segment above the bottom one floats on a different baseline, and humans judge lengths poorly without a shared baseline. Readers can see that a middle segment exists, but they can't reliably tell whether it grew 10% or shrank 5% between bars.

That's why the segment you care about most should sit at the bottom of the stack, directly on the axis.

What Is a 100% Stacked Bar Chart For?

A 100% stacked bar normalizes every bar to the same height so you compare proportions, not totals โ€” useful for share-of-mix questions like "what fraction of each cohort converted?" The trade-off: you lose the totals entirely, so state them in labels or a companion chart.

pct = df.div(df.sum(axis=1), axis=0) * 100
pct.plot(kind="bar", stacked=True)
# Each bar now sums to 100 โ€” shows mix shift, hides growth

What Are the Alternatives to Stacked Bars?

If segment-vs-segment comparison is the point, use grouped (side-by-side) bars for a few categories, a line chart per segment for trends over time, or small multiples โ€” one clean bar chart per segment. Each gives every value a zero baseline.

Common Pitfalls

Pro Tip: Before reaching for a stack, ask "is the total the headline?" If not, plain bar charts โ€” grouped or faceted โ€” will beat the stack every time.

โ† Back to Visualization Tips