Using Reference Line To Align Labels
In Tableau, there are different ways to align chart labels. There are four ways to be precise – horizontal, vertical, directional & wrapping. This article explores the horizontal and vertical alignment. At the horizontal alignment we can either align our labels to the right, center or left. While at vertical alignment we can align our labels to the top, middle or bottom.
Here is a sample of different ways to align labels vertically on a bar chart;
Although these three options are flexible enough, sometimes we need to try something different from the default settings. For example, a simple bar chart with labels aligned to the top center but slightly inside the chart, see below.
How can we create this in Tableau?
Using Superstores data set pre-packaged with Tableau app, let’s recreate the view above;
Build a simple bar chart.
Drag dimension field Region to the columns shelf.
Drag measure field Sales to the rows shelf.
Chose Bar under marks card.
Make the charts dual & synchronize the axis.
Under marks cards, make one chart a Bar and the other a Gantt Bar chart.
Select the Gantt Bar chart.
Drag measure field Sales to the label shelf.
While still on the Gantt Bar chart;
Select label, under Alignment select Bottom Center.
Executing this, hiding one of the headers and formatting the view we’ve.
I hope this article was helpful in your journey to Tableau mastery.
Thanks for reading.