Loading

Text Wrap Not Applied for Labels

發佈日期: Apr 30, 2025
描述
Wrapping text labels displayed on a stacked bar chart by [Format] > [Alignment] > [Wrap] > [On] menu may not work as expected.

[Format] > [Alignment]  menu
 User-added image
解決方案

Using a string function (eg:  LEFT() , MID())  to break up the long label string into short sub-strings can be accomplished by creating calculation fields and then displaying sub-strings one by one vertically on the bar chart.  Follow along with a sample packaged workbook found in the Attachments section of this article.

Information about string functions is available in Tableau Online Help.

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

其他資源
This example is for a stacked bar chart, but the display challenge can exist in other types of chart with mark labels. The example above shows splitting the texts at 15 characters, but you can set other values or conditions depending on the requirements.
知識文章編號

001471712

附件

LongTextWrapBarChart.twbx

21 KB

 
正在載入
Salesforce Help | Article