Path

ez components / documentation / api reference / 2007.2.1 / graph


eZ Components 2007.2.1

Graph: ezcGraphChartElementAxis

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

Class: ezcGraphChartElementAxis

Basic axis class [source]

Parents

ezcBaseOptions
   |
   --ezcGraphChartElement
      |
      --ezcGraphChartElementAxis

Descendents

Child Class Description
ezcGraphChartElementDateAxis Class to represent date axis. Date axis will try to find a "nice" interval based on the values on the x axis. If non numeric values are given, ezcGraphChartElementDateAxis will convert them to timestamps using PHPs strtotime function.
ezcGraphChartElementNumericAxis Class to represent a numeric axis. The axis tries to calculate "nice" start and end values for the axis scale. The used interval is considered as nice, if it is equal to [1,2,5] * 10^x with x in [.., -1, 0, 1, ..].
ezcGraphChartElementLabeledAxis Class to represent a labeled axis. Values on the x axis are considered as strings and used in the given order.
ezcGraphChartElementLogarithmicalAxis Class to represent a numeric axis. The axis tries to calculate "nice" start and end values for the axis scale. The used interval is considered as nice, if it is equal to [1,2,5] * 10^x with x in [.., -1, 0, 1, ..].

Properties

ezcGraphAxisLabelRenderer read/write  $axisLabelRenderer
AxisLabelRenderer used to render labels and grid on this axis.
float read/write  $axisSpace
Percent of the chart space used to display axis labels and arrowheads instead of data values.
float read/write  $chartPosition
Position of the axis in the chart. Only useful for additional axis. The basic chart axis will be automatically positioned.
string read/write  $formatString
Formatstring to use for labeling of the axis.
bool read  $initialized
Property indicating if some values were associated with axis, or a scaling has been set manually.
string read/write  $label
Axis label
callback read/write  $labelCallback
Callback function to format chart labels. Function will receive two parameters and should return a reformatted label. string function( label, step )
int read/write  $labelMargin
Distance between label an axis
int read/write  $labelSize
Size of axis label
ezcGraphColor read/write  $majorGrid
Color of major majorGrid.
mixed read/write  $majorStep
Labeled major steps displayed on the axis. @TODO: Should be moved to numeric axis.
int read/write  $maxArrowHeadSize
Maximum Size used to draw arrow heads.
int read/write  $minArrowHeadSize
Minimum Size used to draw arrow heads.
ezcGraphColor read/write  $minorGrid
Color of minor majorGrid.
mixed read/write  $minorStep
Non labeled minor steps on the axis. @TODO: Should be moved to numeric axis.
float read/write  $nullPosition
The position of the null value.

Member Variables

protected ezcGraphAxisLabelRenderer $axisLabelRenderer
Axis label renderer class

Inherited Member Variables

From ezcBaseOptions:
protected  ezcBaseOptions::$properties

Method Summary

public abstract void addData( $values )
Add data for this axis
public abstract void calculateAxisBoundings( )
Calculate axis bounding values on base of the assigned values
public abstract float getCoordinate( $value )
Get coordinate for a dedicated value on the chart
public abstract string getLabel( $step )
Get label for a dedicated step on the axis
public abstract integer getMajorStepCount( )
Return count of major steps
public abstract integer getMinorStepCount( )
Return count of minor steps
public array( getSteps( )
Return array of steps on this axis
public abstract bool isZeroStep( $step )
Is zero step
public ezcGraphBoundings render( $renderer, $boundings )
Render the axis
public void setFromPalette( $palette )
Set colors and border fro this element
public void __set( $propertyName, $propertyValue )
__set

Inherited Methods

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  

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::addData() Add data for this axis
ezcGraphChartElementNumericAxis::addData() Add data for this axis
ezcGraphChartElementLabeledAxis::addData() Add data for this axis
ezcGraphChartElementLogarithmicalAxis::addData() Add data for this axis

calculateAxisBoundings

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

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::calculateAxisBoundings() Calculate axis bounding values on base of the assigned values
ezcGraphChartElementNumericAxis::calculateAxisBoundings() Calculate axis bounding values on base of the assigned values
ezcGraphChartElementLabeledAxis::calculateAxisBoundings() Calculate axis bounding values on base of the assigned values
ezcGraphChartElementLogarithmicalAxis::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

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::getCoordinate() Get coordinate for a dedicated value on the chart
ezcGraphChartElementNumericAxis::getCoordinate() Get coordinate for a dedicated value on the chart
ezcGraphChartElementLabeledAxis::getCoordinate() Get coordinate for a dedicated value on the chart
ezcGraphChartElementLogarithmicalAxis::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

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::getLabel() Get label for a dedicated step on the axis
ezcGraphChartElementNumericAxis::getLabel() Get label for a dedicated step on the axis
ezcGraphChartElementLabeledAxis::getLabel() Get label for a dedicated step on the axis
ezcGraphChartElementLogarithmicalAxis::getLabel() Get label for a dedicated step on the axis

getMajorStepCount

integer getMajorStepCount( )
Return count of major steps

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::getMajorStepCount() Return count of major steps
ezcGraphChartElementNumericAxis::getMajorStepCount() Return count of major steps
ezcGraphChartElementLabeledAxis::getMajorStepCount() Return count of major steps
ezcGraphChartElementLogarithmicalAxis::getMajorStepCount() Return count of major steps

getMinorStepCount

integer getMinorStepCount( )
Return count of minor steps

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::getMinorStepCount() Return count of minor steps
ezcGraphChartElementNumericAxis::getMinorStepCount() Return count of minor steps
ezcGraphChartElementLabeledAxis::getMinorStepCount() Return count of minor steps
ezcGraphChartElementLogarithmicalAxis::getMinorStepCount() Return count of minor steps

getSteps

array( getSteps( )
Return array of steps on this axis

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::getSteps() Return array of steps on this axis
ezcGraphChartElementLabeledAxis::getSteps() Return array of steps on this axis

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

Redefined in descendants as

Method Description
ezcGraphChartElementDateAxis::isZeroStep() Is zero step
ezcGraphChartElementNumericAxis::isZeroStep() Is zero step
ezcGraphChartElementLabeledAxis::isZeroStep() Is zero step
ezcGraphChartElementLogarithmicalAxis::isZeroStep() Is zero step

render

ezcGraphBoundings render( ezcGraphRenderer $renderer, $boundings )
Render the axis

Parameters

Name Type Description
$renderer ezcGraphRenderer Renderer
$boundings ezcGraphBoundings Boundings for the axis

Redefinition of

Method Description
ezcGraphChartElement::render() Renders this chart element

setFromPalette

void setFromPalette( ezcGraphPalette $palette )
Set colors and border fro this element

Parameters

Name Type Description
$palette ezcGraphPalette Palette

Redefinition of

Method Description
ezcGraphChartElement::setFromPalette() Set colors and border fro this element

__set

void __set( mixed $propertyName, mixed $propertyValue )
__set

Parameters

Name Type Description
$propertyName mixed  
$propertyValue mixed  

Throws

ClassDescription
ezcBaseValueException If a submitted parameter was out of range or type.
ezcBasePropertyNotFoundException If a the value for the property options is not an instance of

Last updated: Thu, 31 Jan 2008