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?
chart with dual axies measures
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
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
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
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.
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
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

