Page 1 of 1

2 YAxis (one left and one Right) in the same graph

Posted: Mon Nov 28, 2011 4:15 pm
by 17060329
Hi

i want to create a graph with line Series.

I want also 2 YAxis, one left for the first serie and one right for the second serie.

I try

Code: Select all

this.getAxes().getRight().setVisible(true);
only the left one is visible

How to do that , if it's possible ?

Thx for your help

Re: 2 YAxis (one left and one Right) in the same graph

Posted: Mon Nov 28, 2011 4:23 pm
by 17060329
I've found the solution :

Code: Select all

series0.setVerticalAxis(VerticalAxis.LEFT);
series1.setVerticalAxis(VerticalAxis.RIGHT);

Re: 2 YAxis (one left and one Right) in the same graph

Posted: Mon Nov 28, 2011 4:32 pm
by 17060329
I've another question

How to change the color and the text size for all labels of the YAxis ?

Re: 2 YAxis (one left and one Right) in the same graph

Posted: Tue Nov 29, 2011 11:11 am
by yeray
Hi Mulerone,

If you want one series to use both left and right axis you can use:

Code: Select all

series0.setVerticalAxis(VerticalAxis.BOTH);
Mulderone wrote:How to change the color and the text size for all labels of the YAxis ?
You can change it as follows:

Code: Select all

tChart1.getAxes().getLeft().getLabels().getFont().setSize(10);
tChart1.getAxes().getLeft().getLabels().getFont().setColor(Color.red);

Re: 2 YAxis (one left and one Right) in the same graph

Posted: Tue Nov 29, 2011 9:14 pm
by 17060329
Thanks for all, it works fine