Z
zcjohnson
Unregistered / Unconfirmed
GUEST, unregistred user!
这是个在TIMER里面写的,结果就是,TCHART没有画线的效果,感觉是我移动坐标和画线可能是先后顺序出错吧?高手能指点一下吗?分不多了,全部献出
procedure TdataForm.tmr1Timer(Sender: TObject);
begin
with chtYSZD.BottomAxisdo
begin
Automatic:=False;
SetMinMax(IncMinute(Now,-1),Now);
end;
with ADOqryRealdo
begin
Close;
SQL.Clear;
SQL.Add('select DecTime,ComYSZD from RealData');
Open;
while not Eofdo
begin
dt:=FieldByName('DecTime').AsDateTime;
sdt:=FormatDateTime('YY/MM/DD HH:MM:SS',dt);
YSZD:=FieldByName('ComYSZD').AsString;
SerYSZD.AddXY(dt,StrToFloat(YSZD),Copy(sdt,10,8),clRed);
Next;
end;
end;
end;
procedure TdataForm.tmr1Timer(Sender: TObject);
begin
with chtYSZD.BottomAxisdo
begin
Automatic:=False;
SetMinMax(IncMinute(Now,-1),Now);
end;
with ADOqryRealdo
begin
Close;
SQL.Clear;
SQL.Add('select DecTime,ComYSZD from RealData');
Open;
while not Eofdo
begin
dt:=FieldByName('DecTime').AsDateTime;
sdt:=FormatDateTime('YY/MM/DD HH:MM:SS',dt);
YSZD:=FieldByName('ComYSZD').AsString;
SerYSZD.AddXY(dt,StrToFloat(YSZD),Copy(sdt,10,8),clRed);
Next;
end;
end;
end;