[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/charts/ -> pie.php (summary)

File containing the ezcGraphPieChart class

Copyright: Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
License: http://ez.no/licenses/new_bsd New BSD License
Version: 1.5
File Size: 308 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphPieChart:: (7 methods):
  __construct()
  renderData()
  getDefaultDisplayType()
  applyThreshold()
  renderElements()
  render()
  renderToOutput()


Class: ezcGraphPieChart  - X-Ref

Class for pie charts. Can only use one dataset which will be dispalyed as a
pie chart.

<code>
// Create a new pie chart
$chart = new ezcGraphPieChart();

// Add data to line chart
$chart->data['sample dataset'] = new ezcGraphArrayDataSet(
array(
'one' => 1.2,
'two' => 43.2,
'three' => -34.14,
'four' => 65,
'five' => 123,
)
);

// Render chart with default 2d renderer and default SVG driver
$chart->render( 500, 200, 'pie_chart.svg' );
</code>

Each chart consists of several chart elements which represents logical
parts of the chart and can be formatted independently. The pie chart
consists of:
- title ( {@link ezcGraphChartElementText} )
- legend ( {@link ezcGraphChartElementLegend} )
- background ( {@link ezcGraphChartElementBackground} )

All elements can be configured by accessing them as properties of the chart:

<code>
$chart->legend->position = ezcGraph::RIGHT;
</code>

The chart itself also offers several options to configure the appearance.
The extended configure options are available in
{@link ezcGraphPieChartOptions} extending the {@link ezcGraphChartOptions}.

__construct( array $options = array()   X-Ref
Constructor

param: array $options Default option array
return: void

renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings )   X-Ref
Render the assigned data

Will renderer all charts data in the remaining boundings after drawing
all other chart elements. The data will be rendered depending on the
settings in the dataset.

param: ezcGraphRenderer $renderer Renderer
param: ezcGraphBoundings $boundings Remaining boundings
return: void

getDefaultDisplayType()   X-Ref
Returns the default display type of the current chart type.

return: int Display type

applyThreshold()   X-Ref
Apply tresh hold

Iterates over the dataset and applies the configured tresh hold to
the datasets data.

return: void

renderElements( $width, $height )   X-Ref
Renders the basic elements of this chart type

param: int $width
param: int $height
return: void

render( $width, $height, $file = null )   X-Ref
Render the pie chart

Renders the chart into a file or stream. The width and height are
needed to specify the dimensions of the resulting image. For direct
output use 'php://stdout' as output file.

param: int $width Image width
param: int $height Image height
param: string $file Output file
return: void

renderToOutput( $width, $height )   X-Ref
Renders this chart to direct output

Does the same as ezcGraphChart::render(), but renders directly to
output and not into a file.

param: int $width
param: int $height
return: void



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7