|
Solution:
|
By escaping the
standard Add (AddXY) method, using a simple trick, a big speed increase is possible. The
whole trick is using TChartValueList directly.{ this is a trick necessary... }
type TMyList=class(TChartValueList)
end;
This trick is independent of using dynamic arrays or not. This
project shows how to speed up adding many points to a Series. It has most sense when used
with a FastLine series in 2D mode, but can speed also the rest of series.
But, there are some disadvantages when using this new
"Add-fast" (see the comments in the source code ) The advantage of gaining speed
has also some (minor) disavantadges:
- You should calculate the "X" position for each point ( This
is normally the "Count" of Series points )
- The Series "OnBeforeAdd" event is not triggered.
- Points cannot have Colors or text Labels.( The text and color
parameters of the normal Add method are not used. )
- If the Series is the DataSource of other Series or Functions, then
adding points in the "fast way", will not recalculate the functions. You can do
so after adding points: Series1.RefreshSeries
|