Tableau is the most popular interactive data visualization tool, nowadays. It provides a wide variety of charts to explore your data easily and effectively. This series of guides - Tableau Playbook - will introduce all kinds of common charts in Tableau. And this guide will focus on the Waffle Chart.
In this guide (Part 1), we will learn about the waffle chart in the following steps:
Here is an all-in-one waffle chart example from 5 Unusual Alternatives to Pie Charts. This example converts a pie chart to a waffle chart. We can see the comparison in a waffle chart is more clear and quantitative than in a pie chart.
A waffle chart, also known as Gridplot, is a kind of like the square version of a pie chart. We can consider it as an improved derivative of a pie chart. Like a pie chart, it used to visualize the part-to-whole relationship.
Waffle Chart in Tableau makes a good summarization:
Waffle charts can be represented with conditional formatting where cells are highlighted with different colors based on the percentage value of that KPI.
Waffle chart has similar application scenarios with Pie Chart. So let's make a comparison to explore the advantages of a waffle chart.
Here is an opinion from David Schieber:
Waffle charts are a much better way of showing the same sort of data that a pie chart would.
With a waffle chart, you get a more segmented view of the data – so at first glance, you can see the same information, but you can study it a bit longer and really look at how it compares.
In my opinion, compared with a pie chart, a waffle chart has the following advantages:
In this guide, we use the dataset "Worldwide Smartphone Sales" from Mobile operating system from Wikipedia. Thanks to Wikipedia and Gartner for this dataset.
This dataset contains quarterly sales of smartphones by mainstream mobile operating systems from 2007 and 2017.
I have done some data wrangling jobs. You can download my version from Github.
In this guide, we will analyze the market share of Android, iOS, Windows, BlackBerry, Symbian, and other operating systems.
We will build an all-in-one waffle chart. This process is inspired by Andy Kriebel's blog.
First of all, before we build a wafle chart, we need to do some preparation work for our data. We should pivot mobile OS columns into field names and values. Even if we can use the Measure Names / Measure Values technique instead, it doesn't support sorting. This thread from Tableau suggests we should reshape data. That is what we are going to do.
In order to create a waffle chart easily, we can have the aid of a data template. As we know, a waffle chart is made up of grids. We will create a template to describe every cell on it. We can index every cell by Row and Column and use Percentage to mark the value it represents. For a 10x10 waffle template, you can download my version from Github.
Build the skeleton of waffle chart:
Make it look more like a waffle.
Color with the sales percentage of "Mobile OS".
First, calculate the sales ratio for each category. Switch to the previous data source "market_share_of_mobile_os" and create calculated fields. Taking "Android Ratio" as an example, we input formula as:
1SUM(IF [Mobile OS] = "Android" THEN [Sales] END) 2/ SUM([Sales])
Create "iOS Ratio", "Windows Ratio", "BlackBerry Ratio", "Symbian Ratio" and "Other Ratio" in the same way.
Now, switch to "waffle_template" and create a calculated field "Mobile OS Color" for color. The formula is like:
1IF AVG([Percentage]) <= [Sheet1 (market_share_of_mobile_os)].[Android Ratio] THEN "Android" 2ELSEIF AVG([Percentage]) <= [Sheet1 (market_share_of_mobile_os)].[Android Ratio] + [Sheet1 (market_share_of_mobile_os)].[iOS Ratio] THEN "iOS" 3ELSEIF ... 4... 5ELSE "Other" END
Drag "Mobile OS Color" into Marks - Color. If you get a warning about "Edit Relationships" that is because we haven't told Tableau how to blend the data sources. But here we don't need to, so you can check "Do not show again".
Add time filter to observe data at different time points.
In the last step, let's polish this chart:
Here is the final chart:
This all-in-one waffle chart gives us a clear idea of each Mobile OS contribution to a whole. Even without labels, we can know the approximate proportions by counting the cells (one cell represents 1%).
Since the waffle chart can only observe one point in time, we use Filter to analyze over time. For example, before 2009, Android had almost zero market share. But Android's market share rose rapidly to more than 85% in 2017.
In this guide, we have learned about one of the derived charts in Tableau - Waffle Chart.
First, we started with an example of a waffle chart. Next, we introduced the concept and characteristics of it. And then we compare it with a pie chart. In the end, we learned the process to create an all-in-one waffle chart.
In the second part, we will learn how to build an individual waffle chart through examples.
You can download this example workbook Waffle Chart from Tableau Public.
In conclusion, I have drawn a mind map to help you organize and review the knowledge in this guide.
I hope you enjoyed it. If you have any questions, you're welcome to contact me [email protected]