5. Re-encoding a Stacked Bar Chart


An overly complex bar chart can be replaced by something better by carefully considering the visual hierarchy. Learn how to do this in this lesson.

To explore more Kubicle data literacy subjects, please refer to our full library.


  1. Lesson Goal (00:12)

    The goal of this lesson is to replace the stacked bar chart with a better visualization.

  2. Creating a New Visualization (00:21)

    The bar chart uses color to distinguish between product categories. We remove color by creating separate visuals for each product category. This makes it easier to see trends for each category, but it’s still difficult to compare product categories. We can deal with this by replacing bars with circles. The consistent shape of circles is easier to read than a series of bars. This visualization makes it easier to compare values across a category by looking across a row, or compare values within a quarter by looking down a column.

  3. Developing a Gradient Table (02:00)

    If circles or other shapes cannot be used, one option is to replace the shapes with a gradient. Doing this converts our visualization to a series of shaded boxes. This makes the highest values particularly prominent. As before, you can control the gradient so as to highlight higher or lower values.

    It can be tempting to add numbers to the grid, but this can overwhelm viewers. It may work to add a few numbers to highlight important details, such as the minimum and maximum values for each row or column. This may serve to highlight some useful insights.


In the previous lesson, we introduce our Stacked Bar Chart case study and learned why we would want to change this visualization.

Our goal in this lesson is to replace the stacked bar chart with a better visualization.

To improve this stacked bar chart, we want to remove the hardest trait to understand, which is color.

Without color, here's one way to keep the category separate. It's easier to see the trends for each category, at least for where the values are higher.

You probably see that we lost the total for each quarter, which was on the stacked bars. Later in this case study, we'll look at one way to get those totals back. One thing that's still hard and it was a problem with the stacked bars is to look across all the values, to see patterns or relationships. It's difficult to process the entire page because your eye has to follow the up and down of the bars.

Let's look into one way of eliminating some of that eye emotion, by using a different shape than bars.

Here's a way to use size that lets your brain soak in the entire page. Because circles are a consistent shape, your eyes don't have to do as much work as when processing the bars.

You're probably used to circles on an XY plot. So this might seem a bit strange at first, but it works and has some advantages. Now you can also compare values across category by looking across a row.

You can also compare values within each quarter by looking down a column.

Now let's say you're using circles for another visual on the page, and decide you can't use circles here.

You need an option.

The first move is to go down one tree on the hierarchy from size to gradients.

The top values really stand out here while the lower values just fade into the background, even more than the small circles. The power of working within the hierarchy is you control how to show the data versus just clicking an option in your software. Depending on how you wanna focus attention, you can control the gradient.

Here it goes from light to dark, but you might choose a color at the low end to make those values stand out too. And remember to be careful if you're working with negative numbers. Now with all these empty squares, one thing people like to do is fill in this table with numbers.

But that adds more to look at and takes away from the gradient. Think about why you want the numbers? And how they can be helpful? Instead, think about options like showing minimum and maximum for each category across the quarters.

This turns out to be pretty interesting because for almost half of the categories, the lowest sales were in Q1 2016 and the highest were in Q4 2019.

If you showed all the numbers, this insight would be hard to detect. If your teams want to see numbers, your eye is drawn to the gradients and the numbers act as support.

One final thing, is to show numbers without prefixes and suffixes like $ and K. Put that information in the legend.

We've now come a long way from the stacked bar chart we started with. So let's stop the lesson here.

In the next lesson, we'll finish this case study by considering how to incorporate different traits from the visual hierarchy in visualizations like this.