2nd Y Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Grant

2nd Y Axis

Post by Grant » Thu Sep 05, 2002 4:37 am

Hi,

Does anyone know how to enable a 2nd Y axis on the right side of a vertical bar graph. I also want the 2nd axis to be in a different scale and have a different label than the left-hand side Y axis.

If it can't be done, where would I look to code it myself.

Thanks for any advice...

Grant

Grant

Re: 2nd Y Axis

Post by Grant » Thu Sep 05, 2002 6:54 am

I have since searched/trolled the forums and I see that a 2nd Y axis has been requested many times, and that it might soon be added.

Can anyone point me to the right area to start coding / maybe if I get it working I could post the code back to the community ;-)

Grant

David Gilbert

Re: 2nd Y Axis

Post by David Gilbert » Thu Sep 05, 2002 8:26 am

Hi Grant,

I would approach this in two steps. First, change the axis drawing code so that the existing (primary) axes can be drawn on either side (or top and bottom) of the charts. That is a reasonable amount of work in itself.

Next, probably more work, add a secondary dataset to the Plot class, and a secondary range axis, then modify the plot drawing code to first draw the main dataset against the primary range axis, and the second dataset against the secondary range axis.

I haven't thought about whether the legend should display the series from both datasets, or if there should be two legends. There are sure to be other issues as well.

I'm planning to start work on this some time in October...

Regards,

DG.

Locked