[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

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

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

Defines 1 class

ezcGraphLineChart:: (12 methods):
  __construct()
  __get()
  __set()
  setFromPalette()
  calculateStepWidth()
  renderData()
  getDefaultDisplayType()
  checkRenderer()
  setAxisValues()
  renderElements()
  render()
  renderToOutput()


Class: ezcGraphLineChart  - X-Ref

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

<code>
// Create a new line chart
$chart = new ezcGraphLineChart();

// 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, 'line_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} )
- 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.
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

__get( $propertyName )   X-Ref
__get

param: mixed $propertyName
return: mixed

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

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

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

param: ezcGraphPalette $palette Palette
return: void

calculateStepWidth( ezcGraphChartElementAxis $mainAxis, ezcGraphChartElementAxis $secondAxis, $width )   X-Ref
Calculate bar chart step width

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

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

return: int Display type

checkRenderer()   X-Ref
Check if renderer supports features requested by some special chart
options.

return: void

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

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