[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/src/Examples/ -> ganttconstrainex2.php (source)

   1  <?php
   2  // Gantt example
   3  include  ("../jpgraph.php");
   4  include  ("../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  


Généré le : Sat Nov 24 09:27:55 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics