[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

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

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

Defines 1 class

ezcGraphOdometerChart:: (7 methods):
  __construct()
  __set()
  renderData()
  getDefaultDisplayType()
  renderElements()
  render()
  renderToOutput()


Class: ezcGraphOdometerChart  - X-Ref

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

<code>
$graph = new ezcGraphOdometerChart();
$graph->title = 'Custom odometer';

$graph->data['data'] = new ezcGraphArrayDataSet(
array( 87 )
);

// Set the marker color
$graph->data['data']->color[0]  = '#A0000055';

// Set colors for the background gradient
$graph->options->startColor     = '#2E3436';
$graph->options->endColor       = '#EEEEEC';

// Define a border for the odometer
$graph->options->borderWidth    = 2;
$graph->options->borderColor    = '#BABDB6';

// Set marker width
$graph->options->markerWidth    = 5;

// Set space, which the odometer may consume
$graph->options->odometerHeight = .7;

// Set axis span and label
$graph->axis->min               = 0;
$graph->axis->max               = 100;
$graph->axis->label             = 'Coverage  ';

$graph->render( 400, 150, 'custom_odometer_chart.svg' );
</code>

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

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

<code>
$chart->title->position = ezcGraph::BOTTOM;
</code>

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

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

param: array $options Default option array
return: void

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

param: string $propertyName Option name
param: mixed $propertyValue Option value;
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 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