Page 1 of 1
Add point at the end of the serie
Posted: Tue Mar 08, 2005 9:42 am
by 9339785
Hi,
I want to add new X,Y points at the end of a serie. So I tried the function AddXY() ..... but it does not work correctly because this function insert points and not add points at the end of the serie.
Is there a function which I could used to do it simply ?
Thanks!
Franck
Posted: Tue Mar 08, 2005 9:46 am
by narcis
Hi Franck,
Yes, you can use Series.Add(...). This method inserts new Series points when you do not have an X Value for the point. The new point added with the Add method only has Y values. The X values are automatically calculated (sequential index of 0,1,2,3,4..etc).
Posted: Tue Mar 08, 2005 12:00 pm
by 9339785
I can't use the function Series.Add(...) because I must add points with X and Y defined by a previous function. Is there any other solution ?
Franck
Posted: Thu Mar 10, 2005 7:27 am
by Marjan
I can't use the function Series.Add(...) because I must add points with X and Y defined by a previous function. Is there any other solution ?
I'd use AddXY method to add point with specific (x,y) coordinate. The AddXY method does *not* insert a point in the chartlist(s) arrays, but it adds it to the end of the array. But if your newly added point x value is smaller than maximum x value then the end result (on screen) will be your newly added point won't be connected to it's predecessor. To fix this problem (override default behavoir), all you must do is set series XValues.Order property to loNone *before* you start adding points to series. In this case the points will be connected in the same order as they are added to series:
Code: Select all
// draw parametric plot
Series1.XValues.Order := loNone;
Series1.AddXY(2,3);
Series1.AddXY(1,5);
Series1.AddXY(2.3,3);
Series1.AddXY(2.2,-1);