The question of plotting a line graph with thousands of data points came up again today. This always puzzled me; if your chart is only 500 pixels wide, why would you try to draw a chart with 1000 points? It would leave only half a pixel for each point. Flash is kewl but it won’t render half pixels and even if it did, rendering 1000 lines in Flash is a little slow.
The quick option we discovered was to skip data points. For most data you can skip anywhere from 2 to 10 points and the chart won’t change. Skipping points not only speeds up rendering but it can also result in a cleaner chart.
Take a look at the following example that renders a closing stock value over four years, 1130 data points. You can change the number of records to skip at runtime and see the change in the chart and rendering time.
By skipping 5 or 10 points you can dramatically decrease the amount of time to render the chart and improve the clarity by reducing clutter.
This example was done with a slightly modified version of the original Flash Charting Components from Macromedia since they’re freely available. The concept and code works the same for our B-Line Charting Components 2.0 and DRK4 Charting Components.