Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wrapping Y-axis dimension text in Horizontal bar chart

Hi Qlik Folks,

I have come across Y-axis dimensions with long names (with 60-70 character length) in Horizontal bar chart. Now I want to make the dimension as 3 liner as the name is not clearly visible.

We do not want to increase chart layout as it is fixed across all other charts.

I found some solutions to this kind of issue but all are leading to Vertical or diagonal bar chart.

Is it possible to have dimension values as wrapped text?

How to wrap text of a dimension used in bar chart??

https://community.qlikview.com/thread/125007

As the workaround , I had changed similar Horizontal bar chart to vertical and later tried to change it to Horizontal (original format) but it is not showing as expected.

Is it a limitation in QlikView with wrapping text in Horizontal bar chart  or Could you please suggest the solution for it as soon as possible as the expectation is to resolve the issue immediately.

Many thanks in Advance,

Laxman.

11 Replies
giakoum
Partner - Master II
Partner - Master II

What we usually do is having short descriptions on the chart axis and displaying the long description on mouse over using a text as popup expression

Not applicable
Author

Thank you Ioannis.

May be you are right.

But the requirement is to show the entire text which ever possible way(can be 2 or 3 liner).

Could you please suggest any possibility.

Many thanks in advance,

Laxman.

florentina_doga
Partner - Creator III
Partner - Creator III

so try to write dimension like


left(dimension,10)&chr(13)&mid(dimension,11,len(dimension)-10)

giakoum
Partner - Master II
Partner - Master II

If you have a fixed set of values in the dimension, always sorted in the same order, you can maybe use text in chart to label the bars (hide axis and use Ctrl + shift to adjust chart elements size and position). Not a good choice, since whenever a new value is added to the dimension, you will need to manually add the text, and bars size adjusts automatically in QV depending on expression value, but anyway it is worth trying.

Not applicable
Author

Thank you Florentina.

The above code is slicing the dimension to first 10 characters only.

But we want to show the entire text within the layout possibly in 2-3 liner.

Could you please suggest any possibility.

Many thanks in advance,

Laxman.

Anonymous
Not applicable
Author

I may have a workaround

please look for the text of your Dimension

if it is all of this Format abcdef - xyz (means the sign - separates the text

you may use this calculated Dimension:

replace(yourdimension, '-', chr(13)

I made a short test, in my case I got each Dimension in two lines

maybe that's something for you too?

Not applicable
Author

Thank you Rudolf.

But this is not working in my case.

My dimension name is like this US_CA_MGR1 - Jonathan CollingwoodJr

So probably in my case it is limited to First word before the space character.

Could you please suggest the workaround.

Many thanks in advance,

Laxman.

florentina_doga
Partner - Creator III
Partner - Creator III

=left(bb,floor(aa/3))&chr(13)&mid(bb,floor(aa/3)+1,floor(aa/3))&chr(13)&mid(bb,2*floor(aa/3)+1,floor(aa/3))

bb=dimension

aa=len(dimension)

florentina_doga
Partner - Creator III
Partner - Creator III

try this

=left(bb,floor(aa/3))&chr(13)&mid(bb,floor(aa/3)+1,floor(aa/3))&chr(13)&mid(bb,2*floor(aa/3)+1,floor(aa/3))

replace

bb=dimension

and

aa=len(dimension)