Don't want to display positive Y axis scale if data is negative


« 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 Chirag on 12th February 2013
Hello,

Today, while searching internet I came across RGraph and found it feasible for displaying HTML5 charts and tried to implement after referring documentation.

But I am unable to achieve one functionality, the data which I am going to plot may be negative or positive (based on condition), and if Y-Axis data is negative, chart is also displaying the positive scale of Y-Axis, which I don't want.

And even when X-Axis data is negative I wanted to move X-Axis to top of chart which is currently only shown in center or bottom position.

Please assist me on this.

Regards,
Chirag Vidani
Posted by RGraph support on 12th February 2013
Hi,

The X axis can be in the middle, at the top or at the bottom for the Bar and Line charts:

obj.Set('chart.xaxispos', 'top');

Richard, RGraph Support

1 Year Premium Support now reduced to £299:
   www.rgraph.net/support
Posted by Chris Ghormley on 1st March 2013
But it looks like only 'center' and 'bottom' are supported for Scatter charts?

I have some code that checks to see whether there are positive, negative, or mixed values in the data sets before drawing my scatter plot. Based on the result I set the xaxispos property. When all the data is negative I set the xaxispos to 'top', but I'm getting a warning from RGraph which then overrides the xaxispos to 'center'.

Would it be a big deal to add top position support to Scatter?
Posted by RGraph support on 2nd March 2013
Hi,

The Scatter chart only supports the X axis at the bottom or center
Posted by Chris Ghormley on 4th March 2013
I looked at the code after asking my question and realized that it was not trivial to support x-axis at top.
Posted by Kurt on 9th January 2014
My question is similar, I hope this thread is appropriate.

The researchers I am developing for want to plot negative dollar values (debt amounts) on a line chart. Is it possible to have a y-axis with a range that is asymetrical about zero, say , from $1000 at the top to -$150000 at the bottom?

thanks

Kurt
Posted by Richard on 10th January 2014
Hi there,

It's possible - but far from as straight forward as specifying an option. By using the line chart outofbounds option, the drawing API axis objects and as well as drawing the background grid yourself it can be done:

www.rgraph.net/tests/line-quarter-axis.html


There's more examples here:

www.rgraph.net/demos/line-quarter-axis-dual-color.html
www.rgraph.net/demos/line-quarter-axis.html
www.rgraph.net/demos/line-quarter-axis2.html




Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website

Add a reply

 




« Back to message list
RGraph on social media