Left and Right Value Axes

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

Left and Right Value Axes

Post by Robbie » Mon Jan 13, 2003 5:43 pm

Hi,

This is a quick question that I am sure I have overlooked somewhere. I want to create a chart with effectively 5 lines on it representing volumes of fluid per day over a year. Three are on one scale shown on the left and the other two are on a different scale (cumulative) shown on the right. I've based what I have done so far on the freechart-sample/xy_chart.jsp and classes.

Using the javadocs I have worked out how to create multiple lines on the same axis (XYSeriesCollection) but this does not help with the problem described above. The cumulative values (to be shown on the right axis) are significantly higher than the daily ones (shown on the left axis) so the graph doesn't really work with one scale. Tried dabbling with the OverlaidXYPlot but get null pointer exceptions so must be doing something wrong.

Any help appreciated.

Cheers
Robbie.

Don Mitchell

Re: Left and Right Value Axes

Post by Don Mitchell » Mon Jan 13, 2003 8:10 pm

Robbie,

I've seen it mentioned in this phorum that the next release of JFreeChart will allow you to have two y-axises, each with its own scale. So that will solve your problem. Search through the phorum and you'll probably find a posting describing it. To get the new code, you'll probably have pull an early version of it out of source forge if its allowed.

Don

David Gilbert

Re: Left and Right Value Axes

Post by David Gilbert » Tue Jan 14, 2003 9:45 am

Hi Robbie,

Don is correct, dual axes are working in the CVS version of JFreeChart which you can check out from the project page on SourceForge. Some refinements will be made before 0.9.5 is released, but I don't think the changes will be major.

Regards,

Dave Gilbert

Locked