With JFreeChart, the complete chart will always be redrawn when an event is fired from the underlying dataset, irrespective of whether the chart is embedded within a JScrollPane
or not.
This is particularly noticeable if your chart contains a large number of datapoints and is updated frequently. There are some "kludges" you can attempt you make your UI more responsive; e.g.
- If you underlying dataset is updated (e.g.
SeriesDataset
) you could delay firing a SeriesChangeEvent
if the chart is not currently being displayed.
- Similarly you could throttle multiple updates by only periodically firing
SeriesChangeEvent
every N seconds rather than on every event, the obvious downside being that your UI is less "real-time".