unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, Series, StdCtrls, ExtCtrls, TeeProcs, Chart;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Series1: TPieSeries;
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Series1.Add(1+Random(10)); //pierwszy parametr funkcji Add to liczba losowa,
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if Series1.Count>0 then Series1.Delete(0);  //jeśli liczba danych na wykresie jest
                                            //większa od 0, to kasuj daną,
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Series1.Clear;  //zerowanie wszystkich danych dla Series1
end;

end.
