February 14, 2013
Pie charts duel to their death: Create slope graphs as an alternative in Tableau in five steps
UPDATE: Thanks to a reader for noticing that I had the years in my data set backwards. I have corrected the data and updated this blog post.
Consider this recent chart by Business Insider that attempts to compare data across time and contributions to the whole with multiple pie charts.
It’s not worth words to review how horrible this chart is given the message it’s trying to convey. Instead, consider slope graphs. Download the data for this example here.
I’m assuming that you know how to connect to the data in Tableau.
Step 1 – Drag Measure Names to the Columns shelf
Step 2 – Drag Measure Values to the Rows shelf
Step 3 – Drag the Number of Records measure off of the Measure Values card.
Step 4 – Change the mark type to Line
Step 5 – Drag the Shopping Category dimension to the Level of Detail shelf
You’ve just created a slope graph in Tableau in about 20 seconds. Does this make the data easier to compare? Sort of. You see some lines that go up and some that go down, but the chart need more detail to make it easier to understand.
Step 6 – Format the measures and axis to be percentages. Also remove the “Value” title from the axis while you’re at it.
Step 7 – Drag Shopping Category to the Label shelf and set the labels to show only on the start of the line.
Step 8 – Create a calculated field to identify the categories that increased or decreased.
Step 9 – Drag your calculated field to the Color shelf and adjust the colors to your preferred color scheme.
Step 10 – Add markers to the end of the lines
Does a slope graph communicate the message better than the pie charts? Absolutely!
You can easily see the winners and losers:
- Retailers have increased significantly, nearly double the time spent as the previous year.
- Online shopping and Daily Deals appear to have lost most of their mobile time spent shopping to Retailers.
Are these relationships seen as easily in the pie charts? No chance!
Download the Tableau workbook here.