4
此问题部分与此主题的my previous post有关。检索仅具有ChartPanel参考的数据集(Java + JFreeChart)
我想知道ChartPanel已建成之后:
public ChartPanel buildChart(){
XYSeriesCollection dataset = new XYSeriesCollection();
...
FreeChart chart = ChartFactory.createXYLineChart("line chart example",
"X", "Y", dataset, PlotOrientation.VERTICAL, true, true, false);
ChartPanel chartPanel = new ChartPanel(chart);
return chartPanel;
}
我可以取回用于生成图表,但只有到chartPanel一个参考的数据集?
ChartPanel panel = buildChart();
panel.getDataset; //I'm looking for a way to retrieve the dataset, or XYSeriesCollection..
这可能吗?有人能让我走向正确的方向吗?
由于事先
这是一个相关的[示例](http://stackoverflow.com/questions/5522575/how-can-i-update-a-jfreecharts-appearance-after-its-been-made-visible)。 – trashgod
+1:非常感谢。 – Heisenbug