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

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Mulderone
Newbie
Newbie
Posts: 26
Joined: Mon Oct 03, 2011 12:00 am

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

Post by Mulderone » Mon Nov 28, 2011 4:15 pm

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

Mulderone
Newbie
Newbie
Posts: 26
Joined: Mon Oct 03, 2011 12:00 am

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

Post by Mulderone » Mon Nov 28, 2011 4:23 pm

I've found the solution :

Code: Select all

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

Mulderone
Newbie
Newbie
Posts: 26
Joined: Mon Oct 03, 2011 12:00 am

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

Post by Mulderone » Mon Nov 28, 2011 4:32 pm

I've another question

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

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Tue Nov 29, 2011 11:11 am

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);
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Mulderone
Newbie
Newbie
Posts: 26
Joined: Mon Oct 03, 2011 12:00 am

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

Post by Mulderone » Tue Nov 29, 2011 9:14 pm

Thanks for all, it works fine

Post Reply