CLASS GanttBar EXTENDS GanttPlotObject
(Defined in: jpgraph_gantt.php : 3140)
 GanttBar  GanttPlotObject  
 GanttBar() 
 SetColor() 
 SetFillColor() 
 SetHeight() 
 SetPattern() 
 SetShadow() 
 
 

Class usage and Overview
This class represents each activity bar. The activity bars can then be added to a GanttChart vi the GanttGraph::Add()

 


Class Methods

 

 

function GanttBar($aPos,$aLabel,$aStart,$aEnd,$aCaption,$aHeightFactor)
Create a new activity bar.

ArgumentDefaultDescription
$aPos  Vertical position (row)
$aLabel  Text label
$aStart  Start date
$aEnd  End date
$aCaption "" Caption string for bar
$aHeightFactor 0.6 Height factor

Description
Create a new activity bar. An activity bar is created by specifyin :
  1. The row in gentt chart to draw the activity bar in
  2. Specify a label(titel) for the activity.
  3. A start date
  4. An end date
  5. A caption which is a string that gets stroked to the right of the activity bar.
  6. Height as either an asbolute value or as a fraction of the available row height.
 

Example

$bar = new GanttBar(4,"Group 2", "2001-11-30","2001-12-22","[5%]",10);

 

 

function SetColor($aColor)
Specify frame color for the activity bar

ArgumentDefaultDescription
$aColor  Color for gantt bar

Description
Specify frame color for the activity bar. 

Example

$bar->SetColor('orange');

 

 

function SetFillColor($aColor)
Specify fill color for activity bar.

ArgumentDefaultDescription
$aColor  Fill color

Description
Specify fill color for activity bar.

Note: It is perfectly possible to use both a background color as weel as a pattern.  

Example

$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");

 

 

function SetHeight($aHeight)
Set height for the bar.

ArgumentDefaultDescription
$aHeight  Height specification for bars

Description
Specify height of the activity bar. The height can be specified as either as fraction (0.0 to 1.0) or as an absolute value (1 to 200). In the first case the height is interpreted as the fraction of the row height and in the second case as an absolute height in pixels. 

Example

$bar->SetHeight(0.6);

 

 

function SetPattern($aPattern,$aColor,$aDensity)
Specify what pattern to use for the activity bars.

ArgumentDefaultDescription
$aPattern  Pattern specification
$aColor "blue" Pattern color
$aDensity 95 Density

Description
The following patterns are currently implemented:
  1. GANTT_RDIAG, Right diagonal lines
  2. GANTT_LDIAG, Left diagonal lines
  3. GANTT_SOLID, Solid one color
  4. GANTT_LVERT, Vertical lines
  5. GANTT_LHOR, Horizontal lines
  6. GANTT_VLINE, Vertical lines
  7. GANTT_HLINE, Horizontal lines
  8. GANTT_3DPLANE, A 3D plane
  9. GANTT_HVCROSS, Crosses
  10. GANTT_DIAGCROSS, Diagonal crosses
 
 
See also
Progress::SetPattern

Example

$bar->SetPattern(BAND_RDIAG,"yellow");
$bar->SetFillColor("red");

 

 

function SetShadow($aShadow,$aColor)
Add a drop shadow to the bar.

ArgumentDefaultDescription
$aShadow true True=Add drop shadow to bars
$aColor "gray" Colro fo shadow

Description
Add a drop shadow to the bar.  

Example

$bar->SetShadow();