Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

Wrap X axis labels in two lines

Hi All,

I have long X axis labels in my bar chart. I want to wrap my labels in two lines.

xaxis.png

I using following expression in dimension:

Replace(Name , ' ' ,chr(13)) then It will wrap name in two lines.

But My Requirement is if Len(Name) is greater then 15 it will start new line by 3rd blank space. The expression which I am using there it is showing next line by first blank space.

Please help .

Thanks,

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

=If(Len(Name) > 15, Left(Name,FindOneOf(Name,' ',3)-1) & Chr(13) & Mid(Name,FindOneOf(Name,' ',3)+1) ,Name)

View solution in original post

3 Replies
mohammadkhatimi
Partner - Specialist
Partner - Specialist

Add Code in Calculate demension

where State= Dimension


=left(State, findoneof(State, ' ', ceil(substringcount(State, ' ')/2))) & chr(13) & chr(10) & right(State, len(State) - findoneof(State, ' ', ceil(substringcount(State, ' ')/2)))

Try above code will help you.

Regards,

Mohammad.

anbu1984
Master III
Master III

=If(Len(Name) > 15, Left(Name,FindOneOf(Name,' ',3)-1) & Chr(13) & Mid(Name,FindOneOf(Name,' ',3)+1) ,Name)

tresesco
MVP
MVP

Try:

=If(Len(Name)>15,Left(Name,Index(Name,' ',3))&chr(13)&Right(Name,Len(Name)-Index(Name, ' ',3)),Name)