I don't want to display a positive Y axis scale if all of the 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 1st January 2016

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.

Chirag Vidani
Posted by RGraph support on 12th February 2013

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
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

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?


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:



Add a reply

« Back to message list