Building a ‘Line Dot Plot’ in Tableau.

Yesterday I published this tweet…

2017-01-17_21-14-32.png

I wanted to gain thoughts on using a ‘line dot plot’ as a comparative charting method (yes it has been done before, I am not claiming to be the inventor).

In the example given by me I used it to compare the current month sales against values from previous months.

The line is given  as a scale between the maximum and minimum values. For example, if the min month sales was 10, and the max month sales was 110, and the current month sales was 60. The dot would be half way across the line.

A second addition was the colour encoding, which is based on percentiles, if the current month value is within the lowest 25 % of all monthly values, it is coloured red, if it is above the lowest 25% of values, but not within the top 25% of monthly values, it is encoded in amber. If it is within the top 25% of values it is given the colour green.

These two methods combined allow the user to gain two different angles of understanding from one simple plot.

I will use this blog to outline how I built the chart type in Tableau.

The workbook for this visualisation can be found here.


First of all we need to write a calculation that determaines the value we want to represent as the dot.

In my case I wanted to use the current month sales, this calculation can be given as:

current-month-sales

Now we need to acknowledge the values that this month should be compared against, so we need to calculate our minimum and maximum values, which can be calculated as…

min-sales

2017-01-17_21-38-54

Once we have these values we need to calculate a ‘% of Total’ between our current month value in comparison to our min and max values.

2017-01-17_21-44-02.png

Now we have our current month translated to a % of max we can start building out our view.


Starting with our initial data table at the level of sub-category

2017-01-17_21-45-18.png

Once in this state we should drag our % calculate to columns, this will (likely) give us a bar chart, we should change the mark type to circles, and lets colour them green for now.

2017-01-17_21-47-29.png

Now we need to bring on our scale, because we have translated our values to be as a % of total, we can simply create a calculation on the columns shelf that is equal to the average of 1, given as AVG(1).

We should change the mark type of our second axis to bar, change the it to a lighter colour so it blends into the background (allowing our key information to stand out), and make the bars thinner so they look more like a line than a bar.

2017-01-17_21-51-06.png

Now it’s a case of changing it to a dual axis chart (by right clicking on our second green pill and selecting dual axis), sychronising these axes (by right clicking on the avg(1) axis and clicking ‘synchronize axis’) and reformatting accordingly. In order to bring our ‘dots’ to the front we should move our % pill to the right of our avg(1) pill.

2017-01-17_21-55-05.png

Now we have our ‘Line Dot Plot’.


Finally it is just a case of calculating the colour of which we should encode our points with, in order to do this then we need to do some relatively simple percentile calculations and compare our current month values against these.

2017-01-17_22-09-07.png

Any questions or issues please reach out and ask!

Ben

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s