Sign in to follow this  
MGS_Sebastien

Fixed label width in bar charts

Recommended Posts

Hi,

 

How to fix the labels width in bar charts ? It seems we can't set it, the width seems to be in function of the label size. How can I make do force the width ?

 

I precise that I have a dashboard where 2 bar charts are one under the other and must be perfectly aligned and labels size are different, please tell me if there any solution !?

 

 

Thank you,

Sébastien

 

Share this post


Link to post
Share on other sites
Hi

 

You can restrict maximum length of labels for charts to align the chart using attribute "maxLabelWidthPercent" but there is no way to restrict the length of labels by supplying absolute length. FusionCharts uses label management internally which allocates space for labels based on their length, but if length is more than threshold of space reserved for data plot, it will truncate the labels.

 

Please refer to this JSFiddle sample for the same: http://jsfiddle.net/sikrigagan/y3H2G/902/

 

In this sample, the chart rendered below has more label length as compared to above one, but using "maxLabelWidthPercent" the width is restricted so that both charts are aligned and labels are ellipsed.

Share this post


Link to post
Share on other sites

Hi Gagan,

 

Oh nice find ! Thanks for that. 

 

 

 

..but if length is more than threshold of space reserved for data plot, it will truncate the labels...

 

 

Is there a way to avoid the truncate ? For example wrap the text ?

 

 

 

Sébastien

Share this post


Link to post
Share on other sites
Hi

 

No, there is no way to prevent truncation of labels due to certain limitations. You can specify break statements in labels to display labels in multiple lines but it will affect the alignment of chart which will not look good visually.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this