Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wrap text of x axis dimension.

Hi All,

I have a bar chart with one expression and one dimension. However the x axis labels for dimension values are too long and I want to wrap them in 2-3 lines. I tried various options in the Presentation, font and axes tabs but was unable to solve the problem. Is there some way I can solve this issue.

Thanks,

Neeraj

9 Replies
Not applicable
Author

Wraping up the Dimension value is not possible. But what you could do is,  go to chart property --> Style and change the orientation to horizontal. Only this much you can do, not more than that

- Sridhar

Not applicable
Author

Thanks for the prompt reponse Sridhar !!

Regards,

Neeraj

Not applicable
Author

Hi:

Inserting chr(13) after a specified length or specific number of words would result the x-axis labels to 2 lines.

Hope this helps!!

Narasimha K

Not applicable
Author

Using a horizontal orientation is a good option. Or else if you need the same vertical plot, you can also try the following

Axes tab ->  Change Primary dimension Labels to Vertical ( | ) or Inclined ( / )

Presentation Tab -> limiting the number of visible bars  (Max Visible Number) and using X axis scroll bar

Not sure if you Dimension values are still bigger ..

Regards

DS

Not applicable
Author

mohan2391
Creator III
Creator III

Hi Narasimha,

Where to write that chr(13) ?

Could u pls give a clear explanation ?

Thank you

sdmech81
Specialist
Specialist

Hi,

What you can do is,if the dimension u are using is containing less number of values and if they are very long as you said above.

Then,you can use calculated dimensions and rename them or shorten them as you want..

let me know If anything needed..

Anonymous
Not applicable
Author

In the Presentation tab, unselect the Limit Legend (Characters) check box. This may help to display a few extra characters, but as mentioned by others - it is not possible to wrap text in legends

clip.jpg

Not applicable
Author

Personally, I think this is a shortcoming of the application. I'm always being asked to "display the full labels"... which is a chore. It irks me to consider saying "no" to something as basic as that.

However, I've used something like the following as the expression of a dimension:

=if(Len([FieldName])>30,Left([FieldName],30) & '-' & Chr(10) & Right([FieldName],Len([FieldName])-30),[FieldName])

Essentially, this will look for field names > 30 characters.

If it's > 30, it splits the line @ the 30th character (using the Chr(10)) , adds a hyphen, and displays the remainder of the text on the line below. If it's < 30, it displays the whole field name.

Obviously you can change the number of characters from 30 to fit your own chart's size.

It's crude, but it works well enough in most instances.

If you come up with any better ideas, please let me know!

(I suspect there could be a way of counting the characters in a string, and counting the number of spaces in a string, then performing the split at one of those spaces so that you don't get single/orphan characters on the second line...but if the application just had a few more fundamental and improved display options, we wouldn't have to even consider it!)