Get Rid of the Grid: Variable Grid Charts in Tableau

AvatarPosted by

For this week’s #makeovermonday challenge I created this visualization combining a hex map and multiple line charts (click to play with the interactive version on Tableau Public):

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 19-44-07.jpg

The “normal” way to create such a small multiple chart is to blend the data with a secondary data source for the geographical coding  (I used Matt Chambers hex map file) and to put columns on columns and rows on rows. Quite easy.

Tableau - Book3 2019-01-14 20-06-04.jpg

Unfortunately you are not able to make this look like a hex map because Tableau doesn’t allow your shapes to leave the borders of the cells within the grid. So this might be the closest hex mapish thing you can achieve using this technique:

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-15 10-01-07

Looks not even close like a proper hex map. So how can this be achieved?

The answer is: Get rid of the grid!

And this takes just a few steps:

1. Data Prep

The first step I did was to join the #makeovermonday-data with my hex map data.

2. Normalizing the Years

I needed some calculations on my x-axis, therefore I first normalized the years from the data. This brought me a 1 for the first year in the data and a 16 for the last year.

Dialog 2019-01-14 20-23-23.jpg

3. Calculating the X-Axis

Next step was to calculate the x-axis:

Dialog 2019-01-14 20-27-19.jpg

This calculation is “sorting” my line charts horizontally. It is a similar technique like the one Ludovic and I used in our Boris Becker viz and described in this blogpost.

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 20-31-17.jpg
Starting Point
Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 20-52-52.jpg
Horizontally sorted line charts based on “column”

I added a parameter [Gap Column] to be able to play with the exact positioning of my charts at a later stage.

4. Calculating the Y-Axis

The same thing had to be done for the y-axis:

Dialog 2019-01-14 20-35-40.jpg

Again this calculation is “sorting” the line charts, in this case vertically:

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 20-54-04.jpg
Vertically sorted line charts based on “row”

Looks nice!

5. Adding a Hex Shape

For the hexagon shape I calculated one single point in the middle of each line chart…

Dialog 2019-01-14 20-42-27.jpg

…and brought this in on a secondary axis, created a dual axis, chose shape from the marks card, and changed the shape to a hexagon.

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 20-48-24.jpg

6. Positioning of the Line Charts

Last step was the positioning and the scaling of the line charts using my parameters:

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 20-50-32.jpg

That’s it! (+labelling, formatting, tooltips, reference lines etc.)

Tableau - How Many People Earned the Federal Minimum Wage in Your State? [from PUBLIC.TABLEAU.COM (DEFAULT)] 2019-01-14 19-44-07

Hope you enjoyed reading and that you’ll find own use cases for this!

2 comments

Leave a Reply