Recreating the Dot Plot/Gantt/Box&Whisker/Bar Thing from the Washington Post

I recently came across a really cool plot in the Washington Post from Sahil Chinoy (@sahilchanoy) denoting the various commute times from major metropolitan areas in the US. Couldn’t figure out exactly what the plot should be called, but I knew it was insightful, easily understood, and applicable to a variety of use cases in the world of data. For reference, here’s the link:¬†https://www.washingtonpost.com/graphics/2017/national/escape-time/

I don’t get to do much dashboard dev’ing any more, but I thought it’d a fun challenge to try to recreate the visualization in Tableau. Here’s the breakdown of that effort.

Using the Sample – Superstore dataset provided in Desktop, I thought I’d illustrate how this kind of viz could be helpful in analyzing multi-dimensional datasets. The first use case that came to mind was looking at Sales per U.S. State per Segment. So we were looking at a max of 3 Segments across all of the states in the data, and I wanted to see how aggregated sales spanned the customers segments in each state. Questions we had the potential to answer with this approach would be things like:

  • Which states had a larger than normal sales spread between Segments?
  • Was there a pattern across the states in the ranking of customer segments?
  • Do large deltas between segments (in each state) simply correlate with gross aggregated sales per state?
  • etc

Let’s start with the finished product:

To get there, you need to create 4 calculated fields.

First, an LOD calc to get SUM(Sales) at the State and Segment granularity:

Next, you need the MIN() and MAX() of that LOD calc:

Finally, you need the difference between the MIN() and MAX() for each state:

Now you need to start dragging fields onto your sheet.

  • Put State on Rows
  • Put SUM(Sales) on Columns, and choose Circle as your mark
  • Put (previously created calc) Max Sales per State and Segment on Columns, and choose Gantt Bar as your mark
  • Create a Dual Axis for those two measures, and synchronize those axes
  • On the SUM(Sales) Marks card, drag Segment onto Color, and select your chosen color for the space between each state’s min and max amounts. This is the range per state.
  • On the Max Sales per State and Segment Marks card, drag the Diff between totals calculated measure to Size.
    • Right click on that calculated measure, and choose ‘Edit in Shelf’. Just put a minus (-) in front of the measure to move the bar representing Diff between totals¬†from a position where it starts from the Max amount per state and goes to the right to the correct position, which is where it spans the delta between the Min and Max segment amounts per state.
  • From there, just adjust your sizing and colors to your liking

 

Here’s the workbook if you’re interested in dissecting and recreating:

Leave a Reply

Your email address will not be published. Required fields are marked *