tags:

views:

284

answers:

1

I'm using a lineseries chart, but it gets fairly slow to re-render when I add a new point when the total # of points is ~1200 points. Granted, this is running on a fairly slow PC (~600 MHz). Reading the Flex documentation on how to speed up rendering (turning off dropshadows, turning off filterData, etc...) doesnt seem to help. I bound my chart to an ArrayCollection (rather than the array I used before which I manually updated) and it doesnt seem to be any faster. Adobe's documentation seems to have me believe that the Chart looks only at what changed since the last time it was updated, but i'm only adding one point! If their info is correct, why does it take significantly longer (5 seconds) to update one point when I have ~1200 points then when I only have 2 points (instantaneous)?

FYI - When I add a new point to my ArrayCollection, I have to do a "AC.refresh()" to get the DataBinding to pick up the new data. Any ideas on what I can do to speed up the process?

+1  A: 

Any drawing with 1200 points in flash/flex is going to perform slow when it redraws. When you add an extra point you invalidate the whole series. Once the chart is invalidated it redraws itself at the next available opportunity. This redraw will be slow. No way round this i'm afraid.

My point to you is, why do you need to display 1200 points on the chart at any one time. Anyone reaing this chart won't be able to take in all that information. If you need to be showing the trend of these points then you need to be changing the design so that it displays averages (as per Chris's comment). There are also other strategies you can use. If you take a look at the Fiat Eco Drive application we choose to only show a maximum range at any one time. So even though we could have hundreds or thousands of points, we only display a certain amount of them.

Lots of other strategies out there o deal with this and you really need to take another look at the chart design and then refactor the actual chart construction.

James Hay
WhatI have decided to do is rather than graph all of the values, split my data into 2 minute "chunks" and graph 2 points: the maximum value and minimum value in that "chunk". That way I can still see peaks and valleys in my data without having them lost due to averaging.
Seidleroni
nice one! Good choice
James Hay