Regarding controlling the background grid size on a Bar chart

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 Vignesh on 9th August 2016
Hi sir

I want to control the grid size when we have to show single data in bar graph .my problem is when i am trying to show single data in bar graph .the bar takes total space so it doesn't look bar graph
Posted by Richard on 9th August 2016
Hi there,

If you want to control the background grid then you can use the autofit settings.

On the other hand if you want thinner bars - then the property to use is called hmargin.

This chart shows both:

www.rgraph.net/fiddle/view.html/bar-chart-with-background-grid-control


Richard

Posted by Lakshman on 9th August 2016
I have tried your suggestion in the following jsfiddle, fiddle.jshell.net/lakshman/3Lhjgc4d/

But the bar is aligned toward right side of the bar and overflows for hmargin value 10. For hmargin value 20 the bar is invisible. Can you please check if thats the right way to do it?

Thanks,
Lakshman
Posted by Richard on 9th August 2016
Hi there,

You've got this:

barOne.set('hmargin', '20');

Which has quotes around the value- which you shouldn't have (it should be a number - not a string). So change it to this:


barOne.set('hmargin', 20);



Richard

Posted by Vignesh on 10th August 2016
Hi sir


I have Tried the above example .I worked for me
thanks for Your Reply sir

regards
vignesh

Add a reply




« Back to message list