Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JFreeChart in scrollpane

I'm having a big graph created with jfreechart. This chart is too big for the screen, so I would like to put it in a scrollpane. However, when using the scrollbar, the complete graph is redrawn everytime, which makes it extremely slow. Is there a solution for this?

thanks,

Bart

like image 950
Fortega Avatar asked May 17 '26 11:05

Fortega


1 Answers

Buffer it yourself. Render the JFreeChart in a panel that is not on a visible panel and use that as your buffer to the panel that is in the scrollpane. Then you can control the repaint events and how often you sync the two panels.

like image 122
Kelly S. French Avatar answered May 18 '26 23:05

Kelly S. French