CLASS PieGraph EXTENDS Graph (Defined in: jpgraph_pie.php : 1117)

PieGraph | Graph
Add() PieGraph() SetAntiAliasing() SetColor() Stroke() |

Class usage and Overview
The canvas for use with PiePlots. You add pie plots by calling the Add() method.

You can add several PiePlots by adjusting their size and positioning each PiePlot so it doesn't overlap eachother.

See also related classes:
PiePlot and PiePlot3D

Class Methods

function Add($aObj)
Add object to the pie graph

Argument | Default | Description
--- | --- | ---
$aObj |  | Object to add

Description
Add a pieplots or text object to the pie graph. You can specify either a single object or an array. If you specify an array all object in the array must be of the same type.

Example

$piegraph = new PieGraph(300,400);
$pieplot = new PiePlot($ydata);
$piegraph->Add($pieplot);

function PieGraph($width,$height,$cachedName,$timeout,$inline)
//---------------// CONSTRUCTOR

Argument | Default | Description
--- | --- | ---
$width | 300 | Width of graph
$height | 200 | Height of graph
$cachedName | "" | Cache file name
$timeout | 0 | Cache timeout in s
$inline | 1 | Should the image be inline.

Description
See Graph::Graph()
See also
Graph::Graph

Example

$piegraph = new PieGraph(300,400);

function SetAntiAliasing($aFlg)
Enable/disable anti-alias for Pie Graphs

Argument | Default | Description
--- | --- | ---
$aFlg | true | true=enable anti-aliasing

Description
Enable/disable anti-alias for Pie Graphs. This makes for much nicer looking PieGraphs. Please note that enabling anti-alias imposes some restrictions:

- Enabling anti-alias will severely impact performance. As a rule of thumb you can expect drawing to take 5-8 times longer !
- You can't use background images or gradient backgrounds together with anti-alias

Example

$piegraph->SetAntiAlias();

function SetColor($c)
Set the background color. Synonym to SetMarginColor()

Argument | Default | Description
--- | --- | ---
$c |  | Color

Description
Set the background color. Synonym to SetMarginColor()
See also
Graph::Graph

Example

$piegraph->SetColor('gray');

function Stroke($aStrokeFileName)
// Method description

Argument | Default | Description
--- | --- | ---
$aStrokeFileName | "" | Filename

Description
Stroke the piegraph to the browser or to a specified file if specified. Works exactly the same as Graph::Stroke()

Example

...
$piegraph->Stroke()