Hello,
I have a bit of a dilemma with a Chart App. I'm working on. I have a chart with two series contained in a dataset. The first being a very long series(~100,000 points) and the second being a very coarse approximation of the first (~20 points). You can think of the second series as "sampling" the first.
However, I'm making modifications to the second series and updating the chart by using the following code:
dataset.addSeries("Series 2", series2Vals)
As per the API: this should simply replace the existing Series 2.
Although "Series 2" is very small (less than 20 points), I'm finding that the repaint time is very long, and I'm suspecting that "addSeries" is also repainting my first Series, which I do not want it to do.
My question: Is there anyway to have it only repaint the second Series to speed things up?
Thanks in advance.
Suggestions for Speeding Up Chart Repainting?
-
- Posts: 4
- Joined: Tue Feb 26, 2008 9:36 pm
-
- Posts: 4
- Joined: Tue Feb 26, 2008 9:36 pm
*EDIT*
I found the sticky on the "Fast plotting" classes so I'll investigate that to see if there's a solution in there.
I also did notice that enabling buffering in the Chart constructor sped things up a bit as well....and I disabled the tool tips.
Still, if anybody has a suggestion on how to update just one series faster, I'd appreciate it.
The more I think about it though, intuitively JFree would probably want to repaint everything anyways since it would have to account for overlapping series, etc.
I found the sticky on the "Fast plotting" classes so I'll investigate that to see if there's a solution in there.
I also did notice that enabling buffering in the Chart constructor sped things up a bit as well....and I disabled the tool tips.
Still, if anybody has a suggestion on how to update just one series faster, I'd appreciate it.
The more I think about it though, intuitively JFree would probably want to repaint everything anyways since it would have to account for overlapping series, etc.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
JFreeChart will always repaint the whole chart.
I wonder if you could plot your large series in an image (say, BufferedImage), then add that as a background image to the chart/plot? Although you'd run into some pixel scaling issues if the chart's data area changes in size (due to changes in the axis labelling, say, or a resize of the ChartPanel).
I wonder if you could plot your large series in an image (say, BufferedImage), then add that as a background image to the chart/plot? Although you'd run into some pixel scaling issues if the chart's data area changes in size (due to changes in the axis labelling, say, or a resize of the ChartPanel).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 4
- Joined: Tue Feb 26, 2008 9:36 pm