[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

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

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

Defines 1 class

ezcGraphChartElementLogarithmicalAxis:: (9 methods):
  __construct()
  __set()
  addData()
  calculateAxisBoundings()
  getCoordinate()
  getMinorStepCount()
  getMajorStepCount()
  getLabel()
  isZeroStep()


Class: ezcGraphChartElementLogarithmicalAxis  - X-Ref

Class to represent a logarithmic 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

Logarithmic axis are normally used to display very large or small values.
Logarithmic axis can not be used for value spans including zero, so you
should either pass only positive or only negative values to the chart.

By default the axis uses a base of 10 for scaling, you may assign any other
base to the $base property of the chart. With a base of 10 the steps on the
axis may, for example, be at: 1, 10, 100, 1000, 10000, ...

The logarithmic axis may be used like:

<code>
$graph = new ezcGraphLineChart();
$graph->title = 'The power of x';
$graph->legend->position = ezcGraph::BOTTOM;

$graph->xAxis = new ezcGraphChartElementNumericAxis();
$graph->yAxis = new ezcGraphChartElementLogarithmicalAxis();

$graph->data['x^2'] = new ezcGraphNumericDataSet(
-10, 10,
create_function( '$x', 'return pow( $x, 2 ) + 1;' )
);

$graph->data['x^4'] = new ezcGraphNumericDataSet(
-10, 10,
create_function( '$x', 'return pow( $x, 4 ) + 1;' )
);

$graph->data['x^6'] = new ezcGraphNumericDataSet(
-10, 10,
create_function( '$x', 'return pow( $x, 6 ) + 1;' )
);

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

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

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

param: float $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