[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

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

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

Defines 1 class

ezcGraphHorizontalBarChart:: (3 methods):
  __construct()
  renderData()
  setAxisValues()


Class: ezcGraphHorizontalBarChart  - X-Ref

Class for bar charts. Can make use of an unlimited amount of datasets and
will display them as bars by default.
X axis:
- Labeled axis
- Boxed axis label renderer
Y axis:
- Numeric axis
- Exact axis label renderer

<code>
// Create a new horizontal bar chart
$chart = new ezcGraphHorizontalBarChart();

// 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 the special designated renderer and default SVG driver
$chart->renderer = new ezcGraphHorizontalRenderer();
$chart->render( 500, 200, 'bar_chart.svg' );
</code>

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

The type of the axis may be changed and 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. As
bar charts extend line charts the the extended configure options are
available in {@link ezcGraphLineChartOptions} extending the
{@link ezcGraphChartOptions}.

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

param: array $options Default option array
return: void

renderData( ezcGraphRenderer $renderer, ezcGraphBoundings $boundings, ezcGraphBoundings $innerBoundings )   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

setAxisValues()   X-Ref
Aggregate and calculate value boundings on axis.

This function is nearly the same as in ezcGraphLineChart, but reverses
the usage of keys and values for the axis.

return: void



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