Page 1 of 1

Add multiple data points in the middle of series

Posted: Mon Mar 10, 2008 2:38 pm
by 10047047
Hi,

I want to add a numbe of data points (or a section of data) in the middle of the data series. Is there a function similar to the Delete(ValueIndex1, ValueIndex2) to fast add multiple points in the middle of the data series by a single call?

Regards

Xia

Posted: Mon Mar 10, 2008 2:41 pm
by narcis
Hi Xia,

I'm afraid not, you'll need to add them individually.

Posted: Mon Mar 10, 2008 2:54 pm
by 10047047
Hi Narcis,

So I have to shift the data series from the insert point to the end of the data series (TDataSeries->Count()) by a numbe of points to be inserted, and then call AddXY() to add individual data. This could be quite slow processing when having a large amount of data and data to be inserted at the beginning. Would it be fast to prepare the data in a separate data array and then use AddArray() function?

Thanks.

Xia

Posted: Mon Mar 10, 2008 3:22 pm
by narcis
Hi Xia,

You may not need to shift data, just use AddXY method for add values where you want and then use FillSequence method as described here.

Hope this helps!