0
我正在使用jfreechart來顯示折線圖。我想用同一個圖形顯示另一個線圖。誰能告訴我該怎麼做? 在此先感謝如何使用jfreechart將兩個線圖組合成一個圖?
我正在使用jfreechart來顯示折線圖。我想用同一個圖形顯示另一個線圖。誰能告訴我該怎麼做? 在此先感謝如何使用jfreechart將兩個線圖組合成一個圖?
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);
然後,我們可以得到這樣的圖表圖形。
謝謝我會試試這個 – macroAbc 2011-03-30 06:34:42
嘿抱歉,但這是行不通的,你可以給我提供一些不同的解決方案... – macroAbc 2011-04-01 06:13:15
@Sac_yew:http://www.java2s.com/Code/Java/Chart/JFreeChartMultipleDatasetDemo1.htm可能會有所幫助。 – RollingBoy 2011-04-01 06:24:24