On the wave of data vizualization hype, more and more vizs emerge proving that using Tableau in non-standard may produce stunning results. Thanks to that, we can deliver data to the limited dashboard space in an effective and most business valuable way. In the Show Case series I will try to gather best ideas so you can treat it as a cheatsheet and take inspirations whenever you are in ‘writers block’.
In the first post of the series, I will create Tableau Bar Chart with indicators, enriching simple bar chart with little twist making it more appealing and look more modern.
Good ol’ Tableau Bar Chart
Let’s take a look at the bar chart (doesn’t really matter if you use stacked or not). In comparison with the most popular visualization tool, Excel, tableau does not provide bells and whistles, shading, emboss and shiny labels. However, using couple tricks, it’s pretty easy to beef up Tableau Bar chart looks.
It looks better, isn’t it? I will use EU Superstore Sample as a datasource – the one provided with default Tableau Desktop installation.Let’s start with simple graph – Sales per Categories
Now, to make it work, we have to create couple of fields (Legend_value and Legend_arrow) which will hold our awesome legend.
" "+ str(round(sum([Sales])/1000))+"" " ▼"
Those empty rows at the beginning are important. They will allow you to position value and arrow inside your shape by adding or removing them. Down pointing arrow is just an ASCII symbol.
We need one more field which will position our cool legend above the bar. Let’s create Legend_position:
This added constant is totally up to you. If you would like label to hover closer to the bar decrease the value and, as you might expect, to make it float higher, add some numbers. If you are using stacked bar for this excercise, it might be required to wrap up this in total() function to make sure that basis include all series.
Now all we need to do is pull Legend_position to Row Shelf and make it a dual axis with Sales. Legend_position must be of Shape type – IMO filled circle or filled square looks best as Tableau Bar Chart Label but it’s up to you which one suits best. Of cource Custom Shapes can be used here as well.
As the last step, we have to display values in the shape. Pull Legend_value and Legend_arrow to Shape Marks. Click Color Mark to change the shape color and Label Mark to change the text color. Note that arrow and Value can have different color using proper formatting.
And here we are – Tableau Bar chart with nicely looking, pointing labels:
Whole showcase dashboard is available here: [Show Case] Dashboard – Cheatsheet
All posts in the Showcase series can be accessed by clicking here: All [Show Case] Posts