We were talking about Square Charts (aka waffle charts) recently at work, and I had just created an Excel template for my Data Visualization class. While Russell Christopher had a great post here I like it when the value is a perfect square, for it to show a solid square at the bottom right. If you watch through my moving GIF, you will see what I mean.
As I stared to build out my Square Charts scaffolding, I decided to add extra marks to show the percentage either above or below the chart without much extra work. I have an Options field that allows me to turn either one or both off. To display the label without a mark that can be selected, I’m using a transparent image for the shape.
I then modified the formula from Russell’s technique to test if the data is a square. I ended up with an odd issue that if I didn’t round both sides of the equation, it didn’t work quite right. In this formula, I have made a number of square chart scaffolds in the blended data source. Each one is considered it’s own [Sequence], so it will make it easy to have small multiples with different colors. See the example below.
IF [Id] > 100
ELSEIF ROUND(SQRT([Enter Percentage]*100),2) = ROUND(SQRT([Enter Percentage]*100),0)
IF SQRT([Enter Percentage]*100) >= [X] AND SQRT([Enter Percentage]*100) >= (11-[Y])
ELSEIF ROUND([Enter Percentage]*100,0) >= [Id]
Here is the Excel file that I’m using for my scaffolding: custom-charts
Check out my Tableau workbook to see it in action.