diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-05-31 10:09:24 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-05-31 10:09:24 +0000 |
commit | be71d4bacef6f010a54df59356f97727a932de43 (patch) | |
tree | 66506017c342c9d745346619f8ddcadff3e72b4c /src/axis/numeric.php | |
parent | 4a2d7f6335135e7fe09ae71e6d9bc6dbd7100281 (diff) | |
download | zetacomponents-graph-be71d4bacef6f010a54df59356f97727a932de43.zip zetacomponents-graph-be71d4bacef6f010a54df59356f97727a932de43.tar.gz |
- Added test for axis rendering
- Implemented axis rendering
- Missing lables
Diffstat (limited to 'src/axis/numeric.php')
-rw-r--r-- | src/axis/numeric.php | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/src/axis/numeric.php b/src/axis/numeric.php index 4b2916a..df4b37d 100644 --- a/src/axis/numeric.php +++ b/src/axis/numeric.php @@ -30,21 +30,6 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis protected $max = false; /** - * Labeled major steps displayed on the axis - * - * @var float - */ - protected $majorStep = false; - - /** - * Non labeled minor steps on the axis - * - * @var mixed - * @access protected - */ - protected $minorStep = false; - - /** * Constant used for calculation of automatic definition of major scaling * steps */ @@ -77,20 +62,6 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis case 'max': $this->max = (float) $propertyValue; break; - case 'majorStep': - if ( $propertyValue <= 0 ) - { - throw new ezcBaseValueException( 'majorStep', $propertyValue, 'float > 0' ); - } - $this->majorStep = (float) $propertyValue; - break; - case 'minorStep': - if ( $propertyValue <= 0 ) - { - throw new ezcBaseValueException( 'minorStep', $propertyValue, 'float > 0' ); - } - $this->minorStep = (float) $propertyValue; - break; default: parent::__set( $propertyName, $propertyValue ); break; @@ -295,6 +266,26 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis } } } + + /** + * Return count of minor steps + * + * @return integer Count of minor steps + */ + protected function getMinorStepCount() + { + return (int) ( ( $this->max - $this->min ) / $this->minorStep ); + } + + /** + * Return count of major steps + * + * @return integer Count of major steps + */ + protected function getMajorStepCount() + { + return (int) ( ( $this->max - $this->min ) / $this->majorStep ); + } } ?> |