DBChart中series的动态添加问题. 满分求教!!!
在DBChart中动态添加series,添加后只有最后一次添加的series能正常显示,其他的都不在DBChart上显示出来.
源码:
procedure TMDIChild.AddLine;
var
MySeries: TFastLineSeries;
begin
MySeries := TfastLineSeries.Create(self);
Myseries.ParentChart := MyDBChart;
MySeries.Active := false;
Myseries.DataSource := mydatamodule.CurveAQ;
Myseries.XLabelsSource := '监测时间';
Myseries.YValues.ValueSource := '计算值';
MySeries.Active := true;
end;
调用:
begin
for i :=1 to sencombo.Items.Count-1 do
begin
//sql search first. and draw lines.
str := 'select * from table where A = '''+sencombo.Items.Strings [i]+''''+'and Time < #2004-3-29#';
with mydatamodule,CurveAQ do begin
Close;
SQL.Clear;
SQL.add(str);
Active := true;
end;
addline;
end;
end