Hi,
I first want to tell you how impressed i fill from the progress of this package. One year ago I used it for a project and then I had to write many of the features I needed by myself (like zooming etc.). Now I see it got much more stable and full of features, comparable with any commercial package.
Now the important part. Besides my job as software engineer I spend some time working on a scientific project at an university (I have master degree in physics). So we are writing now a signal generator, that should generate the values for 100 000 or more points for each signal and then we need to visualize this. I decided to use JFreeCharts, and I easily wrote a XYDatasource that did the job. The problem is that it creates 2 objects (Double, for the x and y axes) for each point and if there are 100 000 points this is not the best way. Besides the repainting of the chart takes quite a long time even if nothing actually changed (while moving the window for example). So my question is, if there is an easy and optimized way to do this.
Best regards,
Plamen
Charts with hundrets of thousands of points
Re: Charts with hundrets of thousands of points
Hi Plamen,
There is a class in the distribution called FastScatterPlot - this class is not a complete working class, but it shows how you could plot data directly from an array of doubles, by passing the dataset interface. This is faster, but you don't have the opportunity to extend the data values.
Moving a window shouldn't generate a chart redraw, since by default the ChartPanel class maintains an offscreen image of the chart and just redraws the image when the window is moved. Resizing the window will cause the whole chart to be redrawn, and that will not be fast for 100000 points.
If you have suggestions for improving the performance of JFreeChart, please post them here...
Regards,
Dave Gilbert
There is a class in the distribution called FastScatterPlot - this class is not a complete working class, but it shows how you could plot data directly from an array of doubles, by passing the dataset interface. This is faster, but you don't have the opportunity to extend the data values.
Moving a window shouldn't generate a chart redraw, since by default the ChartPanel class maintains an offscreen image of the chart and just redraws the image when the window is moved. Resizing the window will cause the whole chart to be redrawn, and that will not be fast for 100000 points.
If you have suggestions for improving the performance of JFreeChart, please post them here...
Regards,
Dave Gilbert
Re: Charts with hundrets of thousands of points
Plamen,
I posted some sample code here some 2 or 3 weeks ago which was partly inspired by David's FastScatterPlot. I found it quite easy to improve the performance by a factor of 6, and I suspect that even more is possible.
Search the "phorum" archive for "Subject" keywords such as "performance", "speed", "tardiness", "slow" .
Irv Thomae
I posted some sample code here some 2 or 3 weeks ago which was partly inspired by David's FastScatterPlot. I found it quite easy to improve the performance by a factor of 6, and I suspect that even more is possible.
Search the "phorum" archive for "Subject" keywords such as "performance", "speed", "tardiness", "slow" .
Irv Thomae
Re: Charts with hundrets of thousands of points
Hi Irv,
Thanks for that, I'd forgotten about it (have been working on JFreeReport lately). I did a search for "Irv" in the Author field, and found your post here:
http://www.object-refinery.com/phorum-3 ... 866&t=5866
Regards,
DG
Thanks for that, I'd forgotten about it (have been working on JFreeReport lately). I did a search for "Irv" in the Author field, and found your post here:
http://www.object-refinery.com/phorum-3 ... 866&t=5866
Regards,
DG