2011-03-30 125 views

回答

1
JFreeChart chart = ... //Get the chart with your first dataset. 
CategoryPlot plot = chart.getCategoryPlot(); 
plot.setDataset(1, anotherDataset); //The '1' at the first parameter is 
            //the index of dataset. 
            //Thus, '1' for the second dataset. 
... //some other settings to the plot, with index=1. 
plot.setRenderer(1, someRenderer); 

然后,我们可以得到这样的图表图形。

+0

谢谢我会试试这个 – macroAbc 2011-03-30 06:34:42

+0

嘿抱歉,但这是行不通的,你可以给我提供一些不同的解决方案... – macroAbc 2011-04-01 06:13:15

+0

@Sac_yew:http://www.java2s.com/Code/Java/Chart/JFreeChartMultipleDatasetDemo1.htm可能会有所帮助。 – RollingBoy 2011-04-01 06:24:24

相关问题