Blame view

site/jpgraph/Examples/multconstganttex01.php 873 Bytes
8ec98c9f   Guillaume   MAJ
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
  <?php // content="text/plain; charset=utf-8" 
  // Gantt example 
  require_once ('jpgraph/jpgraph.php'); 
  require_once ('jpgraph/jpgraph_gantt.php'); 
  
  // Create the basic graph 
  $graph = new GanttGraph(); 
  $graph->title->Set("Example with multiple constrains"); 
  
  $bar1 = new GanttBar(0, "Label 1", "2003-06-08", "2003-06-12"); 
  $bar2 = new GanttBar(1, "Label 2", "2003-06-16", "2003-06-19"); 
  $bar3 = new GanttBar(2, "Label 3", "2003-06-15", "2003-06-21"); 
  
  //create constraints 
  $bar1->SetConstrain(1, CONSTRAIN_ENDSTART); 
  $bar1->SetConstrain(2, CONSTRAIN_ENDSTART); 
  
  // Setup scale 
  $graph->ShowHeaders(/*GANTT_HYEAR | GANTT_HMONTH |*/ GANTT_HDAY | GANTT_HWEEK); 
  $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAYWNBR); 
  
  // Add the specified activities 
  $graph->Add($bar1); 
  $graph->Add($bar2); 
  $graph->Add($bar3); 
  
  // .. and stroke the graph 
  $graph->Stroke(); 
  
  ?>