We’re bringing back the bar chart in a tooltip for #TableauTipsMonth! Thanks to Andy Cotgreave for initially introducing Using Bar Charts in Tooltips with Tableau 5.1. Now that we are using Tableau 8.1, we wanted to bring it back!
Using this technique, you can maximize the space of your viz by having a bar chart within the tooltip. To create the bar chart, we will be using this character: █ (feel free to copy and paste this character).
With dozens of these characters side-by-side, we can then round the number of █ to correspond to the length of the bar. To do so, we will need two fields:
- The percentage (numeric)
- A calculated field of usable bars ( █ )
Create a new calculated field for each “bar” with the following calculation:
The LEFT function will pull the number of characters corresponding to the rounded percentage. Depending on how large you want the bars within the tooltip, this calculation is the place where you could scale the size by changing the input in the ROUND function:
Once these fields are created, drag the corresponding fields to the tooltip on the marks card.
We have all of the necessary fields and the last remaining step is designing your tooltip! This is where we use the appropriately sized bars to create the bar chart. You can also label the bars with the percentage!