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