Page 1 of 1

Line chart wraps when data is added

Posted: Fri Sep 28, 2007 5:11 pm
by 9345581
I have an application where I enter X-Y data into a chart, say X goes from 0 to 1023, then I repeat (X starts again at 0 and goes to 1023), but a line is drawn from the X,Y point at X=1023 to the X,Y point at 0 even though I use change the existing value of Y (using ...->XValue[1023] = 1023 followed by... ->XValue[0] = 0). Any way I can keep this from happening as I get a LOT of horizontal lines across the screen....

Posted: Mon Oct 01, 2007 9:21 am
by narcis
Hi reef,

Yes, you can avoid this adding a null point at the end of each line, for example:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i,j: Integer;
begin
  Series1.XValues.Order:=loNone;
  for i:=0 to 5 do
  begin
    for j:=0 to 1023 do
      Series1.AddXY(j,i);

    Series1.AddNullXY(j,i);
  end;
end;