[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/ezc/Graph/src/axis/ -> labeled.php (summary)

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

Defines 1 class

ezcGraphChartElementLabeledAxis:: (12 methods):
  __construct()
  __set()
  increaseKeys()
  provideLabels()
  addData()
  calculateAxisBoundings()
  getSteps()
  getCoordinate()
  getMinorStepCount()
  getMajorStepCount()
  getLabel()
  isZeroStep()


Class: ezcGraphChartElementLabeledAxis  - X-Ref

Class to represent a labeled axis.

Axis elements represent the axis in a bar, line or radar chart. They are
chart elements (ezcGraphChartElement) extending from
ezcGraphChartElementAxis, where additional formatting options can be found.
You should generally use the axis, which matches your input data best, so
that the automatic chart layouting works best. Aavailable axis types are:

- ezcGraphChartElementDateAxis
- ezcGraphChartElementLabeledAxis
- ezcGraphChartElementLogarithmicalAxis
- ezcGraphChartElementNumericAxis

The labeled axis will accept any values and converts them to strings. The
labeled axis does not know about any special meanings of values and
maintains the order of the given labels with equidistant spaces between all
values. If your data has a special meaning, like a set of numbers or dates,
use one of the other more appropriate axis.

Because it is not always possible to fit all labels in a chart you may
define the count of labels drawn using the $labelCount option. For all other
labels only a small step will be rendered.

The labeled axis may be used like:

<code>
$graph = new ezcGraphLineChart();
$graph->options->fillLines = 210;
$graph->options->font->maxFontSize = 10;
$graph->title = 'Error level colors';
$graph->legend = false;

$graph->yAxis = new ezcGraphChartElementLabeledAxis();
$graph->yAxis->axisLabelRenderer->showZeroValue = true;

$graph->yAxis->label = 'Color';
$graph->xAxis->label = 'Error level';

// Add data
$graph->data['colors'] = new ezcGraphArrayDataSet(
array(
'info' => 'blue',
'notice' => 'green',
'warning' => 'orange',
'error' => 'red',
'fatal' => 'red',
)
);

$graph->render( 400, 150, 'tutorial_axis_labeled.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

increaseKeys( array $array, $startKey )   X-Ref
Increase the keys of all elements in the array up from the start key, to
insert an additional element at the correct position.

param: array $array Array
param: int $startKey Key to increase keys from
return: array Updated array

provideLabels( array $labels )   X-Ref
Provide initial set of labels

This method may be used to provide an ordered set of labels, containing
labels, which are not available in the datasets or to provide a label
order different to the one in the given dataset.

param: array $labels
return: void

addData( array $values )   X-Ref
Add data for this axis

param: array $values Value which will be displayed on this axis
return: void

calculateAxisBoundings()   X-Ref
Calculate axis bounding values on base of the assigned values

return: void

getSteps()   X-Ref
Return array of steps on this axis

return: array( ezcGraphAxisStep )

getCoordinate( $value )   X-Ref
Get coordinate for a dedicated value on the chart

param: string $value Value to determine position for
return: float Position on chart

getMinorStepCount()   X-Ref
Return count of minor steps

return: integer Count of minor steps

getMajorStepCount()   X-Ref
Return count of major steps

return: integer Count of major steps

getLabel( $step )   X-Ref
Get label for a dedicated step on the axis

param: integer $step Number of step
return: string label

isZeroStep( $step )   X-Ref
Is zero step

Returns true if the given step is the one on the initial axis position

param: int $step Number of step
return: bool Status If given step is initial axis position



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