Drawing lines between gaps in series data

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sigipa
Newbie
Newbie
Posts: 2
Joined: Tue Apr 05, 2005 4:00 am

Drawing lines between gaps in series data

Post by sigipa » Fri May 13, 2005 12:26 am

Hello All,

I am new to charting so please forgive me if this is an obvious question. I have a case where I need to do two line series in the same chart. I have a line of base data that has values by and for every date. I need to do another line series that does not have values for every date. I want each of the points on the second series to connect, skipping the dates without data where they exist. Is there a way to accomplish this?


Thanks,
-S

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

Post by Narcís » Fri May 13, 2005 8:12 am

Hello sigipa,

Yes, you can add values to the series that doesn't have a value for every date using AddXY method and just skipping those non-existing values. Have a look at the code below, this snippet will add 11 values to Series1 and will only add a value to Series2 when i mod 2 = 0.

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Randomize;

  for i:=0 to 10 do
  begin
    Series1.AddXY(i,random(100));
    if i mod 2 = 0 then
      Series2.AddXY(i,random(100));
  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