Advanced Chart Types
I was delivering a Tableau Desktop Training Session recently, and was asked to show how to create some common ‘non out of the box’ chart types in Tableau. As I was doing this, I realised that the foundation for a lot of these charts is the Dual Axis Charts (yes, I said it, Dual Axis Charts!).
Let me explain further; first let’s look at one of the ways to create a dual axis chart. Consider the following piece of analysis of Profit and Sales by Month (I’m using Tableau’s Superstore dataset).
Now to create a Dual Axis Chart; right click on the secondary axis (the lower axis), and go to Dual Axis:
You then end up with something that looks like this:
You can then take a few steps to just tweak the above should you choose too, and understanding these steps will help you to create those ‘advanced’ chart types.
The first thing to understand is you primary and secondary axis, and how they can be formatted independently.
What you’ll notice is that whenever you have more than one measure in your rows or columns shelf, Tableau will create a separate marks card for each of them. Let’s look at the above screen shot but zoomed in a bit:
Do you notice how you have three options within the Marks Card – All, Sum(Sales) and Sum(Profit)? The Sum(Sales) and the Sum(Profit) are the two measures in your visualisation, these are your two axis! You upper mark (or the left hand side axis) – Sum(Sales) is your primary axis, and the lower mark (or the right hand side axis) is your secondary axis. Your primary and secondary can be formatted through their independent Marks Cards separately.
Let’s click on the Primary axis Mark – Sum(Sales) and do some formatting (note – you know it’s selected as the Sum(Sales) is in bold)
Okay – so maybe I want to set the mark on this as a bar – and change the colour to red – I can do all of this through the Primary axis’ marks card, and this is what it looks like:
Note how I have independently formatted this Primary axis – and I can do exactly the same thing with the secondary axis too.
So now lets do a couple of other formatting points, one of the things I may want to do is to synchronise the axis – I can do this by right-clicking on the secondary axis (as in the actual axis) and clicking on “Synchronize Axis”
You can also go ahead and hide the axis, as you would do normally by right clicking on the axis you wish to hide, and un-selecting “Show Header”.
Ok – thanks for that – but how does understanding this let me create “Advanced Chart Types” …
I’m glad you asked, let’s go over some now!
Bar In Bar Charts
For those that haven’t seen a Bar In Bar Chart before – this is what it looks like –
In my view – these charts are useful when comparing things like Actual versus Target type analysis.
So how would we create this? It’s just a Dual Axis Chart!
Consider our previous example of Sales Versus Profit, which looked something like this:
We can take a few really simple steps to change the above to a Bar-In-Bar Chart.
- Go to your secondary axis, Sum(Profit) on the Marks Card
- Change your Marks drop down to Bar
- Click on Size (within the Marks Card on the secondary axis) and reduce the size of this.
- You will end up with something that looks like this:
That’s it – this is essentially your bar in bar chart.
You can then apply some formatting to the above to make it look like the original image:
- Removing the grid lines
- Hiding the secondary axis
- Removing the “Sales” Axis name from the primary axis
- Hiding the Order Date Header
- Ta-dah…. you have your Bar-In-Bar ChartOkay, let’s look at another one…Lollipop Charts
Again, for those that don’t know, this is what a Lollipop Chat looks like:
In my view – this chart is good to highlight the top point of what would normally be a bar chart. It’s a simple view yet slightly different to the standard bar chart, which will be a slightly different visualisation for your users to review.
Again, you guessed it; a lollipop chart is essentially a dual axis chart! One of the axes is a bar chart (albeit a thin bar chart) and the second axis representing circular marks.
Okay, so let’s look at how we would create this:
- Create a simple bar chart (either horizontal or vertical would work fine with this); something like this for Month of Order Date by Sum of Sales
- So let’s create a dual axis chart by dragging and dropping Sum(Sales) to the Rows shelf (next to the Sales pill that is already there)
- Now set up your dual axis and synchronise your axis (I explained how to do this before)
- It looks like there is only one measure in the view, but trust me there’s two there!
- Now it’s time to format the marks card. Keep the primary axis as a bar chart and reduce the size of the bar to make them thinner.
- Change the marks on the secondary axis to circles. You can reduce the size of the circle as you see relevant. This is what you end up with:
- Now apply some further formatting as per your choice such as:
- Removing gridlines
- Hiding secondary axis
- Changing the circle to be the same colour as the bar
And you’re done – simples!
Doughnut charts are a similar concept and a quick tutorial for this can be found here: Click Here
Had enough? No?
Okay, okay – let’s do one more – let’s look at maps. Let’s look at create a filled map chart overlaid with a symbol map. Let’s go through this example:
- Create a simple filled map in Tableau – I’ve used the Sample – Superstore dataset and dragged and dropped Sum(Profit) into the colours mark
- If your are unsure how to do this – double click on the State Dimension and drag and drop the Profit measure onto the colour shelf
- Now drag and drop the Latitude(generated) into the rows shelf next to the current Latitude(generated) pill in there.
- Notice how we are back at a ‘dual axis’ type chart.
- So click on the secondary axis, and change the mark type to circle
- Let’s also change the actual measure to be represented by Sum(Sales) – just to make things a bit different.
- You can do this by removing Sum(Profit) from the colours card in the secondary axis marks card.
- Now add the Sum(Sales) into the size card
- Now set up your dual axis chart
- Click on the secondary axis triangle and select Dual Axis
- And you’re done – you can now format as you wish.
The examples I went through here are not an exhaustive list, there are many other chart types and Tableau use cases that can be reviewed by having that basic understanding of Dual Axis and the independent marks card.
I hope you found this post useful and look forward to seeing you trying out some of these ‘advanced chart types’ yourself.