Line chart wraps when data is added

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
reef
Newbie
Newbie
Posts: 2
Joined: Wed Mar 08, 2006 12:00 am

Line chart wraps when data is added

Post by reef » Fri Sep 28, 2007 5:11 pm

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....

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Oct 01, 2007 9:21 am

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;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply