What is a Waffle Chart?
A Waffle Chart is a way to visualise proportional data, for example, percentage progress towards a goal’s completion, or the proportions of a binary measure. Its unique design has seen it increasingly being used in Dashboard Design. Today I’ll be showing you how to create one!
What you need to create beforehand
You need to create a structure to bring into Tableau that will house your data, and the simplest way to do this is to create a table in Excel. For this example, we’ll be creating a 10 by 10 Waffle Chart.
To start, you need to create 3 columns:
Row – This column will contain the numbers 1 to 10. The first 10 entries will be 1, then next 10 entries will be 2 and so on.
Column – This will contain the numbers 1 to 10, but unlike the Row column, the first 10 entries will be 1 to 10 and repeated until each Row entry has a corresponding Column entry.
Once we have what are essentially coordinates to map our percentages onto, create a final column which will start at 1% at Row=1, Column=1 and work its way up to 100% at Row=10, Column=10.
Working in Tableau
After creating the Excel file, bring it into Tableau as a Secondary Data Source.
In a new sheet, bring the Column and Row fields onto their respective shelves (unaggregated). Then, choose which shape you’d like your Waffle Chart coordinates to have.
Now it’s time to create a few calculated fields. Create a field that calculates the percentage of whatever metric you’re wanting to visualise. I’m using Boston 311 Call data to calculate the proportion of calls that are made during the day versus at night. My calculation is:
sum([Day Case]) / count([Case ID])
Next, to colour our Waffle Chart shapes, we need to create one more field using this calculation:
[Boston311].[Percentage of Day Cases] >= sum([Percentage])
This calculation essentially tells Tableau to colour a coordinate if that coordinate’s corresponding Percentage is below the percentage calculated in the previous step.
Drag the final Boolean field onto Colour and you’ll have your very own Waffle Chart!
Here’s a Dashboard I created using a static Waffle Chart which you can check out on my Tableau Public Gallery.