CLASS IconImage
(Defined in: jpgraph_gantt.php : 1434)
 IconImage 
 IconImage() 
 SetAlign() 
 

Class usage and Overview
Icon object to be used in a title for a Gantt plot object, e.g. bar or milestones.

The icons are then used exactly as you would use text strings when specifying a title for the gantt object. For example: $icon = new IconImage(GICON_WARNING,0.7); $titles = array($icon,'65 days','3 Aug','5 sep'); $bar = new GanttBar(0,$titles,$startdat,$enddate); ...

Hint: When using icons togehter with titles the height of each bar is not affected (by design!) of the icons height. If you are using icons in several rows it might therefore be usefull to increase the vertical margin factor between each row. This is done by a call to the method GanttGarph::SetVMarginFactor()

 


Class Methods

 

 

function IconImage($aIcon,$aScale)
Create a new icon for use in Gantt title columns

ArgumentDefaultDescription
$aIcon  Icon specification. Either an image file or one of the builtin icons
$aScale 1 Scale of icon

Description
Create a new icon object to be used in a title for a Gantt plot object, e.g. bar or milestones.

An icon can either be created from an arbitrary image file (type is determined by the file extension) or it can also be one of the builtin icons. The builtin icons are:

A graphic illustration of the differenmt icons can be found in the manual.

The second argument specifies an optional scaling factor for the image/builtin icon.

The icons are then used exactly as you would use text strings when specifying a title for the gantt object. For example: $icon = new IconImage(GICON_WARNING,0.7); $titles = array($icon,'65 days','3 Aug','5 sep'); $bar = new GanttBar(0,$titles,$startdat,$enddate); ...

Hint: When using icons togehter with titles the height of each bar is not affected (by design!) of the icons height. If you are using icons in several rows it might therefore be usefull to increase the vertical margin factor between each row. This is done by a call to the method GanttGarph::SetVMarginFactor() 
 

See also
GanttGraph::SetVMarginFactor

Example

// Creating an icon from an image file and scaling it to 70%
// of original size
$icon = new IconImage("smiley.png",0.7);

// Using on of the bultin icons
$icon = new IconImage(GICON_TEXT,0.8);

 

 

function SetAlign($aX,$aY)
Specify anchor point for icon

ArgumentDefaultDescription
$aX 'left' Horizontal anchor point
$aY 'center' Vertical anchor point

Description
Specify where the anchor point for the icon should be. valid anchor points (for both hor and ver - directions) are: The anchor points determines what position on the icon shoudl be aligned with the specifed x,y position for the icon.  

Example

$icon = new IconImage("../smiley.png",0.7);
$icon->SetAlign('center','center');