Class Ticks
(Defined in: jpgraph.php : 3914)
 
 Ticks 
 SetColor() 
 SetFormatCallback() 
 SetLabelFormat() 
 SetSide() 
 SetSize() 
 SetWeight() 
 SupressFirst() 
 SupressLast() 
 SupressMinorTickMarks() 
 SupressTickMarks() 
 SupressZeroLabel() 
 

Class usage and Overview
This is the abstract base class for ticks. Specifying the common signature for both linear and logartihmic ticks. Ticks are normally a property of the scale and can be accessed via the $graph->scale->ticks property.

 


Class Methods

 

Ticks ::
SetColor($aMajorColor, $aMinorColor)
Set color for tick marks

ArgumentDefaultDescription
$aMajorColor  Major tick mark color
$aMinorColor '' Minor tick mark color

Description:
Specify tick mark colors. If no minor tick mark color is specified then it will be the same as the major tick marks color. 

Example:

$graph->yaxis->scale->ticks->SetColor('red','black');

 

Ticks ::
SetFormatCallback($aCallbackFuncName)
Specify a format callback function for labels

ArgumentDefaultDescription
$aCallbackFuncName  name of function

Description:
Specifies a callback function which will be called and given each tick label in turn as the argument. The callback function is supposed to return a proper formatted label to be displayed. Note: There is a shortcut to this method through the Axis::SetLabelFormatCallback. Note 2: The PHP function number_format() is often usefull in callback functions.  
 
See also:

Example:

// Callback function for Y-scale. Use money format with
// a ',' to separate 1000:s
function yScaleCallback($aVal) {
    return 
number_format($aVal);
}


// Short for $graph->yaxis->scale->ticks->SetFormatCallback()
$graph->yaxis->SetLabelFormatCallback('yScaleCallback');


 

Ticks ::
SetLabelFormat($aFormatString, $aDate)
Set format string for automatic labels

ArgumentDefaultDescription
$aFormatString  Specify a printf() style format string
$aDate FALSE No description available

Description:
Specify a printf() style format string. Note: Can also be called trough the shortcut Axis::SetLabelFormatString()  
 
See also:

Example:

$graph->yaxis->SetLabelFormatString("%-02.1f");

 

Ticks ::
SetSide($aSide)
Specify side of axis for ticks

ArgumentDefaultDescription
$aSide  Side

Description:
Synonym for SetDirection(). Specify what side of the axis the tick marks should be drawn on. For Y -axis the possible directions are and for X-axis the possible parameters are  
 
See also:

Example:

$graph->xaxis->scale->ticks->SetSide(SIDE_UP);

 

Ticks ::
SetSize($aMajSize, $aMinSize)
Specify absolute size of tick marks in pixels

ArgumentDefaultDescription
$aMajSize  Major tick size
$aMinSize 3 Minor tick size

Description:
Specify absolute size of tick marks in pixels 

Example:

$graph->xaxis->scale->ticks->SetSize(8,3);

 

Ticks ::
SetWeight($aWeight)
Specify width of tick marks

ArgumentDefaultDescription
$aWeight  Width (in pixels)

Description:
Specify width of tick marks 

Example:

$graph->xaxis->scale->ticks->SetWeight(2);

 

Ticks ::
SupressFirst($aHide)
Hide the first tick mark

ArgumentDefaultDescription
$aHide true True=Hide the vbery first tick mark on the axis

Description:
Hide the first tick mark on the axis. 
 
See also:

Example:

$graph->xaxis->scale->ticks->SupressFirst();

 

Ticks ::
SupressLast($aHide)
Hide the last tick mark

ArgumentDefaultDescription
$aHide true True=Hide the last tick mark

Description:
Hide the last tick mark on the axis 
 
See also:

 

Ticks ::
SupressMinorTickMarks($aHide)
Hide all minor tick marks

ArgumentDefaultDescription
$aHide true True=Hide minor tick marks

Description:
Hide all minor tick marks 

 

Ticks ::
SupressTickMarks($aHide)
Hide major tick marks

ArgumentDefaultDescription
$aHide true True=Hide major tick marks

Description:
Hide major tick marks 
 
See also:

 

Ticks ::
SupressZeroLabel($aFlag)
Don't display the first zero label

ArgumentDefaultDescription
$aFlag true True=Hide zero-label

Description:
Hide any label with numeric value == 0.0