| 1 |
lars |
1 |
<?php
|
|
|
2 |
// Gantt example
|
|
|
3 |
include ("../jpgraph.php");
|
|
|
4 |
include ("../jpgraph_gantt.php");
|
|
|
5 |
|
|
|
6 |
// Create the basic graph
|
|
|
7 |
$graph = new GanttGraph();
|
|
|
8 |
$graph->title->Set("Example with multiple constrains");
|
|
|
9 |
|
|
|
10 |
$bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12");
|
|
|
11 |
$bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19");
|
|
|
12 |
$bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21");
|
|
|
13 |
|
|
|
14 |
//create constraints
|
|
|
15 |
$bar1->SetConstrain(1, CONSTRAIN_ENDSTART);
|
|
|
16 |
$bar1->SetConstrain(2, CONSTRAIN_ENDSTART);
|
|
|
17 |
|
|
|
18 |
// Setup scale
|
|
|
19 |
$graph->ShowHeaders(/*GANTT_HYEAR | GANTT_HMONTH |*/ GANTT_HDAY | GANTT_HWEEK);
|
|
|
20 |
$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
|
|
|
21 |
|
|
|
22 |
// Add the specified activities
|
|
|
23 |
$graph->Add($bar1);
|
|
|
24 |
$graph->Add($bar2);
|
|
|
25 |
$graph->Add($bar3);
|
|
|
26 |
|
|
|
27 |
// .. and stroke the graph
|
|
|
28 |
$graph->Stroke();
|
|
|
29 |
|
|
|
30 |
?>
|