unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Button1: TButton;
    Series1: TGanttSeries;
    Button2: TButton;
    Button3: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    zad0, zad1,zad2, zad22, zad3, zad4, zad5,zad6: Longint;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
zad0:=Series1.AddGantt(EncodeDate(2010,06,14 ), EncodeDate( 2010,07,10 ),
                               0, 'Rejestracja dzialalnosci gosp.' );

zad1:=Series1.AddGantt(EncodeDate( 2010,07,26 ), EncodeDate(2010,09,04),
                               1, 'Zalatwienie kredytu');

zad2:=Series1.AddGantt(EncodeDate(2010,09,06 ), EncodeDate( 2010,10,02 ),
                               2,'Kupno budynków' );

zad3:=Series1.AddGantt(EncodeDate( 2010,10,04 ), EncodeDate(2010,11,06),
                               3, 'Adaptacja budynków');

zad4:=Series1.AddGantt(EncodeDate( 2010,10,10 ), EncodeDate(2010,11,06),
                               4, 'Zakup maszyn i urządzeń');

zad5:=Series1.AddGantt(EncodeDate( 2010,11,10 ), EncodeDate(2010,11,25),
                               5, 'Przeprowadzenie rozmów kwalifikacyjnych');

zad6:=Series1.AddGantt(  EncodeDate( 2010,11,27 ), EncodeDate(2010,11,30),
                               6, 'Zatrudnienie pracowników');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Series1.ConnectingPen.Visible:=true;
  Series1.ConnectingPen.Color:=clRed;

  Series1.NextTask[zad0]:= zad1;
  Series1.NextTask[zad1]:= zad2;
  Series1.NextTask[zad2]:= zad3;
  Series1.NextTask[zad2]:= zad4;
  Series1.NextTask[zad4]:= zad5;
  Series1.NextTask[zad3]:= zad5;
  Series1.NextTask[zad5]:= zad6;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
   Series1.Pointer.VertSize:=10;
end;

end.
