Y axis values in short form

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 Wrox on 23rd June 2014
Hello Richard,

Q[1]
I want to change y-axis values to be appended with
if value grater than 1000 append 'k'
if value grater than 1000000 append 'M'
if value grater than 1000000000 append 'G'

so that we can keep y-axis gutter width constant.

Q[2] I would like to set character limit to y-axis labels
so that if they exceeds that limit '..' will be appended to it.

y-axis label is 'United States of America' and character limit is let say 8
y-axis label will be 'United S..'

Q[3] Can we put tooltip to x-axis and y-axis labels. so that i will show me full values that I have appended it in question 1 and 2 ?


Thank you
Posted by Richard on 23rd June 2014
1. You will need to check your values, adjust them depending on the maximum value (ie if the max is 1400 divide them all by 1000) and then use the units.post option to append the correct unit - eg:

obj.set('units.post', 'k');


2. I think you mean the X axis labels - but either way there's no option that does what you want (a character limit) Before you set the labels you could shorten them depending on how long they are.

3. Sort of - you could use the drawing API rect object, and the obj.coordsText array to put a rect over the text and set the text to be the full text that you want to display.


Richard

Add a reply




« Back to message list