AddXY Troubles
Posted: Tue Nov 14, 2006 6:57 pm
Hi,
I am using the AddXY method to load series dynamically with data from TMS AdvStringGrid. It loads the data ok, but the values at the beginning of the plot are not correct. I tried doing arrays but because my charts and series are unknown at design time, I cant really seem to load the data the same as using the AddXY method.
Has anyone else experienced strange data plots using AddXY?
Heres an idea of what my code looks like:
thanks,
Tom
I am using the AddXY method to load series dynamically with data from TMS AdvStringGrid. It loads the data ok, but the values at the beginning of the plot are not correct. I tried doing arrays but because my charts and series are unknown at design time, I cant really seem to load the data the same as using the AddXY method.
Has anyone else experienced strange data plots using AddXY?
Heres an idea of what my code looks like:
Code: Select all
Procedure getChartdata(grid: TAdvColumnGrid; ChartPanel: TTeePreviewPanel; mychart: Array of TChart; check: TOfficeHintCheckBoxXP);
Var
mycol,myrow: Integer;
idx,i : integer;
begin
for idx := 0 to Charts-1 do
begin
for mycol := 0 to grid.TotalColCount-1 do
begin
s := grid.Cells[mycol,startrow-1];
for myrow := startrow to endrow do
begin
xser := grid.Floats[0,myrow];
yser := grid.Floats[mycol,myrow];
mychart[idx].Series[mycol].AddXY(xser,yser,s);
end;
end;
if check.Checked = True then
begin
mychart[idx].Title.Caption := run + ' ' + filename + ' ' + grid.Cells[0,2] + grid.cells[1,2];
end
else
mychart[idx].Title.Caption := run + ' ' + filename;
mychart[idx].Axes.Bottom.LabelStyle:=talValue;
end;
end;
thanks,
Tom