这个问题与我之前发布的关于这个主题的帖子有一定关联。
我想知道在ChartPanel构建完成后:
我想知道在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 panel = buildChart();
panel.getDataset; //I'm looking for a way to retrieve the dataset, or XYSeriesCollection..
这个有可能吗?有没有人能把我指引正确的方向?
提前感谢您。