CLASS GanttActivityInfo (Defined in: jpgraph_gantt.php : 142)

GanttActivityInfo

Hide()
SetBackgroundColor()
SetColor()
SetColTitles()
SetColumnMargin()
SetFont()
SetFontColor()
SetHeaderAlign()
SetStyle()
Show()

Class usage and Overview
This class is responsible for handling the titles of the columns in the left section of the Gantt graph, i.e. the information columns for each activity.

It is instantiated in the scale and is accessed through the Gantt scale for example as in

`$graph->scale->actinfo->SetColTitles( array('Note','Name','Duration','Start','Finish'),array(30,100)); $graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5'); $graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10); $graph->scale->actinfo->vgrid->SetStyle('solid'); $graph->scale->actinfo->vgrid->SetColor('gray');`

It is optional to use titles for the columns, so if you don't want to use titles you never have to add the above lines to a Gantt graph (but it sure looks nicer if you do ... )

Class Methods

function Hide($aF)
Hide titles

Argument | Default | Description
--- | --- | ---
$aF | true | TRUE=Hide titles

Description
Hide titles

Example

// Hide the titles
$graph->scale->actinfo->Hide();

function SetBackgroundColor($aColor)
Specify backgound color for titles

Argument | Default | Description
--- | --- | ---
$aColor |  | Color specification

Description
Specify backgound color for titles

Example

$graph->scale->actinfo->SetBackgroundColor('green:0.5@0.5');

function SetColor($aColor)
Specify color of vertical dividers between each title column

Argument | Default | Description
--- | --- | ---
$aColor |  | Color specification

Description
Specify color of vertical dividers between each title column

Example

$graph->scale->actinfo->SetColor('navy');

function SetColTitles($aTitles,$aWidth)
Specify texts to be used as titles

Argument | Default | Description
--- | --- | ---
$aTitles |  | Array of titles
$aWidth | null | Optional width for each column

Description
Specify texts to be used as titles. The columns automatically becoms wide enough to hold the widest text in any columns. However you can also specify a specific width of each column by supplying an array of widths. However, the width can never be made smaller than the width of the texts, just larger.

It is perfectly legal to just specify the explicit width of the first few columns and have the rest of them become automatically sized. See eamplebelow.

Example

// Specify some titles and explicitely set the size of the
// first two columns.
$graph->scale->actinfo->SetColTitles(
array('Note','Name','Duration','Start','Finish'),array(30,100));

function SetColumnMargin($aLeft,$aRight)
Specify extra margin to the left and right of the text in each column

Argument | Default | Description
--- | --- | ---
$aLeft |  | Left margin (in pixels)
$aRight |  | Right margin (in pixels)

Description
Specify extra margin to the left and right of the text in each column

Example

$graph->scale->actinfo->SetColumnMargin(30,30);

function SetFont($aFFamily,$aFStyle,$aFSize)
Specify title font

Argument | Default | Description
--- | --- | ---
$aFFamily |  | Font family
$aFStyle | FS_NORMAL | Font style
$aFSize | 10 | Font size

Description
Specify title font

Example

$graph->scale->actinfo->SetFont(FF_ARIAL,FS_NORMAL,10);

function SetFontColor($aFontColor)
Specify title font color

Argument | Default | Description
--- | --- | ---
$aFontColor |  | Color specification

Description
Specify title font color

Example

$graph->scale->actinfo->SetFontColor('navy');

function SetHeaderAlign($aAlign)
Adjust headers left, right or centered

Argument | Default | Description
--- | --- | ---
$aAlign |  | Header alignment

Description
Adjust headers left, right or centered. By default headers are centered.

Example

$graph->scale->actinfo->SetHeaderAlign('left');

function SetStyle($aStyle)
Enable 3D header style

Argument | Default | Description
--- | --- | ---
$aStyle |  | 1=3D style

Description
Enable 3D header style. This is enabled by default.

Example

// No 3D style for titles
$graph->scale->actinfo->SetStyle(0);

function Show($aF)
Show titles

Argument | Default | Description
--- | --- | ---
$aF | true | TRUE=Show headers

Description
Show titles. If you specify titles they are by default displayed.
See also
GanttActivityInfo::Hide

Example

// Hide the titles
$graph->scale->actinfo->Show(false);