How do I get a right side Y axis title?
« Back to message list
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.
Kevin
Posted by RGraph support on 29th August 2013I 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.
Kevin
Hi there,
Try setting chart.yaxispos to either left or right.
Richard, RGraph Support
Posted by Kevin Morwood on 29th August 2013Try setting chart.yaxispos to either left or right.
Richard, RGraph Support
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 2013The title.yaxis just doesn't follow suit.
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 2013Try 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
That 'title.yaxis.align' setting did the job!!
Thanks!
Posted by Kristiaan Bonthond on 5th January 2014Thanks!
Hello,
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 2014I 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?
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)
{
RGraph.Text2({...});
}
yaxis2.Draw();
Richard
Posted by Richard on 6th January 2014For 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)
{
RGraph.Text2({...});
}
yaxis2.Draw();
Richard
Hi there,
Like this:
www.rgraph.net/fiddle/view.html/a-simple-drawing-api-y-axis-with-a-custom-title
Richard
Like this:
www.rgraph.net/fiddle/view.html/a-simple-drawing-api-y-axis-with-a-custom-title
Richard
Add a reply
« Back to message list