简单演示
---------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TeEngine, Series, ExtCtrls, TeeProcs, Chart, ComCtrls;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TFastLineSeries;
Button1: TButton;
StatusBar1: TStatusBar;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
var
i:integer;
bTrue:boolean;
procedure TForm1.Button1Click(Sender: TObject);
var
pValue:Real;
begin
if bTrue=false then
begin
i:=i+1;
if i>19 then
begin
bTrue:=true;
end;
end
else
series1.Delete(0);
pValue:=random(10000000000000000);
series1.AddXY(now,pValue);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
i:=0;
bTrue:=false;
end;
end.