Charts & Visualizations

Stacked Bar Chart

A bar chart variation where bars are divided into segments that represent different components of a total.

Definition

A stacked bar chart is a data visualization that extends the basic bar chart by dividing each bar into segments, where each segment represents a subcategory of the total value. The segments are stacked on top of each other (vertical) or end-to-end (horizontal), allowing comparison of both total values and the composition of each bar.

Examples

Revenue composition by year

Chart Visualization

This example includes an interactive chart visualization with 2 data points.

Chart type: bar

Usage

Best Used For

  • Showing part-to-whole relationships within categories
  • Comparing totals across categories while seeing composition
  • Tracking changes in composition over time
  • Visualizing hierarchical or nested data

Data Requirements

[Object]

Limitations

Important Considerations

  • Difficult to compare segments that aren't aligned to the baseline
  • Can become cluttered with too many segments
  • May be hard to see small differences between segments
  • Less effective when segments have very different scales

Best Used For

  • Showing part-to-whole relationships within categories
  • Comparing totals across categories while seeing composition
  • Tracking changes in composition over time
  • Visualizing hierarchical or nested data

Frequently asked questions

Common questions about Stacked Bar Chart, answered.

What is a stacked bar chart?
A stacked bar chart divides each bar into colored segments, where the full bar length is the total and each segment is one sub-category's contribution to it. It shows two things per category: the overall total and how that total breaks down — for instance total revenue per quarter with segments for each product line.
When should I use a stacked bar chart?
Use it for part-to-whole comparisons across a handful of categories where the total matters and you have only 2–4 segments. It's strongest when the bottom segment (which shares the zero baseline) is the one readers most need to compare. If precise comparison of every segment matters, prefer a grouped bar chart, since stacked segments above the first don't start at zero.
Stacked bar vs 100% stacked bar — what's the difference?
A standard stacked bar shows absolute totals, so bars have different heights and you can compare both totals and composition. A 100% stacked bar normalizes every bar to full height, so it shows only the proportional mix and hides the absolute size. Use absolute stacking when total magnitude matters; use 100% stacking when you only care about share of the whole and want composition comparable across categories of different sizes.
Why are upper segments in my stacked bar hard to compare?
Only the bottom segment starts at the zero baseline; every segment above it begins where the previous one ended, so its position shifts from bar to bar and the eye can't compare lengths reliably. Put the segment readers care about most at the bottom, limit to 2–4 segments, and if all segments need precise comparison switch to grouped bars or small multiples.
How many segments should a stacked bar have?
Two to four is the readable range. More segments mean thin slivers, similar colors, and worse baseline-shift distortion. Group the long tail into an 'Other' segment, or switch to a different view (grouped bars, a treemap for a single total, or a heat map) when you genuinely need many categories.

Related Terms

Grouped Bar Chart

Related term

charts, alternative

Stacked Area Chart

Related term

charts, similar

Featured in topic hubs

Explore this term in context — alongside the related metrics, calculators, and guides curated in these hubs.