One of the great use cases for using color in a chart is to color by another dimension and to show the belonging of data points. In my previous blog post I used products in a bar chart as an example and then I colored the bars based on product category. This makes it easy for me to see which product category each product belongs to, I could also see which ones are our bestselling categories and which are worse.
As you can see here, the two best selling products are in the men’s footwear category. But then it’s actually a steep drop down to the rest of the male clothes/footwear. For women, there are many more products near the top. Also of interest is the bath clothes category, which only has one product and it’s quite far down.
You can do this type of coloring using any dimension, but what you need to consider is that each bar can only belong to one value of the group you are coloring by. Let me show you an example:
In this case, we see that each product can be sold in many different cities, hence if I look at sales by product and color by city there is not one unique value. So the bars would turn gray. But if I show sales by company you can see that each company only exists in one city. Hence I can use cities to color by.
So when attempting to color by a dimension, make sure the dimension you want to add to the chart doesn’t have multiple belongings.
The final best practice is about persisting the colors across and within charts. With persistent colors, the color is based on the data item and therefore all charts that have that data value will have the same color. It’s great when using the same dimension across many charts on the dashboard as you will easily pick out the relationship between these data points. Below is an example with and without persistent colors. As you can see, the bar chart on the right better matches the colors of the tree map.
Specifically, the bar chart on the right has the same color for the same values as the tree map, pink for the central region for example. While in the bar chart on the left, the color for the central region is blue, which is not the same as the tree map. Having the same color for data values across charts makes it easier to relate these values to each other.
That is all for now about color. There are still many topics within this area to cover, but hopefully you’ve learned a few new things!