Resources
Back

Saved 100s of hours of manual processes when predicting game viewership when using Domo’s automated dataflow engine.

Watch the video
About
Back
Awards
Recognized as a Leader for
31 consecutive quarters
Two G2 badges side by side: left one labeled Fall 2025 Leader with layered orange and red stripes at the bottom, right one labeled Milestone Users Love Us with three red stars below.
Fall 2025 Leader in Embedded BI, Analytics Platforms, BI, ETL Tools, Data Preparation, and Data Governance
Pricing

Stacked Bar Charts in Data Visualization

Comparing parts of a whole with stacked bar charts

Data visualizations turn raw numbers into clear, compelling stories. While simple bar charts show basic comparisons, sometimes you need to reveal a more complex narrative, one that involves parts of a whole. This is where the stacked bar chart excels. It allows you to not only compare totals across different categories but also see the internal composition of each category at a glance.

This comprehensive guide will walk you through everything you need to know about stacked bar charts. We will cover their definition, when to use them, design best practices, and how to create them in common tools. By the end, you'll be able to build effective, insightful visualizations that elevate your data storytelling.

What is a stacked bar chart?

A stacked bar chart is a variation of the standard bar chart. While a standard bar chart represents one value per category with a single bar, a stacked bar chart divides each bar into multiple segments. Each segment represents a secondary category, and the full length of the bar shows the total value for the primary category.

Think of it this way: a standard bar chart might show total sales per quarter. A stacked bar chart could show the same total sales per quarter, but with each quarterly bar broken down to show the sales contributed by different product lines (e.g., software, hardware, services).

The core concept is its ability to perform two jobs at once:

  1. Compare totals: The total length of each bar allows for easy comparison of the overall value between primary categories.
  2. Show composition: The colored segments within each bar reveal the proportional contribution of each sub-category to that total.

This dual function makes it a powerful tool for part-to-whole analysis across multiple groups.

Stacked bar chart showing yearly totals with multiple colored segments representing different sub-categories.
Example of a stacked bar chart showing how multiple sub-categories contribute to total values across several years. This visualization highlights both overall trends and the composition within each bar.

When (and why) to use a stacked bar chart

Stacked bar charts are most effective when your message involves comparing both the total size of a category and the composition of that category. They answer questions like, "How did our regional sales totals compare last year, and which product categories drove performance in each region?"

Scenarios for using a stacked bar chart

Here are some practical business scenarios where a stacked bar chart is an excellent choice:

  • Marketing campaign performance: Visualizing website traffic sources (e.g., organic, paid, social, direct) for different months. You can compare total monthly traffic and see how the mix of sources changes over time.
  • Sales team results: Showing the total revenue generated by each sales representative, with each bar segmented by product type (e.g., new licenses, renewals, consulting). This helps identify top performers and which products they excel at selling.
  • Budget allocation: Comparing departmental budgets across an organization, with each department's bar broken down into expense types like salaries, marketing, and R&D.
  • Survey responses: Displaying results from a rating question (e.g., "Very Satisfied," "Satisfied," "Neutral," "Dissatisfied") across different customer segments or product lines.

The main advantage is efficiency. A stacked bar chart combines the information that might otherwise require both a bar chart for totals and a pie chart for composition, presenting it all in a single, compact graphic.

When not to use a stacked bar chart

Despite their utility, stacked bar charts are not always the right tool. Here are situations where you should consider an alternative:

  • Too many segments: When a bar has too many small segments (generally more than four or five), the chart becomes cluttered and difficult to read. It’s hard to compare the size of the smaller, inner segments.
  • Comparing segments that don’t share a baseline: Only the bottom segment of each bar shares a common baseline (the x-axis), making it easy to compare its value across all bars. The other segments float, making precise comparisons between them nearly impossible. If comparing the performance of an inner segment (e.g., "Product B") across all categories is your primary goal, a grouped bar chart is a better option.
  • Needing precise totals: While the overall total is clear, reading the exact value of each individual segment requires mental math (subtracting the value of the segment below it). If precision for each part is critical, another chart type may be more suitable.
  • Dealing with negative values: Stacked bar charts do not handle negative values well. Stacking positive and negative numbers on the same bar is confusing and visually distorts the total. A diverging or grouped bar chart is a much better choice for data that includes both positive and negative values.

How stacked bar charts work: The mechanics

Understanding the structure of a stacked bar chart is key to building and interpreting it correctly.

Structure: Primary vs secondary categories

Every stacked bar chart is built on two types of categorical data:

  • Primary category: This defines the individual bars. It is the main group you want to compare. In a vertical chart, this is plotted along the x-axis (e.g., Quarters, Regions, Sales Reps).
  • Secondary category: This defines the segments within each bar. It represents the parts that make up the whole (e.g., Product Lines, Traffic Sources, Expense Types).

The importance of stacking order

The order in which you stack the segments matters. The segment placed at the bottom, against the baseline, is the easiest to compare across bars. Therefore, you should place your most important secondary category at the baseline.

For example, if you are analyzing departmental spending and the "Salaries" category is the most significant or the one you want to compare most directly, place it at the bottom of each bar. You can also create a logical flow by ordering segments from most to least variable, or from largest to smallest, but maintain that order consistently across all bars.

Data layout for creation

To create a stacked bar chart, your data should be organized in a table format where:

  • Rows represent the primary categories (e.g., Q1, Q2, Q3, Q4).
  • Columns represent the secondary categories (e.g., Product A, Product B, Product C).
  • The cells contain the numerical values for each combination.

An optional "Total" column can be useful for verification but is not typically plotted in the chart itself.

Quarter Product A Sales Product B Sales Product C Sales
Q1 500 300 200
Q2 600 350 250
Q3 550 400 300
Q4 700 450 350

Handling zero or negative values

  • Zero values: A segment with a value of zero will simply not appear in that bar. This is handled automatically by most charting software and is generally not a problem.
  • Negative values: As mentioned, standard stacked bars are unsuitable for negative values. If you must visualize data with negative components, a diverging stacked bar chart is a viable alternative. This chart type centers the bars on a zero baseline, with positive values extending in one direction and negative values in the other.

Types and variants of stacked bar charts

The classic stacked bar chart has several useful variations, each suited to a different data storytelling goal.

100% stacked bar chart

A 100% stacked bar chart is a powerful variant where each bar has the same total length (representing 100%). The segments within each bar show the relative percentage of each secondary category. This type of chart shifts the focus from comparing absolute totals to comparing proportional composition.

Use a 100% stacked bar chart when: The relative contribution of the parts is more important than the absolute total. For example, you want to see if the market share of your products has changed over time, regardless of whether total sales went up or down.

Horizontal vs vertical stacked bar chart

The orientation of your chart can impact readability.

  • Vertical stacked bar chart (Column chart): This is the standard format. It works well for showing change over time, as we naturally associate time progression with a left-to-right horizontal axis.
  • Horizontal stacked bar chart: This orientation is often superior when you have long category labels for your primary axis. The horizontal layout provides more space, preventing text from being truncated or awkwardly angled. It is excellent for ranking categories, such as comparing the product mix across a long list of sales regions.

Diverging stacked bar chart

A diverging stacked bar chart is used to visualize responses on a Likert scale (e.g., Strongly Agree to Strongly Disagree). The chart is centered on a neutral category, with positive sentiment responses stacked to one side (e.g., right) and negative sentiment responses to the other (e.g., left). This makes it easy to see the overall tilt toward positive or negative sentiment for each primary category.

Design best practices and common pitfalls

A poorly designed chart can confuse your audience more than it informs them. Follow these best practices to create clear and effective stacked bar charts.

  • Limit the number of stacks: Simplicity is key. Aim for no more than four or five segments per bar. If you have more, consider grouping smaller, less important categories into an "Other" segment.
  • Use a consistent stacking order: Decide on a logical order for your segments and apply it consistently to every bar. This helps the reader's eye track a specific segment across the chart.
  • Place the most important segment at the baseline: The segment at the bottom of the stack has a common baseline, making it the easiest to compare across bars. Put your most critical data series here.
  • Choose colors strategically: Use a distinct color for each segment. Avoid using too many bright, competing colors. A sequential color palette (shades of one color) can work well if the segments represent an order of magnitude (e.g., age groups). Ensure colors are high-contrast and accessible for color-blind viewers.
  • Order the bars meaningfully: Don't leave your bars in alphabetical order unless there's a good reason. Arrange them based on the total value (ascending or descending) or by the value of a key segment to make a stronger point.
  • Avoid clutter: Keep your chart clean. Remove unnecessary gridlines, borders, and background noise. Label data directly on the segments if there is enough space, but if not, a clear legend is essential.
  • Clear labeling: Ensure your chart has a descriptive title, clear axis labels, and a legend that explains what each color represents. For 100% stacked charts, make sure it's clear the axis represents percentages.

Examples and use cases

Stacked bar charts are versatile, finding applications across industries and business functions. Below are high-level examples of how stacked bar charts and their variants can drive insights in various settings:

Marketing

Compare campaign channel mix across months, with primary categories as channels (email, social, paid ads, organic), stacked by lead sources. This provides insight into how source contributions shift over time. Use 100% stacked for share-of-voice, grouped for comparing each channel’s performance directly.

Sales

Visualize total revenue by region (primary categories) with stacks representing product lines or pipeline stages. You can quickly spot which regions derive most revenue from specific products or where deals are getting stuck. Opt for grouped bars when individual stages or products need precise, cross-region comparison.

Finance

Show expense composition by department or quarter. Each bar represents a department or quarter, and stacks show different expense types (salaries, facilities, marketing). See at a glance which costs dominate per group. Use 100% stacked when showing proportion of each cost; use grouped bars for detailed comparisons.

Product management

Display feature adoption by customer tier, with stacks for feature usage and bars for tiers or plans. This uncovers which features drive value for which customer segments. 100% stacked clarifies proportional adoption, grouped bars suit absolute usage counts.

Customer success and support

Compare support ticket volumes by category with stacks for urgency level or SLA status. Helps identify problematic areas and emerging challenges. 100% stacked charts make sense to compare distributions rather than raw counts.

HR/people

Show headcount trends by role across locations or time, with stacks as roles (engineer, marketing, operations) and bars as office locations or time periods. Analyze workforce composition shifts. 100% stacked for role distribution, grouped for headcount size.

Operations and supply chain

Show on-time shipments by carrier, stacking by shipping origin or delay reason. This reveals which carriers perform best and exposes root causes of delays. Consider 100% stacked for proportion of delays; grouped for raw shipment counts.

Healthcare

Monitor patient volume by department with stacks representing service lines or payer type (Medicare, private, self-pay). Bars can be locations or months, allowing quick assessment of department or payer mix by facility. 100% stacked is ideal for payer mix share.

Education, nonprofit, and public sectors

Visualize enrollment by program type, stacked by cohort demographics (age, income, background) to highlight participation patterns and gaps. Use 100% stacked for proportional mix, grouped when size is more relevant.

Manufacturing

Show production yields by shift or line, with stacks for defect type or root cause. Bars represent each shift or line, helping flag systemic issues or best-performing time periods. 100% stacked clarifies proportion of each issue; grouped bars suit absolute defects.

Retail and ecommerce

Analyze shopping basket composition by customer group, stacking by product category purchased. Track changes in buying habits and segment popularity. 100% stacked visualizes product mix shares; grouped bars compare purchase volumes.

Energy, utilities, and SaaS

Display usage data by plan or customer segment, with stacks for usage type (peak, off-peak, maintenance). With incident tracking, bars for periods or teams and stacks for issue severity/type allow rapid identification of risk areas. 100% stacked fits well where proportions matter most.

When to use chart types:

  • Standard stacked bar for showing part-to-whole breakdowns along with absolute values.
  • 100% stacked when the mix or distribution is more important than the total size.
  • Grouped bar for comparing detailed segment values side-by-side across categories.

These high-level examples demonstrate the versatile applications of stacked bar charts. Remember that, for each scenario, you’ll need to clarify what the stacks and bars represent, the insight or action enabled, and whether composition (100% stacked) or detailed comparison (grouped) is the top priority.

You can create stacked bar charts in most spreadsheet programs and business intelligence (BI) tools. Here are the general steps for Excel and Google Sheets.

Step-by-step in Excel and Google Sheets

  1. Prepare your data: Arrange your data in the table format described earlier, with primary categories in the first column and secondary categories as subsequent column headers.
  2. Select your data: Highlight the entire data range, including the headers.
  3. Insert the chart:
    • In Excel: Go to the Insert tab, click the Insert Column or Bar Chart icon, and select Stacked Column or Stacked Bar. For a 100% version, select the 100% Stacked option.
    • In Google Sheets: Go to Insert > Chart. In the Chart Editor pane that appears, select Stacked column chart or Stacked bar chart from the Chart type dropdown.
  4. Customize your chart:
    • Title and labels: Add a clear, descriptive chart title and label your axes.
    • Legend: Ensure the legend is visible and correctly identifies each segment. Reposition it if necessary to save space.
    • Colors: Change the default colors to align with your brand or to improve clarity. Click on a data series (all segments of the same color) to change its fill color.
    • Gridlines: Remove or lighten gridlines to reduce visual noise.

General guidance for BI tools like Domo:

In platforms such as Domo, you can create stacked bar charts using a drag-and-drop interface. Assign your primary category (e.g., region, time period) to the main axis, your numeric values to the value field, and your secondary category to the color or legend field to segment the bars. Tools like Domo allow you to easily switch between stacked, 100% stacked, and horizontal or vertical orientations, providing flexibility to best display your data.

Limitations and when to use an alternative chart

Knowing the limitations of a stacked bar chart helps you choose the right visualization for your data.

  • Insight Distortion: With many segments, the chart becomes a "rainbow chart" that is visually impressive but analytically weak.
  • Difficult Segment Comparison: As noted, comparing segments not on the baseline is difficult.

When a stacked bar chart isn't working, consider these alternatives:

  • Grouped bar chart: This chart places bars for sub-categories side-by-side instead of stacking them. It is the best choice when the primary goal is to compare the values of sub-categories against each other across the main categories.
  • Line chart: If your primary category is time, a line chart is excellent for showing trends. You can use multiple lines to represent your secondary categories, making it easy to see how each performs over time.
  • Small multiples (Trellis chart): This involves creating a series of small, simple bar charts, one for each primary category. This approach allows for very clear comparison of the composition of each category without the distortion of a stacked chart.
Table of contents
Try Domo for yourself.
Try free

Frequently asked questions

What is a stacked bar chart used for?

A stacked bar chart is used to show both overall totals and the breakdown of those totals into sub-categories. It’s ideal for visualizing how different components contribute to a whole across categories, such as sales by product type or budget by department.

How to make a stacked bar chart in Excel?

Arrange your data with main categories as rows and sub-categories as columns. Highlight the data, go to the “Insert” tab, select “Bar Chart” or “Column Chart,” and choose “Stacked Bar” or “Stacked Column.” Adjust chart elements like colors, labels, and legends for clarity.

What are the cons of stacked bar charts?

Stacked bar charts can be hard to read with many segments, making it difficult to compare inner sub-categories across bars. Only the bottom segment has a shared baseline, so exact comparisons for other segments are challenging. They also aren't suited for displaying negative values.

What is the best reason to use a stacked column chart?

The main advantage of a stacked column chart is the ability to show both total values and the contribution of each part, letting you compare categories and their compositions side by side.

No items found.
Explore all
Data Visualization
Data Visualization