给你看我的一段源码//取数部分 while not TQuery(FindComponent('Q' + inttostr(i))).Eof do begin VXY[j].y := TQuery(FindComponent('Q' + inttostr(i))).fieldbyname('Quantity').AsFloat; VXY[j].x := TQuery(FindComponent('Q' + inttostr(i))).Fields[1].AsString; if TuName.ItemIndex > 0 then VXY[j].year := TQuery(FindComponent('Q' + inttostr(i))).Fields[2].AsInteger; inc(j); TQuery(FindComponent('Q' + inttostr(i))).Next; end;//画线部分 for k := 0 to j - 1 do Series.Add(VXY[k].y, VXY[k].x); Series.Active := true;
begin
VXY[j].y := TQuery(FindComponent('Q' + inttostr(i))).fieldbyname('Quantity').AsFloat;
VXY[j].x := TQuery(FindComponent('Q' + inttostr(i))).Fields[1].AsString;
if TuName.ItemIndex > 0 then VXY[j].year := TQuery(FindComponent('Q' + inttostr(i))).Fields[2].AsInteger;
inc(j);
TQuery(FindComponent('Q' + inttostr(i))).Next;
end;//画线部分
for k := 0 to j - 1 do Series.Add(VXY[k].y, VXY[k].x);
Series.Active := true;