2
include ("../jpgraph.php");
3
include ("../jpgraph_gantt.php");
5
$graph = new GanttGraph(0,0,"auto");
9
// Add title and subtitle
10
$graph->title->Set("Example of captions");
11
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
12
$graph->subtitle->Set("(ganttex14.php)");
14
// Show day, week and month scale
15
$graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
18
// Use the short name of the month together with a 2 digit year
20
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
21
$graph->scale->month->SetFontColor("white");
22
$graph->scale->month->SetBackgroundColor("blue");
24
// 0 % vertical label margin
25
$graph->SetLabelVMarginFactor(1);
27
// Format the bar for the first activity
28
// ($row,$title,$startdate,$enddate)
29
$activity = new GanttBar(0,"Project","2001-12-21","2002-01-07","[50%]");
31
// Yellow diagonal line pattern on a red background
32
$activity->SetPattern(BAND_RDIAG,"yellow");
33
$activity->SetFillColor("red");
35
// Set absolute height
36
$activity->SetHeight(10);
38
// Specify progress to 60%
39
$activity->progress->Set(0.6);
41
// Format the bar for the second activity
42
// ($row,$title,$startdate,$enddate)
43
$activity2 = new GanttBar(1,"Project","2001-12-21","2002-01-02","[30%]");
45
// Yellow diagonal line pattern on a red background
46
$activity2->SetPattern(BAND_RDIAG,"yellow");
47
$activity2->SetFillColor("red");
49
// Set absolute height
50
$activity2->SetHeight(10);
52
// Specify progress to 30%
53
$activity2->progress->Set(0.3);
56
// Finally add the bar to the graph
57
$graph->Add($activity);
58
$graph->Add($activity2);
60
// Add a vertical line
61
$vline = new GanttVLine("2001-12-24","Phase 1");
62
$vline->SetDayOffset(0.5);
63
//$graph->Add($vline);