Is it possible to make the Y values go from lower value to higher?

Share RGraph:   Share or Like RGraph on Facebook!

« 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 imbaimba on 30th July 2013
I'm making a line graph, and I need the Y values to be lower on top and higher on bottom. The reason is that I'm using it for rating, and in rating, for example, 1st place is better than 2nd place, but in the graph it shows otherwise.
Is it possible to make the Y values be upside down, and if the object goes from 1st place to 2nd place, it won't show that it went up for example, but went down?
Posted by RGraph support on 30th July 2013
Hi there,

It sounds like you're talking about the chart.scale.invert option. There's a demo that demonstrates it here:

www.rgraph.net/fiddle/view/a-line-chart-with-an-inverted-scale



Richard
Posted by imbaimba on 30th July 2013
Thank you very much! It helps a lot!
Posted by imbaimba on 30th July 2013
Is there any way to hide the zero, because there can't be a zero place?
Posted by RGraph support on 30th July 2013
Hi there,

Yes - just set the ymin option as in the example.



Richard, RGraph support
Posted by imbaimba on 30th July 2013
Thanks again! You saved my day :)
Posted by imbaimba on 30th July 2013
So now, unless I set the ymax, the number 3 appears 2 times (the numbers are 1-5). Thing is that the number of places changes, and I can't set a maximum value for it. Any what I can do with the double 3 in the middle?
Posted by RGraph support on 30th July 2013
Hi there,

By default there's 5 labels - but going from 1-5 instead of 0-5 there's only 4 "spaces" - so you either need to either need to change the number of Y labels like the example or add decimals with chart.scale.decimals.

Try taking the source from the example.



Richard, RGraph support

Add a reply




« Back to message list