I would like to create a contour plot and set it's initial dataset a null dataset (so it won't plot). Later in the program I need to get a set of data and plot it in the plot. The user will then be allowed to get new sets of data and plot these one at a time like this:
display plot with null dataset
user gets new data
plot new dataset
user gets new data
plot new dataset
etc..
All using the same original plot instance. I'm missing something (I have the manual but it didn't address a problem like this). I've created the plot but when I change the dataset how do I get the plot to replot using the new dataset?
changing data - or datasets
Re: changing data - or datasets
When you use the setDataset(...) method in the Plot class, it fires a PlotChangeEvent. The JFreeChart class receives this, and reacts by firing a ChartChangeEvent. If your chart is displayed in a ChartPanel, the panel receives the ChartChangeEvent and reacts by redrawing the chart.
If this doesn't happen, it is a bug.
Regards,
Dave Gilbert
If this doesn't happen, it is a bug.
Regards,
Dave Gilbert