chart with dual axies measures

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sylvie
Posts: 4
Joined: Tue Jun 06, 2006 9:43 pm

chart with dual axies measures

Post by sylvie » Tue Jun 06, 2006 9:48 pm

I wonder whether freechart allow to create a chart with dual axies.

for example, I want to create a chart with two curves, one is netincome of a company, the other is revenue of this company.

They are measured in different units. But, I hope to plot two curves in one chart. How?

angel
Posts: 899
Joined: Thu Jan 15, 2004 12:07 am
Location: Germany - Palatinate

Post by angel » Wed Jun 07, 2006 7:27 am

Take a look at the "Multiple Axis Charts" in the demo-application.

sylvie
Posts: 4
Joined: Tue Jun 06, 2006 9:43 pm

Post by sylvie » Wed Jun 07, 2006 2:21 pm

Thanks to your reply. I check my demo folder. in my setting it is
C:\jar\jfreechart-1.0.1\source\org\jfree\chart\demo

but there are only three demos. I didn't see the multiple axis chart one.

I checked my axis folder also. But, there is no such demos.

Would you help to post the sample code here?

many thanks

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Jun 07, 2006 2:51 pm

You can run the JFreeChart demo applications with:

java -jar jfreechart-1.0.1-demo.jar

In there you will see that JFreeChart can support multiple axes. The source code for these demos is only available when you buy the JFreeChart developer guide...it's an incentive to get people to support this project.

If you want to go ahead without the guide, you need to create a chart with two datasets and two renderers. Add a second range axis, then call mapDatasetToRangeAxis() to specify which dataset/renderer is using the additional axis.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked