summaryrefslogtreecommitdiffstats
path: root/src/axis/numeric.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-13 17:30:30 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-13 17:30:30 +0000
commit8e7294f3023f6b3836bbebb89d5c2845ab667354 (patch)
treebf152d5c023c55f0fbe5bce79211b20dc9022102 /src/axis/numeric.php
parent1dd98606db7d94b1cfb09a1711848b4d2945bb2a (diff)
downloadzetacomponents-graph-8e7294f3023f6b3836bbebb89d5c2845ab667354.zip
zetacomponents-graph-8e7294f3023f6b3836bbebb89d5c2845ab667354.tar.gz
- Added test and implementation for exclusive zero values
Diffstat (limited to 'src/axis/numeric.php')
-rw-r--r--src/axis/numeric.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/axis/numeric.php b/src/axis/numeric.php
index b660337..58b120d 100644
--- a/src/axis/numeric.php
+++ b/src/axis/numeric.php
@@ -213,8 +213,15 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis
// Prevent division by zero, when min == max
if ( $this->minValue == $this->maxValue )
{
- $this->minValue -= ( $this->minValue / 10 );
- $this->maxValue += ( $this->maxValue / 10 );
+ if ( $this->minValue == 0 )
+ {
+ $this->maxValue = 1;
+ }
+ else
+ {
+ $this->minValue -= ( $this->minValue * .1 );
+ $this->maxValue += ( $this->maxValue * .1 );
+ }
}
// Calculate "nice" values for scaling parameters
OpenPOWER on IntegriCloud