Path

ez components / documentation / api reference / 2008.2.3 / graph


eZ Components 2008.2.3

Graph: ezcGraphDataSetProperty

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

Class: ezcGraphDataSetProperty

Abstract class for properties of datasets [source]

Implemented Interfaces

  • ArrayAccess (internal interface)

This class is used to extends datasets with additional properties, and stores only non default values for each data point in a data set.
The class is extended by property implementations including simple value validators, like:
  • ezcGraphDataSetAxisProperty
  • ezcGraphDataSetBooleanProperty
  • ezcGraphDataSetColorProperty
  • ezcGraphDataSetIntProperty
  • ezcGraphDataSetStringProperty
The color property can for example be accessed in a chart like:
 1.   $graph new ezcGraphLineChart();
 2.   $graph->data['example'new ezcGraphArrayDataSetarray(
 3.       'Foo' => 23,
 4.       'Bar' => 42,
 5.   ) );
 6.  
 7.   // Set color for all data points in this data set
 8.     $graph->data['example']->color '#a40000';
 9.  
10.   // Set different color for one special datapoint
11.     $graph->data['example']->color['Foo''#2e3436';
12.  
13.   $graph->render400200'test.svg' );

Descendents

Child Class Description
ezcGraphDataSetColorProperty Class for color properties of datasets
ezcGraphDataSetBooleanProperty Class for boolean properties of datasets
ezcGraphDataSetStringProperty Class for string properties of datasets
ezcGraphDataSetIntProperty Class for integer properties of datasets
ezcGraphDataSetAxisProperty Class for axis properties of datasets

Member Variables

protected ezcGraphDataSet $dataset
Contains a reference to the dataset to check for availability of data keys
protected array $dataValue
Contains specified values for single dataset elements
protected mixed $defaultValue
Default value for this property

Method Summary

protected abstract void checkValue( &$value, $value )
Abstract method to contain the check for validity of the value
public bool offsetExists( $key )
Returns if an option exists.
public mixed offsetGet( $key )
Returns an option value.
public void offsetSet( $key, $value )
Set an option.
public void offsetUnset( $key )
Unset an option.
public mixed __get( $name )
Get the default value for this property
public void __set( $name, $value )
Set the default value for this property

Methods

checkValue

void checkValue( &$value, mixed $value )
Abstract method to contain the check for validity of the value

Parameters

Name Type Description
$value mixed  
&$value  

Redefined in descendants as

Method Description
ezcGraphDataSetColorProperty::checkValue() Converts value to an ezcGraphColor object
ezcGraphDataSetBooleanProperty::checkValue() Converts value to an ezcGraphColor object
ezcGraphDataSetStringProperty::checkValue() Converts value to an ezcGraphColor object
ezcGraphDataSetIntProperty::checkValue() Converts value to an ezcGraphColor object
ezcGraphDataSetAxisProperty::checkValue() Chacks if value is really an axis

offsetExists

bool offsetExists( string $key )
Returns if an option exists.
Allows isset() using ArrayAccess.

Parameters

Name Type Description
$key string The name of the option to get.

offsetGet

mixed offsetGet( string $key )
Returns an option value.
Get an option value by ArrayAccess.

Parameters

Name Type Description
$key string The name of the option to get.

Throws

ClassDescription
ezcBasePropertyNotFoundException If a the value for the property options is not an instance of

offsetSet

void offsetSet( string $key, mixed $value )
Set an option.
Sets an option using ArrayAccess.

Parameters

Name Type Description
$key string The option to set.
$value mixed The value for the option.

Throws

ClassDescription
ezcBasePropertyNotFoundException If a the value for the property options is not an instance of
ezcBaseValueException If a the value for a property is out of range.

Redefined in descendants as

Method Description
ezcGraphDataSetAxisProperty::offsetSet() Set an option.

offsetUnset

void offsetUnset( string $key )
Unset an option.
Unsets an option using ArrayAccess.

Parameters

Name Type Description
$key string The options to unset.

Throws

ClassDescription
ezcBasePropertyNotFoundException If a the value for the property options is not an instance of
ezcBaseValueException If a the value for a property is out of range.

__get

mixed __get( string $name )
Get the default value for this property

Parameters

Name Type Description
$name string Property name

__set

void __set( string $name, mixed $value )
Set the default value for this property

Parameters

Name Type Description
$name string Property name
$value mixed Property value

Last updated: Mon, 11 May 2009