diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-19 14:48:30 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-19 14:48:30 +0000 |
commit | c3293f6d5ed83e2da339731542fd077b0b6ef7df (patch) | |
tree | 07de7aa86dca161ed003f9df22f8123e3cc29814 /src/charts/line.php | |
parent | b0cdd01ee9240f879c7eb448535420ff05ffd5a3 (diff) | |
download | zetacomponents-graph-c3293f6d5ed83e2da339731542fd077b0b6ef7df.zip zetacomponents-graph-c3293f6d5ed83e2da339731542fd077b0b6ef7df.tar.gz |
- Fixed division by zero with zero values and filled lines
Diffstat (limited to 'src/charts/line.php')
-rw-r--r-- | src/charts/line.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/charts/line.php b/src/charts/line.php index db672d1..ca37433 100644 --- a/src/charts/line.php +++ b/src/charts/line.php @@ -42,7 +42,7 @@ class ezcGraphLineChart extends ezcGraphChart public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { - case 'X_Axis': + case 'xAxis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'xAxis', $propertyValue ); @@ -53,7 +53,7 @@ class ezcGraphLineChart extends ezcGraphChart throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; - case 'Y_Axis': + case 'yAxis': if ( $propertyValue instanceof ezcGraphChartElementAxis ) { $this->addElement( 'yAxis', $propertyValue ); @@ -103,7 +103,9 @@ class ezcGraphLineChart extends ezcGraphChart $axisPosition ); - if ( $value / abs( $value ) == $lastValue / abs( $lastValue ) ) + if ( ( $value == 0 ) || + ( $lastValue == 0 ) || + ( $value / abs( $value ) == $lastValue / abs( $lastValue ) ) ) { // Values have the same sign, so that the line do not cross any axes $renderer->drawPolygon( |