unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    Chart1: TChart;
    Series1: TBarSeries;
    Panel1: TPanel;
    imgKONIEC: TImage;
    procedure imgKONIECClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
   Series1.SetFunction(Nil);
	Action := caFree;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
	Series1.Add(-30, 'Styczeń');
   Series1.Add(-20, 'Luty');
   Series1.Add( 10, 'Marzec');
   Series1.Add( 12, 'Kwiecień');
   Series1.Add( 18, 'Maj');
   Series1.Add( 20, 'Czerwiec');
   Series1.Add( 27, 'Lipiec');
   Series1.Add( 32, 'Sierpień');
   Series1.Add( 20, 'Wrzesień');
   Series1.Add( 10, 'Październik');
   Series1.Add(  5, 'Listopad');
   Series1.Add(-12, 'Grudzień');
end;

procedure TForm2.FormDestroy(Sender: TObject);
begin
	Form2 := Nil;
end;

procedure TForm2.imgKONIECClick(Sender: TObject);
begin
	Close();
end;

end.
