Path

ez components / documentation / api reference / latest / graph


eZ Components latest

Graph: ezcGraphChartElementLogarithmicalAxis

[ Tutorial ] [ Gallery ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcGraphChartElementLogarithmicalAxis

Class to represent a logarithmic axis. [source]
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:
 1.   $graph new ezcGraphLineChart();
 2.   $graph->title 'The power of x';
 3.   $graph->legend->position ezcGraph::BOTTOM;
 4.  
 5.   $graph->xAxis new ezcGraphChartElementNumericAxis();
 6.   $graph->yAxis new ezcGraphChartElementLogarithmicalAxis();
 7.  
 8.   $graph->data['x^2'new ezcGraphNumericDataSet(
 9.       -1010,
10.       create_function'$x''return pow( $x, 2 ) + 1;' )
11.   );
12.  
13.   $graph->data['x^4'new ezcGraphNumericDataSet(
14.       -1010,
15.       create_function'$x''return pow( $x, 4 ) + 1;' )
16.   );
17.  
18.   $graph->data['x^6'new ezcGraphNumericDataSet(
19.       -1010,
20.       create_function'$x''return pow( $x, 6 ) + 1;' )
21.   );
22.  
23.   $graph->render400250'tutorial_axis_logarithmic.svg' );

Parents

ezcBaseOptions
   |
   --ezcGraphChartElement
      |
      --ezcGraphChartElementAxis
         |
         --ezcGraphChartElementLogarithmicalAxis

Constants

MAX_STEPS = 9 Constant used for calculation of automatic definition of major scaling
steps

Properties

float read/write  $base
Base for logarithmical scaling.
string read/write  $logarithmicalFormatString
Sprintf formatstring for the axis labels where $1 is the base and $2 is the exponent.
float read  $maxValue
Maximum value to display on this axis.
float read  $minValue
Minimum Value to display on this axis.

Inherited Member Variables

From ezcGraphChartElementAxis:
protected  ezcGraphChartElementAxis::$axisLabelRenderer
protected  ezcGraphChartElementAxis::$innerBoundings
From ezcBaseOptions:
protected  ezcBaseOptions::$properties

Method Summary

public void addData( $values )
Add data for this axis
public abstract void calculateAxisBoundings( )
Calculate axis bounding values on base of the assigned values
public float getCoordinate( $value )
Get coordinate for a dedicated value on the chart
public string getLabel( $step )
Get label for a dedicated step on the axis
public integer getMajorStepCount( )
Return count of major steps
public integer getMinorStepCount( )
Return count of minor steps
public bool isZeroStep( $step )
Is zero step

Inherited Methods

From ezcGraphChartElementAxis :
public abstract void ezcGraphChartElementAxis::addData()
Add data for this axis
public abstract void ezcGraphChartElementAxis::calculateAxisBoundings()
Calculate axis bounding values on base of the assigned values
public abstract float ezcGraphChartElementAxis::getCoordinate()
Get coordinate for a dedicated value on the chart
public abstract string ezcGraphChartElementAxis::getLabel()
Get label for a dedicated step on the axis
public abstract integer ezcGraphChartElementAxis::getMajorStepCount()
Return count of major steps
public abstract integer ezcGraphChartElementAxis::getMinorStepCount()
Return count of minor steps
public array( ezcGraphChartElementAxis::getSteps()
Return array of steps on this axis
public abstract bool ezcGraphChartElementAxis::isZeroStep()
Is zero step
public ezcGraphBoundings ezcGraphChartElementAxis::render()
Render the axis
public void ezcGraphChartElementAxis::setFromPalette()
Set colors and border fro this element
public void ezcGraphChartElementAxis::__set()
__set
From ezcGraphChartElement :
protected ezcGraphBoundings ezcGraphChartElement::getTitleSize()
Returns calculated boundings based on available percentual space of given bounding box specified in the elements options and direction of the box.
public abstract ezcGraphBoundings ezcGraphChartElement::render()
Renders this chart element
public void ezcGraphChartElement::setFromPalette()
Set colors and border fro this element
From ezcBaseOptions :
public ezcBaseOptions ezcBaseOptions::__construct()
Construct a new options object.
public void ezcBaseOptions::merge()
Merge an array into the actual options object.
public bool ezcBaseOptions::offsetExists()
Returns if an option exists.
public mixed ezcBaseOptions::offsetGet()
Returns an option value.
public void ezcBaseOptions::offsetSet()
Set an option.
public void ezcBaseOptions::offsetUnset()
Unset an option.

Methods

addData

void addData( $values )
Add data for this axis

Parameters

Name Type Description
$values array Value which will be displayed on this axis

Redefinition of

Method Description
ezcGraphChartElementAxis::addData() Add data for this axis

calculateAxisBoundings

void calculateAxisBoundings( )
Calculate axis bounding values on base of the assigned values

Redefinition of

Method Description
ezcGraphChartElementAxis::calculateAxisBoundings() Calculate axis bounding values on base of the assigned values

getCoordinate

float getCoordinate( float $value )
Get coordinate for a dedicated value on the chart

Parameters

Name Type Description
$value float Value to determine position for

Redefinition of

Method Description
ezcGraphChartElementAxis::getCoordinate() Get coordinate for a dedicated value on the chart

getLabel

string getLabel( integer $step )
Get label for a dedicated step on the axis

Parameters

Name Type Description
$step integer Number of step

Redefinition of

Method Description
ezcGraphChartElementAxis::getLabel() Get label for a dedicated step on the axis

getMajorStepCount

integer getMajorStepCount( )
Return count of major steps

Redefinition of

Method Description
ezcGraphChartElementAxis::getMajorStepCount() Return count of major steps

getMinorStepCount

integer getMinorStepCount( )
Return count of minor steps

Redefinition of

Method Description
ezcGraphChartElementAxis::getMinorStepCount() Return count of minor steps

isZeroStep

bool isZeroStep( int $step )
Is zero step
Returns true if the given step is the one on the initial axis position

Parameters

Name Type Description
$step int Number of step

Redefinition of

Method Description
ezcGraphChartElementAxis::isZeroStep() Is zero step

Last updated: Mon, 21 Dec 2009