[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

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

File containing the ezcGraphRadarChart 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: 457 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphRadarChart:: (9 methods):
  __construct()
  setFromPalette()
  __set()
  drawRotatedAxis()
  renderData()
  getDefaultDisplayType()
  renderElements()
  render()
  renderToOutput()


Class: ezcGraphRadarChart  - X-Ref

Class for radar charts.
Can make use of an unlimited amount of datasets and will display them as
lines by default.
Rotation axis:
- Labeled axis
- Centered axis label renderer
Axis:
- Numeric axis
- radar axis label renderer

<code>
// Create a new radar chart
$chart = new ezcGraphRadarChart();

// Add data to line chart
$chart->data['sample dataset'] = new ezcGraphArrayDataSet(
array(
'100' => 1.2,
'200' => 43.2,
'300' => -34.14,
'350' => 65,
'400' => 123,
)
);

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

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

The type of the axis may be changed and all elements can be configured by
accessing them as properties of the chart:

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

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

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

param: array $options Default option array
return: void

setFromPalette( ezcGraphPalette $palette )   X-Ref
Set colors and border fro this element

param: ezcGraphPalette $palette Palette
return: void

__set( $propertyName, $propertyValue )   X-Ref
Property write access

param: string $propertyName Option name
param: mixed $propertyValue Option value;
return: void

drawRotatedAxis( ezcGraphChartElementAxis $axis, ezcGraphBoundings $boundings, ezcGraphCoordinate $center, $position, $lastPosition = null )   X-Ref
Draws a single rotated axis

Sets the axis label position depending on the axis rotation.

param: ezcGraphChartElementAxis $axis
param: ezcGraphBoundings $boundings
param: ezcGraphCoordinate $center
param: float $position
param: float $lastPosition
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

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 line 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