[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/element/ -> legend.php (summary)

File containing the abstract ezcGraphChartElementLegend 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: 339 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ezcGraphChartElementLegend:: (7 methods):
  __construct()
  __set()
  __get()
  generateFromDataSets()
  generateFromDataSet()
  calculateBoundings()
  render()


Class: ezcGraphChartElementLegend  - X-Ref

Class to represent a legend as a chart element

Chart elements can be understood as widgets or layout container inside the
chart. The actual transformation to images happens inside the renderers.
They represent all elements inside the chart and contain mostly general
formatting options, while the renderer itself might define additional
formatting options for some chart elments. You can find more about the
general formatting options for chart elements in the base class
ezcGraphChartElement.

The legend chart element is used to display the legend of a chart. It can be
deactivated by setting the legend to false, like:

<code>
$chart->legend = false;
</code>

The position of the legend in the chart can be influenced by the postion
property, set to one of the position constants from the ezcGraph base class,
like ezcGraph::BOTTOM, ezcGraph::LEFT, ezcGraph::RIGHT, ezcGraph::TOP.

Depending on the position of the legend, either the $portraitSize (RIGHT,
LEFT) or the $landscapeSize (TOP, BOTTOM) defines how much space will be
aqquired for the legend.

<code>
$graph = new ezcGraphPieChart();
$graph->data['example'] = new ezcGraphArrayDataSet( array(
'Foo' => 23,
'Bar' => 42,
) );

// Format the legend element
$graph->legend->background    = '#FFFFFF80';

// Place at the bottom of the chart, with a height of 5% of the remaining
// chart space.
$graph->legend->position      = ezcGraph::BOTTOM;
$graph->legend->landscapeSize = .05;

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

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

param: array $options Default option array
return: void

__set( $propertyName, $propertyValue )   X-Ref
__set

param: mixed $propertyName
param: mixed $propertyValue
return: void

__get( $propertyName )   X-Ref
__get

param: mixed $propertyName
return: mixed

generateFromDataSets( ezcGraphChartDataContainer $datasets )   X-Ref
Generate legend from several datasets with on entry per dataset

param: ezcGraphChartDataContainer $datasets
return: void

generateFromDataSet( ezcGraphDataSet $dataset )   X-Ref
Generate legend from single dataset with on entry per data element

param: ezcGraphDataSet $dataset
return: void

calculateBoundings( ezcGraphBoundings $boundings )   X-Ref
Calculated boundings needed for the legend.

Uses the position and the configured horizontal or vertical size of a
legend to calculate the boundings for the legend.

param: ezcGraphBoundings $boundings Avalable boundings
return: ezcGraphBoundings Remaining boundings

render( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings )   X-Ref
Render a legend

param: ezcGraphRenderer $renderer Renderer
param: ezcGraphBoundings $boundings Boundings for the axis
return: ezcGraphBoundings Remaining boundings



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