1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
| <?php
$Id: ganttex30.php,v 1.4 2003/05/30 20:12:43 aditus Exp $
require_once ("jpgraph/jpgraph.php");
require_once ("jpgraph/jpgraph_gantt.php");
$graph = new GanttGraph();
$graph->SetShadow();
$graph->SetBox();
$graph->title->Set("General conversion plan");
$graph->subtitle->Set("(Revision: 2001-11-18)");
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
$graph->scale->week->SetFont(FF_FONT0);
$graph->scale->year->SetFont(FF_ARIAL,FS_BOLD,12);
$data = array(
array(0,"Group 1", "2001-10-29","2001-11-27",FF_FONT1,FS_BOLD,8),
array(1," Label 2", "2001-11-8","2001-12-14"),
array(2," Label 3", "2001-11-01","2001-11-8"),
array(4,"Group 2", "2001-11-07","2001-12-19",FF_FONT1,FS_BOLD,8),
array(5," Label 4", "2001-11-8","2001-12-19"),
array(6," Label 5", "2001-11-01","2001-11-8")
);
for($i=0; $i<count($data); ++$i) {
$bar = new GanttBar($data[$i][0],$data[$i][1],$data[$i][2],$data[$i][3],"[50%]",0.5);
if( count($data[$i])>4 )
$bar->title->SetFont($data[$i][4],$data[$i][5],$data[$i][6]);
$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");
$bar->progress->Set(0.5);
$bar->rightMark->SetType(MARK_FILLEDCIRCLE);
$bar->rightMark->SetFillColor("red");
$bar->rightMark->SetColor("red");
$bar->rightMark->SetWidth(10);
$bar->rightMark->title->Set("".$i+1);
$bar->rightMark->title->SetColor("white");
$bar->rightMark->title->SetFont(FF_ARIAL,FS_BOLD,10);
$bar->rightMark->Show();
$graph->Add($bar);
}
$ms = new MileStone(7,"M5","2001-12-10","10/12");
$ms->title->SetFont(FF_FONT1,FS_BOLD);
$graph->Add($ms);
$vl = new GanttVLine("2001-12-10 13:00","Phase 1","darkred");
$vl->SetDayOffset(0.5);
$graph->Add($vl);
$graph->Stroke();
?> |