Repaint problems

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Gaurav Kathotia

Repaint problems

Post by Gaurav Kathotia » Fri May 10, 2002 2:09 pm

Hello
I am using JFreeeChart-0.8.1 to construct a verticalBarchart and a TimeSeriesChart(both together but not CombinedPlot).Unlike BasicTimeSeries, where i just do series.add --(and the chart repaints itself) , for my verticalBarChart --i create a new DefaultCategoryDataset with the new set of data .
The problem is that when i try to remove the earlier verticalBarChart and plot this new VerticalBarChart( with a new CategoryDataset) and then explicitly call repaint(), this doesn't seem to work.A blank panel results which is because i call the remove() method for the JFreeChartPanel containing the previous JFreeChart(verticalBarChart).

Any suggestions on how to achieve this repaint() functionality explicitly without JFreechart
having to take care of that.

Thanks in advance
Gaurav Kathotia

David Gilbert

Re: Repaint problems

Post by David Gilbert » Tue May 14, 2002 10:05 am

Hi Gaurav,

I think from reading later posts that you have already solved this, but for others that are reading this, you can just change the dataset for the chart with the setDataset(...) method. The existing chart panel should update automatically.

Regards,

DG.

Locked