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
Drawing lines between gaps in series data
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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.
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 |
Instructions - How to post in this forum |