Repainting the chart without loosing zoom

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mattiksi
Posts: 1
Joined: Tue Mar 08, 2011 2:40 pm
antibot: No, of course not.

Repainting the chart without loosing zoom

Post by mattiksi » Tue Mar 08, 2011 2:47 pm

Hi. I just started using JFreeChart in my project and I'm loving it!

I have this one problem; My data is constantly changed so I have to repaint the chart like every two seconds. I also need zooming and that works great. However, when data is changed and I call repaint manually, I will loose my zoom (the chart is restored to the default scale).

I think that this can be fixed pretty easily by taking all the information about current view state (zoom) and after repainting putting the values back to the chart. I tinkered with this for a few hours and I can't get it to work.
Could someone please tell me what values I should get from the chart before repainting and how can I restore my previous zoom.

Thanks for a reply in advance! :)

Locked