KNOWLEDGE BASE

How To Avoid Labels Overlapping Each Other While Showing All Labels In Line Chart Using Shapes


Published: 10 Apr 2020
Last Modified Date: 01 Sep 2023

Question

How to avoid overlapping labels while showing all the labels without moving them manually

For example:

User-added image

Desired:

User-added image

Environment

  • Tableau Desktop

Answer

To follow along with the below solution, please see the sample package workbook in the Attachments section.

1. Create the following calculations

Label1 with the following formula:
IF INDEX()%2=1 THEN ATTR([Category]) END

Label2 with the following formula:
IF INDEX()%2=0 THEN ATTR([Category]) END

2. Drag the calculated fields created above to Label on the Marks card

3. Click Label > Text ... to edit the label as shown below: 

 <AGG(Label2)>
*Enter*
*Enter*
*Enter*
<AGG(Label1)>

User-added image

4. Click Label > Alignment to adjust the position of labels to fit the view
 
Did this article resolve the issue?