[ Index ]
 

Code source de jpGraph 2.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

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

   1  <?php
   2  include  ("../jpgraph.php");
   3  include  ("../jpgraph_gantt.php");
   4  
   5  $graph = new GanttGraph(0,0,"auto");
   6  $graph->SetShadow();
   7  
   8  // Add title and subtitle
   9  $graph->title->Set("A nice main title");
  10  $graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
  11  $graph->subtitle->Set("(Draft version)");
  12  
  13  // Show day, week and month scale
  14  $graph->ShowHeaders(GANTT_HDAY | GANTT_HWEEK | GANTT_HMONTH);
  15  
  16  // Instead of week number show the date for the first day in the week
  17  // on the week scale
  18  $graph->scale->week->SetStyle(WEEKSTYLE_FIRSTDAY);
  19  
  20  // Make the week scale font smaller than the default
  21  $graph->scale->week->SetFont(FF_FONT0);
  22  
  23  // Use the short name of the month together with a 2 digit year
  24  // on the month scale
  25  $graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR2);
  26  
  27  // Format the bar for the first activity
  28  // ($row,$title,$startdate,$enddate)
  29  $activity = new GanttBar(0,"Project","2001-12-21","2002-02-20");
  30  
  31  // Yellow diagonal line pattern on a red background
  32  $activity->SetPattern(BAND_RDIAG,"yellow");
  33  $activity->SetFillColor("red");
  34  
  35  // Finally add the bar to the graph
  36  $graph->Add($activity);
  37  
  38  // ... and display it
  39  $graph->Stroke();
  40  ?>


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