2011-03-30 60 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

相關問題