CLASS GanttGraph EXTENDS Graph
(Defined in: jpgraph_gantt.php : 61)
 GanttGraph  Graph 
 Add() 
 GanttGraph() 
 SetDateRange() 
 SetLabelVMarginFactor() 
 ShowHeaders() 
 Stroke() 
Add() 
 AddBand() 
 AddLine() 
 AddText() 
 AddY2() 
 AdjBackgroundImage() 
 AdjImage() 
 GetHTMLImageMap() 
 Graph() 
 SetAngle() 
 SetAxisStyle() 
 SetBackgroundImage() 
 SetBox() 
 SetColor() 
 SetFrame() 
 SetGridDepth() 
 SetMargin() 
 SetMarginColor() 
SetScale() 
 SetShadow() 
 SetTickDensity() 
 SetY2Scale() 
Stroke() 
 StrokeCSIM() 
 StrokeFrameBackground() 
 

Class usage and Overview
Create a Gantt graph. The Gantt graph can then be built up by adding activity bars and milestones.

 

See also related classes:
GanttBar, GanttVLine and MileStone

 


Class Methods

 

 

function Add(&$aObject)
Add a new Gantt object

ArgumentDefaultDescription
&$aObject  Gantt object to add

Description
Add a gantt object to the graph. A gantt object is an instance of either:  

Example

$vline = new GanttVLine("2002-02-28");
$vline->title->Set("2002-02-28");
$vline->title->SetFont(FF_FONT1,FS_BOLD,10);
$graph->Add($vline);

 

 

function GanttGraph($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline)
Create a new GanttGraph

ArgumentDefaultDescription
$aWidth 0 Width of graph
$aHeight 0 Height of graph
$aCachedName "" Filename to use if cache is enables
$aTimeOut 0 Timeout in minutes
$aInline true True=Stream back to browser

Description
Construct a new GanttGraph. This differs slightly from the standard Graph or PlotGraph in that you are not required to specify width and height of the graph. Instead these can be left out and will be automatically be determined.

As a further refinement you can just specify width and have the height be automtically determined.  
 

See also
Graph::Graph

Example

// Setup Gantt graph
$graph = new GanttGraph();
$graph->SetShadow();
$graph->SetBox();

// Only show part of the Gantt
$graph->SetDateRange('2001-11-22','2002-1-24');

 

 

function SetDateRange($aStart,$aEnd)
Specify date range for Gantt chart.

ArgumentDefaultDescription
$aStart  Start date
$aEnd  End date

Description
Specify the date range for Gantt graphs. If this is not set it will be automtically determined from the input data.

All gantt chart objects, like bar activities, will be clipped to the spcified date range should they happen to be wider then the specified range.

The date is specified as a normal date string according to the chosen locale.  

Example

$graph->SetDateRange('2001-11-22','2002-1-24');

 

 

function SetLabelVMarginFactor($aVal)
Set margin vertical factor.

ArgumentDefaultDescription
$aVal  Margin factor

Description
Specify the fraction of the font height that should be added as vertical margin between the labels. 

Example

$ganttgraph->SetLabelVMarginFactor(0.7);

 

 

function ShowHeaders($aFlg)
Determine what headers/scales to display.

ArgumentDefaultDescription
$aFlg  Logic OR of flags to specify what headers should be displayed.

Description
Specify what headers should be displayed on the Gantt charts. Possible headers are: To specify multiple header you just bitwise OR the wanted number of headers together.  

Example

// Show all headers
$graph->ShowHeaders(GANTT_HYEAR GANTT_HMONTH GANTT_HDAY GANTT_HWEEK);

 

 

function Stroke($aStrokeFileName)
Internal. Stroke the gantt chart.

ArgumentDefaultDescription
$aStrokeFileName "" Filename to stroke image to

Description
Internal. Stroke the gantt chart. If a filename is specified then the graph will be stroked to that file and will not be sent back to the browser.

This should as usual be the last method called in your script.  
 

See also
Graph::Stroke

Example

$ganttgraph->Stroke();