Adding Percentage Lines to Bars

A formatting option that may help in more quickly interpreting values in a bar chart is to add lines over the bars at fixed points. These could be fixed values or percentages. In this case, I’m using a percent of total bar chart, so I’ll add lines at 10% increments.

Here’s the basic bar chart to start:

Adding Grid Lines

You might think the easiest option is to add grid lines, however, these are displayed behind the bars as you can see below (at 20% increments):

Reference Lines

Another option is to use reference lines, which do sit on top of the bars. Below, I’ve added the first two lines – to represent 10% and 20% – and formatted the lines to be white. This way they match the background colour and don’t create extra ‘noise’ in the chart and only perform the function of segmenting the bars into 10% increments.

Reference Distributions

Reference lines are fine but you have to add a separate line for each percentage (or value) marker. A quicker method is to use a reference distribution and specify all the values in one go.

To do this, right click on the axis and select Add reference line:

In the dialog box that shows, select Distribution, then click the Value drop down and select Percentages. Then enter the percentage points where you want lines. Here, I’ve entered 10 through to 90 in increments of 10, separated by commas. In the drop down box below the list of values, select Constant, then enter 100 in the box above.

Next, format the line as white (or whatever background colour you have) and select a thin line:

This will result in the below distribution, which is not the effect we’re look for:

This is because it’s using the default shading, which we need to edit elsewhere. Go to the Format menu and select Reference Lines…

In the format panel that will then show on the left, under the Reference Bands and Distributions section, click the Distribution drop down and select No Fill:

Finally, we have the chart with all percentage lines:

Workbook

I used the above technique for a recent visualisation, which you can download here.

I hope this was useful and thanks for reading!
Marc Reid

Latest YouTube video
This video tutorial steps through how to create a dot plot in Tableau.

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 )

Facebook photo

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

Connecting to %s

Create a website or blog at WordPress.com

Up ↑