diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-09-04 09:53:56 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-09-04 09:53:56 +0000 |
commit | 86d31a8b94e881ad6640bd8fd6c450f15fceb96a (patch) | |
tree | 1a84067fa49fb28bddb1d024aec329286f4b0543 /src/datasets | |
parent | 6e5582742fb0e67b71e94e0a9bedc91723c3ef3e (diff) | |
download | zetacomponents-graph-86d31a8b94e881ad6640bd8fd6c450f15fceb96a.zip zetacomponents-graph-86d31a8b94e881ad6640bd8fd6c450f15fceb96a.tar.gz |
- Added dataset properties for axis assignements
# More progress on the way to multiple axis support
Diffstat (limited to 'src/datasets')
-rw-r--r-- | src/datasets/base.php | 9 | ||||
-rw-r--r-- | src/datasets/property/axis.php | 56 |
2 files changed, 65 insertions, 0 deletions
diff --git a/src/datasets/base.php b/src/datasets/base.php index 3a3ac80..37337f5 100644 --- a/src/datasets/base.php +++ b/src/datasets/base.php @@ -23,6 +23,10 @@ * Display type of chart data * @property string $url * URL associated with datapoint + * @property ezcGraphChartElementAxis $xAxis + * Associate dataset with a different X axis then the default one + * @property ezcGraphChartElementAxis $yAxis + * Associate dataset with a different Y axis then the default one * * @version //autogentag// * @package Graph @@ -75,6 +79,9 @@ abstract class ezcGraphDataSet implements ArrayAccess, Iterator, Countable $this->properties['displayType'] = new ezcGraphDataSetIntProperty( $this ); $this->properties['url'] = new ezcGraphDataSetStringProperty( $this ); + $this->properties['xAxis'] = new ezcGraphDataSetAxisProperty( $this ); + $this->properties['yAxis'] = new ezcGraphDataSetAxisProperty( $this ); + $this->properties['highlight']->default = false; } @@ -102,6 +109,8 @@ abstract class ezcGraphDataSet implements ArrayAccess, Iterator, Countable case 'symbol': case 'highlight': case 'displayType': + case 'xAxis': + case 'yAxis': $this->properties[$propertyName]->default = $propertyValue; break; diff --git a/src/datasets/property/axis.php b/src/datasets/property/axis.php new file mode 100644 index 0000000..a989f31 --- /dev/null +++ b/src/datasets/property/axis.php @@ -0,0 +1,56 @@ +<?php +/** + * File containing the abstract ezcGraphDataSetIntProperty class + * + * @package Graph + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Class for axis properties of datasets + * + * @version //autogentag// + * @package Graph + */ +class ezcGraphDataSetAxisProperty extends ezcGraphDataSetProperty +{ + /** + * Chacks if value is really an axis + * + * @param &$value + * @return void + */ + protected function checkValue( &$value ) + { + if ( ! $value instanceof ezcGraphChartElementAxis ) + { + throw new ezcBaseValueException( 'default', $value, 'ezcGraphChartElementAxis' ); + } + + return true; + } + + /** + * Set an option. + * + * Sets an option using ArrayAccess. + * + * This is deaktivated, because you need not set a different axis for some + * data point. + * + * @param string $key The option to set. + * @param mixed $value The value for the option. + * @return void + * + * @throws ezcGraphInvalidAssignementException + * Always + */ + public function offsetSet( $key, $value ) + { + throw new ezcGraphInvalidAssignementException(); + } + +} + +?> |