Get rid of labels on stacked Bar chart with no value

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Antonio Vianello on 28th November 2013
Hi There!

I'm dealing with a timed (values from 00:00 to 23:00) stacked bar chart with the total value labels above each bar.

How can obtain that when there is no value for the chart, i.e. 22:00, I get rid of the 0.00 label above each null sized bar?

Thanks in advance
Posted by RGraph support on 28th November 2013
Hi there,

I think you will need to switch to using the chart.labels.above.specific option and give it the numbers that you want shown for each bar. You can then use an empty string for values that you don't want to be shown.





Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by Antonio Vianello on 9th December 2013
Hi there!

This solution seems to work only for simple bar charts and not for stacked bar charts.
In fact, when I apply this workaround in a stacked bar chart containing, i.e., three tokens in a single bar, each element of the array of labels seems to apply just for each single token of the bar and not for the whole bar, so I get a big mess of labels along the X axis and in the bars!

Please help!

Thanks in advance
Posted by RGraph support on 9th December 2013
Hi there,

You will need to do something like this:

www.rgraph.net/fiddle/view/a-stacked-bar-chart-with-above-labels





Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by Antonio Vianello on 9th December 2013
Hi there!

Now it works, but unexpectedly in my case the labels don't appear above each bar, like in the example given, but instead at the end of each second token of each bar!

How can I overcome this?

Thanks
Posted by RGraph support on 9th December 2013
Hi there,

If you have a different number of "stacked sections" to your bars you will need to adjust the number of empty labels.





Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site

Add a reply




« Back to message list