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
| <?php
require_once("jpgraph/jpgraph.php");
require_once("jpgraph/jpgraph_gantt.php");
$graph = new GanttGraph();
$graph->SetMarginColor('gray:1.7');
$graph->SetColor('white');
$graph->title->Set("Example of column fonts");
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->ShowHeaders(GANTT_HDAY | GANTT_HMONTH| GANTT_HYEAR);
$graph->scale->actinfo->SetColTitles( array('Name','Start','End'),array(100));
$graph->scale->actinfo->SetFont(FF_ARIAL,FS_BOLD,11);
$data = array(
array(0,'Group 1', '2001-11-27','2001-12-05'),
array(1,' Activity 1', '2001-11-27','2001-11-29'),
array(2,' Activity 2', '2001-11-28','2001-12-05'),
array(3,'Group 2', '2001-11-29','2001-12-10'),
array(4,' Activity 1', '2001-11-29','2001-12-03'),
array(5,' Activity 2', '2001-12-01','2001-12-10'),
);
$n = count($data);
for($i=0; $i < $n; ++$i) {
if( $i === 0 || $i === 3 ) {
$bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.35);
$bar->title->SetColumnFonts(array(array(FF_ARIAL,FS_BOLD,11)));
$bar->leftMark->SetType( MARK_LEFTTRIANGLE );
$bar->leftMark->Show();
$bar->rightMark->SetType( MARK_RIGHTTRIANGLE );
$bar->rightMark->Show();
$bar->SetFillColor('black');
$bar->SetPattern(BAND_SOLID,'black');
}
else {
$bar = new GanttBar($data[$i][0],array($data[$i][1],$data[$i][2],$data[$i][3]),$data[$i][2],$data[$i][3],'',0.45);
$bar->SetPattern(BAND_RDIAG,'black');
$bar->SetFillColor('orange');
}
$bar->title->SetFont(FF_ARIAL,FS_NORMAL,10);
$graph->Add($bar);
}
$graph->Stroke();
?> |