I am plotting a simple Histogram, and what I would like to do is to update the graph as new data is obtained. The updates are never frequent, and so there's no need for any flashy, super-fast dynamic stuff.
At the moment I'm creating a dataset....
Code: Select all
public IntervalXYDataset makeIntervalXYDataset() {
HistogramDataset dataset = new HistogramDataset();
return dataset;
}
Code: Select all
public ChartPanel MakeErrorsHistogramChart(IntervalXYDataset dataset) {
JFreeChart chart = ChartFactory.createHistogram(
"",
null,
null,
dataset,
PlotOrientation.VERTICAL,
true,
false,
false
);
chart.getXYPlot().setForegroundAlpha(0.75f);
final ChartPanel panel = new ChartPanel(chart);
return panel;
};
So, does anyone know of a way to update a Histogram, other than to make a completely new graph?
Cheers,
Arwel