CLASS HeaderProperty
(Defined in: jpgraph_gantt.php : 390) Class usage and Overview
Data encapsulating class to hold properties for each type of the scale headers of the Gantt chart.
It is instantiated in (and accessible through)
$ganttgraph->scale->day
$ganttgraph->scale->week
$ganttgraph->scale->month
$ganttgraph->scale->year
Class Methods
function SetBackgroundColor($aColor)
Specify background color in scale
Argument | Default | Description |
$aColor
| | Color |
Description
Specify background color in scale
$ganttgraph->scale->week->SetBackgroundColor('lightblue');
function SetFont($aFFamily,$aFStyle,$aFSize)
Specify font for scale
Argument | Default | Description |
$aFFamily
| | Font family |
$aFStyle
|
FS_NORMAL
| Font style |
$aFSize
|
10
| Font size |
Description
Specify font for scale
$ganttgraph->scale->week->SetFont(FF_FONT0);
function SetFontColor($aColor)
Specify font (text) color
Argument | Default | Description |
$aColor
| | Color |
Description
Specify font (text) color
$ganttgraph->scale->week->SetFontColor('darkred');
function SetFrameColor($aColor)
Set color of frame around scale
Argument | Default | Description |
$aColor
| | Color |
Description
Set color of frame around scale
$ganttgraph->scale->year->SetFrameCOlor('darkblue');
function SetFrameWeight($aWeight)
Specify width of frame around scale
Argument | Default | Description |
$aWeight
| | Width in pixels |
Description
Specify width of frame around scale
$ganttgraph->scale->year->SetFrameWeight(2);
function SetLabelFormatString($aStr)
Specify format string for use in scale
Argument | Default | Description |
$aStr
| | printf() style format string |
Description
Specify format string for use in scale.
$ganttgraph->scale->week->SetLabelFormatString('week %d');
function SetStyle($aStyle)
Specify style of scale.
Argument | Default | Description |
$aStyle
| | Scale style |
Description
Specifies how the week and month scale should appear. For year and day scale this method has no meaning.
For week scale:
- WEEKSTYLE_WNBR, Show the numeric week number
- WEEKSTYLE_FIRSTDAY, Show the date for the first day in the week
- WEEKSTYLE_FIRSTDAY2, Show the date for the first day variant 2
For month scale:
- MONTHSTYLE_SHORTNAME, Use short form of month name
- MONTHSTYLE_LONGNAME, Use long form of month name
- MONTHSTYLE_LONGNAMEYEAR2, Show long month nmame with a 2 digit year
- MONTHSTYLE_SHORTNAMEYEAR2, Show short month nmame with a 2 digit year
- MONTHSTYLE_LONGNAMEYEAR4, Show long month nmame with a 4 digit year
- MONTHSTYLE_SHORTNAMEYEAR4, Show short month nmame with a 4 digit year
$graph->scale->month->SetStyle(MONTHSTYLE_SHORTNAMEYEAR4);
function SetSundayFontColor($aColor)
Only used by day scale. Specify font color for sunday.
Argument | Default | Description |
$aColor
| | Color |
Description
Only used by day scale. Specify font color for sunday. The default is toi display Sundays in red color as per convention.
See also
GanttScale::UseWeekendBackground
$ganttgraph->SetSundayFontColor('red');
function SetTitleVertMargin($aMargin)
Specify margin above and below text in scale
Argument | Default | Description |
$aMargin
| | Margin in pixels |
Description
Specify margin above and below text in scale
$ganttgraph->scale->year->SetTitleVertMargin(7);
function SetWeekendColor($aColor)
Only valid if if used by day scale
Argument | Default | Description |
$aColor
| | Background color for the weekend |
Description
Specify the background color for weekends.
Tip: If you want the weekend background color to continue down the gantt chart theh use the GanttScale::UseWeekendBackground() method.
See also
HeaderProperty::SetSundayFontColor and GanttScale::UseWeekendBackground
$ganttgraph->scale->day->SetWeekendColor('lightgray');