Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
kmarsden
Partner - Contributor III
Partner - Contributor III

Bar chart: prevent auto-adjust to data

Hi,

Is there a way of fixing the position of the axis on a horizontal bar chart regardless of the dimension values?

I want to future proof a chart and have overlaid some text boxes so the position of the chart is key. If a dimension value is returned with different lengths in the future the chart will shift and all the text boxes are mis-aligned, it's very annoying!

bar chart issue.png

6 Replies
Not applicable

Have you tried perform a Ctrl+Shift keys - that will place red borders  the legend are chart area - you can drag the borders to make the chart are wider or longer

marcus_sommer

Maybe you used a string-function to prevent this, like: mid(YourDimension, 1, 10). If then your dimension-values not more unique then this needs some more logic but at first you could try it so.

- Marcus

kmarsden
Partner - Contributor III
Partner - Contributor III
Author

I think I going to try something similar. I'm going to create a dummy record with a long string length which will be linked to each row in that dimension field. I can then hide it and use a string function to truncate anything that has a longer string length than the dummy record. It's not ideal but I don't see an easier way.

If anyone out there is aware of a more elegant way I'd be grateful if you could share...

kmarsden
Partner - Contributor III
Partner - Contributor III
Author

This gave me an idea for a workaround so thank you for taking a look

marcus_sommer

I would try it without the dummy-record by doing something like this:

mid(YourDimension, 1, if(len(YourDimension) < 11, 10, len(YourDimension)) &

     if(len(YourDimension) < 10, repeat(chr(32), 10 - len(YourDimension), '')

Maybe it needs some attempts to find a fill-char which will be accepted but there are various space-chars possible, see here what I mean: Container.

- Marcus

kmarsden
Partner - Contributor III
Partner - Contributor III
Author

Hi Marcus, I see what you mean. I've now tried this and going to use it with some minor adjustments to suit my needs. Thanks for your help.