unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, ExtCtrls, TeeProcs, TeEngine, Chart, Series, GanttCh,
TeeComma, StdCtrls;
type
TForm1 = class(TForm)
Chart1: TChart;
SpeedButton1: TSpeedButton;
Series1: TGanttSeries;
TeeCommander1: TTeeCommander;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
Var
tmp1,tmp2,tmp3 : Longint;
begin
Series1.Clear;
tmp1 := Series1.AddGanttColor( EncodeDate( 2008, 1,1 ),
EncodeDate( 2008, 1,31 ),
10,
'任务1',
clBlue );
tmp2 := Series1.AddGanttColor( EncodeDate( 2008, 3,1 ),
EncodeDate( 2008, 3,31 ),
9,
'任务2',
clYellow );
tmp3 := Series1.AddGanttColor( EncodeDate( 2008, 4,1 ),
EncodeDate( 2008, 4,30 ),
2,
'任务3',
clRed );
Series1.NextTask[ tmp1 ]:= tmp2 ;
Series1.NextTask[ tmp2 ]:= tmp3 ;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
Var
tmp1,tmp2,tmp3 : Longint;
begin
Series1.Clear;
tmp1 := Series1.AddGantt( EncodeDate( 2008, 1,1 ),
EncodeDate( 2008, 1,31 ),
11.3,
'任务1' );
tmp2 := Series1.AddGantt( EncodeDate( 2008, 1,1 ),
EncodeDate( 2008, 1,11 ),
10,
'任务2');
tmp3 := Series1.AddGantt( EncodeDate( 2008, 4,1 ),
EncodeDate( 2008, 4,30 ),
78,
'任务3' );
Series1.NextTask[ tmp1 ]:= tmp2 ;
Series1.NextTask[ tmp2 ]:= tmp3 ;
end;
end.
本文出自 “601880” 博客,谢绝转载!