How To: Using Ranks to Create Bump Charts in Tableau
I saw a really cool analysis done by Datagraver on the popularity of car colors over time. I built this viz as a way to reimagine what they had done.
Check out the interactive version
This viz exploded in popularity after posting it on reddit/r/dataisbeautiful to the tune of 300k+ views. I certainly didn't expect this for such a simple viz, but I am glad that it resonated with so many.
One thing I noticed in the comments on Reddit is that people were curious about how to do this in Tableau. It is pretty simple to build bump charts in Tableau, so let's look at what it takes to build them.
Step 1: Create a calculated field for the measure we want to rank. In this case, I am using rank_unique so that the same rank isn't assigned.
Step 2: Bring the dimension you are ranking by to the color shelf and pull the Year or time period to the columns shelf.
Step 3: Bring the newly created Rank measure to the rows shelf. Change the Compute Using to whatever your dimension is on the color shelf. This will give you a basic bump chart.
Step 4: To get the ranks on the bump chart itself, I use dual axis. Drag another copy of your rank to the rows, select the same compute using, and then select dual axis. Make sure to synchronize your axes.
Step 5: Change the marks on the secondary axis to circles.
Step 6: To display the ranks on the circles, we need a calculated field to convert them to a string. We create this and then add it to the labels. Make sure to compute by the dimension specified for the rank.
Step 7: Reverse the axis.
That's it! You now have a bump chart built using ranks that displays the ranks on the chart itself.
Feel free to download the workbook and comment with any questions.