KNOWLEDGE BASE

Text Wrap Not Applied for Labels


Published: 04 Dec 2020
Last Modified Date: 04 Dec 2020

Issue

Wrapping text label showed on stacked bar chart by [Format] > [Alignment] > [Wrap] > [On] menu may not working.
*[Format] > [Alignment]  menu
eg:
 User-added image

Environment

  • Tableau Desktop

Resolution

Workaround

Using string function(eg:  LEFT() , MID())  to break the long label string into short sub-string by creating calculation fields and display sub-strings one by one vertically on the bar chart.
※About String Function 
https://help.tableau.com/current/pro/desktop/en-us/functions_functions_string.htm

Example:
1. Create calculation field [Substring1]
LEFT([Text Label],15)

2. Create calculation field [Substring2]
MID([Text Label],FIND([Text Label],",")+1,14)

3. Place [Substring1] and [Substring2] on [Text] mark label.
User-added image
*Please find attached LongTextWrapBarChart.twbx for more details.

Additional Information

This example is for a stacked bar chart, but the issue exists in other types of chart in mark labels.
Did this article resolve the issue?