Drumroll, please….! Introducing L-Shaped Bars!
Inspired by a viz I saw on Tableau’s Exchange (the Salesforce Admin Insights Accelerator), I decided to take a stab at building what has affectionately become known as L-Shaped bars. It’s a clever way to address the issue of labels overlapping labels, and delivers the same punch as a regular bar chart with less ink. It’s also a great space-saver since you don’t need space on the side or top of the bar for the long string name.
Problem: Labels overlapping labels with long string names
Solution: L-Shaped bars with a measure label at the end of the L, and the string name in the corner of the L
Pretty neat, eh? Feel free to download this solution from my Tableau Public profile and reverse-engineer for your purposes. To get you started, here are a few key tips:
Tips to building L-Shaped Bars:
Tip #1: Use Measure Names and Measure Values! Also, make sure Measure Names is placed on the row shelf.
Tip #2: Set the Line Path style to Step.
Tip #3: To add the second set of labels, place a copy of Max(0) calculation on the Columns shelf (copy it from the Measure Values Shelf) to generate the dual-axis. Don’t forget to synchronize the axis! This mark type could be a line, circle, or gantt – at a later step you can adjust the size & color so that it looks seamless with the first line. If you use a new max(0) instead of a copy, it will generate a 3rd measure name and force the label to be placed below the L-Shaped bar.
Tip #4: Be sure to “shrink up the rows” to tuck the labels into the corner of the L-Shape. This can be done by hovering your cursor on the line between Max(0) and Count of Orders and dragging the line up slightly.
Tip #5: For the blue pills on the row shelf, uncheck Show Header to hide these from the view.
Happy to answer any questions you may have – you can message me on LinkedIn or X (formerly Twitter). Happy Vizzing!
Leave a Reply