10
Jul
03

1000 points in 500 pixels

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.

Download example source code.


7 Responses to “1000 points in 500 pixels”


  1. 1 Don Park Jul 10th, 2003 at 7:52 pm

    Hi Sam,

    Skipping works but you can’t blind skip because you might skipover abrupt changes. Averaging doesn’t quite work either since you’ll misrepresent true range of those abrupt changes.

  2. 2 Sam Jul 11th, 2003 at 11:16 am

    Good point. If you skip over outliers you can change the chart but with this many points it’s less likely–really depends on the type of data being represented. Another mechanism would be to find the hi and low within your range and use those points for plotting–that should correct the issue.

  3. 3 bk May 4th, 2004 at 11:06 am

    If you enter *.5 instead of a whole number you get a neat effect =)

    Also, don’t enter zero whatever you do — that’s what got me started.

  4. 4 dexatrim Oct 29th, 2004 at 3:10 pm

    Hello there,

    Iwas browsing the web and found this blog. Some interesting quotes. Keep them coming!

    Alice
    dexatrim

  5. 5 personal loans lender Nov 2nd, 2004 at 2:17 pm

    Hello there,

    Iwas browsing the web and found this blog. Some interesting quotes. Keep them coming!

    Alice
    personal loans lender

  6. 6 Flexeril Nov 3rd, 2004 at 3:27 am

    Hi, You should check out Flexeril

  7. 7 Bob Staple Nov 17th, 2004 at 2:55 am

    Guten Tag - Hier ist ein sehr schooner Site. Cheap Staples

    Danke!
    Bob Staple

Comments are currently closed.