Y label position and limit number of showing X label in Bar chart


« 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 xianxian on 14th January 2014
Hello,

I am using the powerful RGraph now. It is very useful but I got some problems.

I need to plot about 300 data with corresponding (x,y) value to bar graph. I need y label, x label and tooltips.

However, the x label got too crowded and i didn't find any property to set a limit number of x label. Now what I am doing is to cut some x values from the x label array. But I am affraid that the tooltips function will not work. Is there any better way to implement this?

And the y labels are all decimals. I can only see the digits before dots but the digits after dots are hidden. again I didn't find any to change the position of y label...

Thank you very much!
Best regards,
Xianxian
Posted by Richard on 14th January 2014
Hi there,


1. You could have two arrays - one for tooltips one for labels and reduce the number of items in the labels array. Or use the text.angle setting. Or add \r\n to the start of every other label to make them use two lines.

2. You'll need to use a combination of the scale.decimals option to limit the number of decimals and the gutter.left (or gutter.right) option to give yourself extra space.


Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website
Posted by xianxian on 14th January 2014
Hi Richard,

Thank you very much!

Now I have nice y labels, clear x labels and the tooltips are working!

But there comes the new problem: the values shown in the tooltips are not matched with the x label... I am thinking a way to shift the position of x labels to right. But I only found chart.xlabels.offset which change the position of x label up and down.

Thank you again in advance!

Posted by Richard on 14th January 2014
Hi there,

I don't understand the issue - the X labels are whatever you specify - so you can have a specific label in whatever position you wish.

If you wished you could use the drawing API X axis object:

www.rgraph.net/docs/drawing-api-xaxis.html





Richard
www.rgraph.net
Please link to the RGraph website. Thanks!

Add a reply

 




« Back to message list
RGraph on social media