Right side Y axis label

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 Kevin Morwood on 28th August 2013
I have searched the documentation and I can not find an example of a right side yaxis with a title.

I have a chart which plots two charts on top of each other. One is voltage with left side yaxis title 'Volts'. The other is amps with right side yaxis title 'Amps'. The 'Amps' title keeps printing on top of the 'Volts'. The actual scale for the 'Amps' axis works perfectly.

By the way, thanks for a great piece of software.

Posted by RGraph support on 29th August 2013
Hi there,

Try setting chart.yaxispos to either left or right.

Richard, RGraph Support
Posted by Kevin Morwood on 29th August 2013
I have already set the chart.yaxispos to right...and the scale moved accordingly.

The title.yaxis just doesn't follow suit.
Posted by RGraph support on 29th August 2013
Hi there,

Try these:

obj.Set('title.yaxis', 'A test Y axis title')
obj.Set('title.yaxis.align', 'right')
obj.Set('title.yaxis.pos', 0.7)

Richard, RGraph Support
Posted by Kevin Morwood on 29th August 2013
That 'title.yaxis.align' setting did the job!!

Posted by Kristiaan Bonthond on 5th January 2014

I kind of got the same problem: after updating my RGraph library from 05-2013 to the latest version of 12-2013, the title of my Yaxis doesn't seem to want to go to the right side. I have been using the following code, in which I have added the indicated lines:

  yaxis2 = new RGraph.Drawing.YAxis('cvs', 950);
  yaxis2.Set('chart.align', 'right');
  yaxis2.Set('chart.colors', ['blue']);
  yaxis2.Set('chart.text.color', 'blue');
  yaxis2.Set('chart.max', 100);
  yaxis2.Set('chart.numticks', 20);
  yaxis2.Set('chart.numlabels', 10);
  yaxis2.Set('gutter.bottom', gutterBottom);
  yaxis2.Set('chart.title', 'Luchtvochtigheid [%RH]');
  yaxis2.Set('title.yaxis.align', 'right');
  yaxis2.Set('title.yaxis.pos', 0.7) // added 2014-01-05
  yaxis2.Draw(); // added 2014-01-05

Has there been some latent fault in my code which has been revealed by the newer version?
Posted by Richard on 5th January 2014
Hi there,

For the YAxis drawing API object there is no pos setting. If you're comfortable you could use the ondraw event and then draw the title yourself at the position you want:


yaxis2.ondraw = function (obj)


Posted by Richard on 6th January 2014
Hi there,

Like this:



Add a reply

« Back to message list