CLASS PlotBand (Defined in: jpgraph_plotband.php : 542)

PlotBand
PlotBand() SetDensity() SetOrder() ShowFrame()

Class usage and Overview
A "Plotband" repesent a rectangualr area in the graph that can be given a specific pattern ranging from 3D grid to simple horizntal grid lines.

A Plot band is then added to the graph via the Graph::AddBand() method.

See also related classes:
Graph

Class Methods

function PlotBand($aDir,$aPattern,$aMin,$aMax,$aColor,$aWeight,$aDepth)
Create a new Plot band of the specified type

Argument | Default | Description
--- | --- | ---
$aDir |  | Direction of plot band
$aPattern |  | Type of pattern
$aMin |  | Min value for plot area
$aMax |  | Max value for plot area
$aColor | "black" | Color of pattern
$aWeight | 1 | Line weight
$aDepth | DEPTH_BACK | Depth. Over or under the plot.

Description
Create a new Plot band that later on can be added to the graph. The following pattern types are supported

- BAND_RDIAG, Right diagonal lines
- BAND_LDIAG, Left diagonal lines
- BAND_SOLID, Solid one color
- BAND_LVERT, Vertical lines
- BAND_LHOR, Horizontal lines
- BAND_VLINE, Vertical lines
- BAND_HLINE, Horizontal lines
- BAND_3DPLANE, "3D" Plane
- BAND_HVCROSS, Vertical/Hor crosses
- BAND_DIAGCROSS, Diagonal crosses

A plotband extends completely along one of the axis in the graph. This axis is determined by the first argument, the direction. Valid directions are

1. HORIZONTAL
2. VERTICAL

Example

$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$uband->ShowFrame(false);
$uband->SetDensity(50); // 50% line density
$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red");
$lband->ShowFrame(false);
$lband->SetDensity(20); // 20% line density
$graph->AddBand($uband);
$graph->AddBand($lband);

function SetDensity($aDens)
Specify density for pattern

Argument | Default | Description
--- | --- | ---
$aDens |  | Density [1,100]

Description
Specify density for pattern as an integer value between 1 and 100, 100 being very dense and 1 being very sparse.

Example

$uband=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$uband->ShowFrame(false);
$uband->SetDensity(50); // 50% line density
$lband=new PlotBand(HORIZONTAL,BAND_LDIAG,"min",0,"red");
$lband->ShowFrame(false);
$lband->SetDensity(20); // 20% line density
$graph->AddBand($uband);
$graph->AddBand($lband);

function SetOrder($aDepth)
Specify z-order parameter for plot

Argument | Default | Description
--- | --- | ---
$aDepth |  | Pattern Z-order parameter

Description
Specify if the pattern should be in front of plot or behind the plot. Valid parameters are

- DEPTH_BACK, Behind the plot
- DEPTH_FRONT, In front of the plot

Example

$band=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$band->ShowFrame(false);
$band->SetOrder(DEPTH_BACK);
$graph->AddBand($band);

function ShowFrame($aFlag)
Display frame around pattern

Argument | Default | Description
--- | --- | ---
$aFlag | true | True=Display border

Description
Display frame around pattern

Example

$band=new PlotBand(HORIZONTAL,BAND_RDIAG,0,"max","green");
$band->ShowFrame(false);
$band->SetOrder(DEPTH_BACK);
$graph->AddBand($band);