CLASS GanttScale (Defined in: jpgraph_gantt.php : 1834)

GanttScale

SetDateLocale()
SetRange()
SetTableTitleBackground()
SetVertLayout()
SetWeekStart()
UseWeekendBackground()

Class usage and Overview
Internal class to represent the scale used for Gantt graphs. The scale is accessible as GanttGraph::scale The following public available subobjects are available

- tableTitle (Instance of class TextProperty)
- divider (Instance of class LineProperty)
- actinfo (Instance of class GanttActivityInfo)
- year (Instance of HeaderProperty)
- month (Instance of HeaderProperty)
- week (Instance of HeaderProperty)
- day (Instance of HeaderProperty)
- hour (Instance of HeaderProperty)
- minute (Instance of HeaderProperty)

See also related classes:
GanttGraph, HeaderProperty, GanttActivityInfo and TextProperty

Class Methods

function SetDateLocale($aLocale)
Specify locale to use for scale.

Argument | Default | Description
--- | --- | ---
$aLocale |  | String to specify locale

Description
Specify locale to use for scale. If no locale is specified then the default locale for the installed system will be used.
See also
DateLocale::DateLocale

Example

$ganttgraph->scale->SetDateLocale('US_en');

function SetRange($aMin,$aMax)
Specify date range for scale.

Argument | Default | Description
--- | --- | ---
$aMin |  | Min date
$aMax |  | Max date

Description
Specify scale min and max date either as timestamp or as date strings. Always round to the nearest week boundary

Example

$ganttgraph->scale->SetRange("2002-11-23", "2003-03-31");

function SetTableTitleBackground($aColor)
Specify background for the table title area.

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

Description
Specify background for the table title area (upper left corner of the table).

Example

$ganttgraph->scale->SetTableTitleBackground('lightblue');

function SetVertLayout($aLayout)
Specify the vertical layout fro rows.

Argument | Default | Description
--- | --- | ---
$aLayout |  | Vertical layout parameter

Description
Should the layout be from top or even. Valid parameters are

- GANTT_EVEN, Spread out the rows even over the whole height of the plot.
- GANTT_FROMTOP, Use the minimum height required for the rows starting from top.

Note that if you use auto-sizing of the Gantt chart these parameters have little effect since the total height of the image will always be so that all rows fit exactly.

Example

$granntgraph->scale->SetVertLayout(GANTT_FROMTOP);

function SetWeekStart($aStartDay)
Specify which weekday should start the week

Argument | Default | Description
--- | --- | ---
$aStartDay |  | Weekday, (0-6)

Description
Which day should the week start? 0==Sun, 1==Monday, 2==Tuesday etc By default weeks start on Mondays.
See also
GanttScale::SetRange

Example

$granttgraph->SetWeekStart(1);

function UseWeekendBackground($aShow)
Determine if the background color for weekends in the scale should extend down in the plot area.

Argument | Default | Description
--- | --- | ---
$aShow |  | True=Use the weekend background color in the ganttgraph

Description
Determine if the background color for weekends in the scale should extend down in the plot area.

Example

$ganttgraph->scale->USeWeekendBackground();