Path

ez components / documentation / api reference / 2008.1beta1 / graph


eZ Components 2008.1beta1

Graph: ezcGraphChartDataContainer

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

Class: ezcGraphChartDataContainer

Container class for datasets used by the chart classes. Implements usefull interfaces for convenient access to the datasets. [source]

Implemented Interfaces

  • ArrayAccess (internal interface)
  • Iterator (internal interface)
  • Countable (internal interface)

Descendents

Child Class Description
ezcGraphChartSingleDataContainer Container class for datasets, which ensures, that only one dataset is used.

Member Variables

protected ezcGraphChart $chart
Chart using this data set storage
protected array(ezcGraphDataSet) $data = array()
Contains the data of a chart

Method Summary

protected ezcGraphDataSet addDataSet( $name, $dataSet, $values )
Adds a dataset to the charts data
public int count( )
Returns the number of datasets in the row.
public ezcGraphDataSet current( )
Returns the currently selected dataset.
public int key( )
Returns the key of the currently selected dataset.
public mixed next( )
Returns the next dataset and selects it or false on the last dataset.
public bool offsetExists( $key )
Returns if the given offset exists.
public ezcGraphDataSet offsetGet( $key )
Returns the element with the given offset.
public void offsetSet( $key, $value )
Set the element with the given offset.
public void offsetUnset( $key )
Unset the element with the given offset.
public ezcGraphDataSet rewind( )
Selects the very first dataset and returns it.
public bool valid( )
Returns if the current dataset is valid.

Methods

addDataSet

ezcGraphDataSet addDataSet( string $name, $dataSet, mixed $values )
Adds a dataset to the charts data

Parameters

Name Type Description
$name string Name of dataset
$dataSet ezcGraphDataSet  
$values mixed Values to create dataset with

Throws

ClassDescription
ezcGraphTooManyDataSetExceptions If too many datasets are created

Redefined in descendants as

Method Description
ezcGraphChartSingleDataContainer::addDataSet() Adds a dataset to the charts data

count

int count( )
Returns the number of datasets in the row.
This method is part of the Countable interface to allow the usage of PHP's count() function to check how many datasets exist.

current

ezcGraphDataSet current( )
Returns the currently selected dataset.
This method is part of the Iterator interface to allow access to the datasets of this row by iterating over it like an array (e.g. using foreach).

key

int key( )
Returns the key of the currently selected dataset.
This method is part of the Iterator interface to allow access to the datasets of this row by iterating over it like an array (e.g. using foreach).

next

mixed next( )
Returns the next dataset and selects it or false on the last dataset.
This method is part of the Iterator interface to allow access to the datasets of this row by iterating over it like an array (e.g. using foreach).

offsetExists

bool offsetExists( string $key )
Returns if the given offset exists.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array.

Parameters

Name Type Description
$key string Identifier of dataset.

offsetGet

ezcGraphDataSet offsetGet( string $key )
Returns the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array.

Parameters

Name Type Description
$key string Identifier of dataset.

Throws

ClassDescription
ezcGraphNoSuchDataSetException If no dataset with identifier exists

offsetSet

void offsetSet( string $key, ezcGraphDataSet $value )
Set the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array.

Parameters

Name Type Description
$key string  
$value ezcGraphDataSet  

Throws

ClassDescription
ezcBaseValueException If supplied value is not an ezcGraphDataSet

offsetUnset

void offsetUnset( string $key )
Unset the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the data of this object as if it was an array.

Parameters

Name Type Description
$key string  

rewind

ezcGraphDataSet rewind( )
Selects the very first dataset and returns it.
This method is part of the Iterator interface to allow access to the datasets of this row by iterating over it like an array (e.g. using foreach).

valid

bool valid( )
Returns if the current dataset is valid.
This method is part of the Iterator interface to allow access to the datasets of this row by iterating over it like an array (e.g. using foreach).

Last updated: Tue, 27 May 2008