CLASS Grid
(Defined in: jpgraph.php : 1989)
 Grid 
 SetColor() 
 SetLineStyle() 
 SetWeight() 
 Show() 
 

Class usage and Overview
This class is used to hold all properties of the gridline for a specific axis. The grid setting is accessed through the xgrid and ygrid properties of graph. By default JpGraph has grid lines for Y-lines turned on and gridlines for X-axis turned off.

 


Class Methods

 

 

function SetColor($aColor)
Set color of grid lines

ArgumentDefaultDescription
$aColor  Color

Description
Set color of grid lines 

Example

$graph->xgrid->SetColor('lightblue');

 

 

function SetLineStyle($aType)
Specify if grid line should be dashed, dotted or solid

ArgumentDefaultDescription
$aType  String to specify line type

Description
Specify if grid should be dashed, dotted or solid. The type is specified with a string which can be either "solid", "dashed" or "dotted".  
 
See also
Image::SetLineStyle

Example

$graph->ygrid->SetLineStyle('dashed');

 

 

function SetWeight($aWeight)
Set line weight for grid line

ArgumentDefaultDescription
$aWeight  Line width in pixels

Description
Set line weight for grid line 

Example

$graph->xgrid->SetWeight(2);

 

 

function Show($aShowMajor,$aShowMinor)
Specify if both major and minor grid should be displayed

ArgumentDefaultDescription
$aShowMajor true True=Show major grid lines
$aShowMinor false True=Show minor grid lines

Description
Specify if both major and minor grid should be displayed 

Example

$graph->ygrid->Show();