CLASS PolarGraph EXTENDS Graph (Defined in: jpgraph_polar.php : 639)

PolarGraph | Graph

PolarGraph()
Set90AndMargin()
SetDensity()
SetPlotSize()
SetScale()
SetType()
Stroke()

Class usage and Overview
Represent a polar graph. Accessible properties are

- axis, An instance of PolarAxis() use to manipulate apperance of both radius and angle axis in the graph.

See also related classes:
PolarAxis

Class Methods

function PolarGraph($aWidth,$aHeight,$aCachedName,$aTimeOut,$aInline)
Construct a new graph

Argument | Default | Description
--- | --- | ---
$aWidth | 300 | Width (in pixels)
$aHeight | 200 | Height (in pixels)
$aCachedName | "" | Cache name
$aTimeOut | 0 | Cache timeout
$aInline | true | Inline flag (DEPRECATED)

Description
Construct a new Polar Graph. This is completely analog to the standard Graph() creation and follows the exactly same pattern.

Example

$polargraph = new PolarGraph(300,500);

function Set90AndMargin($lm,$rm,$tm,$bm)
Rotate the polar graph 90 degrees

Argument | Default | Description
--- | --- | ---
$lm | 0 | Left margin
$rm | 0 | Right Margin
$tm | 0 | Top margin
$bm | 0 | Bottom margin

Description
Rotate the polar graph 90 degrees

Example

$polargraph->Set90AndMargin(40,40,40,40);

function SetDensity($aDense)
Specify density for the radius axis

Argument | Default | Description
--- | --- | ---
$aDense |  | Density

Description
This is analog to the density specification for the X, and Y-scale s for the standard X-Y-plots. This specifies how close the autoscaling algorithm will place the tick marks to each other. The tick density can be one of

- TICKD_DENSE, Dense tick layout
- TICKD_NORMAL, Normal tick layout
- TICKD_SPARSE, Sparse tick layout (few tick marks)
- TICKD_VERYSPARSE, Very Sparse tick layout (very few tick marks)

By default the radius density os set to TICKD_DENSE

Example

// Slightly fewer ticks than default
$polargraph->SetDensity(TICKD_NORMAL);

function SetPlotSize($w,$h)
Alternative way to specify size of the plot area

Argument | Default | Description
--- | --- | ---
$w |  | Width
$h |  | Height

Description
You can specify the plot area size an posiion in the graph in two ways. The frst is the standard way of specifying the margins on the sides with SetMargins() method. This method centers a plot area with the specified width and height inthe middle of the graph, it is basically a short form for SetMargins( $graphwidth-($w/2),$graphwidth-($w/2), $graphheight-($h/2),$graphheight-($h/2));

Example

$polargraph->SetPlotSize(200,250);

function SetScale($aScale,$rmax)
Specify scale type (linear or log)

Argument | Default | Description
--- | --- | ---
$aScale |  | Linear "lin" or logarithmic "log" scale
$rmax | 0 | Manual maximum value

Description
Specify scale type (linear or log) for the radius scale. A linear scale is specified as 'lin' and a logarithmic scale is specified as 'log'

Example

// Specify a logarithmic scale for the radius
$polargraph->SetScale('log');

function SetType($aType)
Specify if the graphs should be 360 or 180

Argument | Default | Description
--- | --- | ---
$aType |  | Type

Description
Specify if the polargraph should be a full 360 degrees or just 180 degrees. The possible values for type are

- POLAR_360, A full 360 polar plot
- POLAR_180, A half 180 polar plot

By default the graph is a full 260 degrees.

Example

$polargraph->SetType(POLAR_360);

function Stroke($aStrokeFileName)
Send graph back to browser or file

Argument | Default | Description
--- | --- | ---
$aStrokeFileName | "" | File name

Description
Send a graph back to browser or to a file. This must be the last call in your script.

Example

$polargraph->Stroke();