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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.1 KB
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
7//
8// The data for the graphs
9//
10$data = array(
11    array(0,ACTYPE_GROUP,    "Phase 1",        "2001-10-26","2001-11-23",''),
12    array(1,ACTYPE_NORMAL,   "  Label 2",      "2001-11-01","2001-11-20",''),
13    array(2,ACTYPE_NORMAL,   "  Label 3",      "2001-10-26","2001-11-03",''),
14    array(3,ACTYPE_MILESTONE,"  Phase 1 Done", "2001-11-23",'M2') );
15
16// The constrains between the activities
17$constrains = array(array(2,1,CONSTRAIN_ENDSTART),
18                    array(1,3,CONSTRAIN_STARTSTART));
19
20$progress = array(array(1,0.4));
21
22// Create the basic graph
23$graph = new GanttGraph();
24$graph->title->Set("Example with grouping and constrains");
25//$graph->SetFrame(false);
26
27// Setup scale
28$graph->ShowHeaders(GANTT_HYEAR | GANTT_HMONTH | GANTT_HDAY | GANTT_HWEEK);
29$graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR);
30
31// Add the specified activities
32$graph->CreateSimple($data,$constrains,$progress);
33
34// .. and stroke the graph
35$graph->Stroke();
36
37?>
38
39
Note: See TracBrowser for help on using the repository browser.