unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Chart1: TChart;
    Series1: TBarSeries;
    Series2: TBarSeries;
    Series3: TLineSeries;
    TeeFunction1: TSubtractTeeFunction;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
  Series1.Clear;
  Series2.Clear;
  for i:=1 to 5 do
  begin
     Series1.Add(Random(100));
     Series2.Add(Random(50));
  end;
  Series3.SetFunction(TSubtractTeeFunction.Create(Self));

end;

end.
