现在可以运行了,我又调整了一下。有几个问题想解决。
1、用random生成随机数,并且用TIMER触发执行时,下一事件过程画线时,上次画的线还存在,一会就满了,怎解决?我用refresh,没效果。
2、图表右边的序列是什麽属性,本来只添加三条线,运行时,一直自动加,为何?
能否去掉该列?
3、能否这样理解,series1在计算上是一组数,在图表上是一条线?
谢谢
procedure TForm1.FormShow(Sender: TObject);
begin
//cht1.BottomAxis.Automatic:= False;
//cht1.BottomAxis.Maximum := 100;
//cht1.BottomAxis.Minimum := 0;
//cht1.LeftAxis.Automatic := False;
//cht1.LeftAxis.Maximum := 100.0;
end;
procedure TForm1.Tmr1Timer(Sender: TObject);
var
//fstlnsrsSeries1:TFastLineSeries;
//fstlnsrsSeries2:TFastLineSeries;
//fstlnsrsSeries3:TFastLineSeries;
i:integer;
begin
//Inc(Number);
randomize;
fstlnsrsSeries1 := TFastLineSeries.Create(Cht1);
fstlnsrsSeries2 := TFastLineSeries.Create(Cht1);
fstlnsrsSeries3 := TFastLineSeries.Create(Cht1);
Cht1.AddSeries(fstlnsrsSeries1);
Cht1.AddSeries(fstlnsrsSeries2);
Cht1.AddSeries(fstlnsrsSeries3);
for i:=1 to 100 do
begin
fstlnsrsSeries1.Addxy(i,2*i,'',clred);
fstlnsrsSeries2.Addxy(random(100),random(100),'',clblack);
fstlnsrsSeries3.Addxy(i,2*i+3,'',clgreen);
end;
{if Number > 100 then
begin
cht1.BottomAxis.Maximum := Number;
cht1.BottomAxis.Minimum := Number - 100;
end;
}
end;
end.
[
本帖最后由 yalewang 于 2010-7-21 01:21 编辑 ]