#TakeapartTuesday Bars inside a 100% box

Recently I’ve seen a few #MakeoverMonday submissions where individual bars in bar charts are plotted within a “shell” to help the audience understand precisely where the value sits relative to the 100% mark. This week, I was inspired by #MakeoverMonday debutant Ruchika Agrawa, whose viz looked like this:

Whilst I am somewhat renowned for using bar charts, I’ve never created a chart exactly like this. It’s simple to do but I think it adds a great extra layer of audience guidance to what is already an easy-to-understand chart type.

You start by just creating a conventional bar chart. In this instance, we’re looking only at the Top Ten countries, in terms of the % of workforce who are female. The only vaguely complicated element here is the Top N filter:

The key to this chart type is the border around an unseen 100% benchmark. How to do that? It’s easy:

The average of 1 tends to be 1, so by plotting this across the Rows we end up with the equivalent of a 100% value in each Row. If you make this a dual-axis and synchronise, you’ll probably end up with a bunch of Circles as Tableau likes to think it knows best – set the Mark type to Bar on the All Marks Card.

You may now end up with a whole load of 100% values:

That’s just because AVG(1) is “at the front”. If you right-click the axis with the Measure you want to put to the front, select “Move marks to front”, then that Measure will appear on top of the AVG(1):

Now you have some design choices to make about your use of colour and borders. I always err on the side of simplicity, so I’ll elect to make the AVG(1) Measure white, with a black border:

From hereon in, it really is just a case of basic formatting to get things looking like the end product. To get Country as a left-aligned label, just put Country on Label on one of your axes, left-align it and then hide the Country header:

To plot the value at the end of the red bar, just add cell level reference lines and then format them so they’re left-aligned and centred:

And then you’re at the clean-up stage. My tendency to simplify sees me remove pretty much everything that Tableau frustratingly forces upon us by default. No axis ticks or rulers, no gridlines, no zero lines, no Row or Column dividers.

I don’t need to see the axis headers as I’ve labeled the bars directly. However, if the title isn’t specific, I like to let my audience understand what Measure is being plotted, so occasionally use a basic “hack” to create a dummy axis header:

Directly typing into Columns in inverted commas lets me set a “freeform” axis header, which isn’t bound to the title of an actual Measure. I can then right-click it to remove the field label for columns, and then right-click again to align and format the header exactly as I want:

After a few more formatting tweaks, you can end up with a super simple bar chart, but with the additional contextual visual aid of that outline of the 100% mark: