source: trunk/xgraph/jpgraph/Examples/multconstganttex01.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 903 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2// Gantt example
3require_once ('jpgraph/jpgraph.php'); 
4require_once ('jpgraph/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?>
Note: See TracBrowser for help on using the repository browser.