unit SsnGr;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  GraphBaseSt, TeEngine, Series, GanttCh, ActnList, Placemnt, ExtCtrls,
  TeeProcs, Chart, ComCtrls, ToolWin;

type
  TfmSsnGr = class(TfmGraphBaseSt)
    Series1: TGanttSeries;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmSsnGr: TfmSsnGr;

implementation

uses Data;

{$R *.DFM}

procedure TfmSsnGr.FormCreate(Sender: TObject);
var
 i : integer;
begin
  inherited;
  with Series1 do
  begin
    for i:=0 to snl.Count-1 do
    with snl[i] do
    begin
      if DayStop>=DayStart then
         AddGantt(DayStart + DateBase -1 ,
                  DayStop  + DateBase -1 ,
                  i,
                  Description)
      else
      begin
        AddGantt(DateBase -1 ,
                 DayStop  + DateBase -1 ,
                 i,
                 Description);
        AddGantt(DateBase + DayStart - 1 ,
                 DateBase + 364,
                 i,
                 Description)
      end;
    end;
  end;
end;

end.
