summaryrefslogtreecommitdiffstats
path: root/src/axis/numeric.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-07-11 08:49:26 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-07-11 08:49:26 +0000
commit6f359d97e38932b0da23abb0940f32bf5380c0d8 (patch)
treebc6221534bf65aa6777245e7f555e943cdd2bbc6 /src/axis/numeric.php
parent663493a7224dc7869c6c63d770016f9fd8850e2a (diff)
downloadzetacomponents-graph-6f359d97e38932b0da23abb0940f32bf5380c0d8.zip
zetacomponents-graph-6f359d97e38932b0da23abb0940f32bf5380c0d8.tar.gz
- Refactored ezcGraphRenderer
# Most test run again, but complete result is still errnous
Diffstat (limited to 'src/axis/numeric.php')
-rw-r--r--src/axis/numeric.php35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/axis/numeric.php b/src/axis/numeric.php
index 1128134..f0cfc24 100644
--- a/src/axis/numeric.php
+++ b/src/axis/numeric.php
@@ -264,49 +264,34 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis
* @param float $value Value to determine position for
* @return float Position on chart
*/
- public function getCoordinate( ezcGraphBoundings $boundings, $value )
+ public function getCoordinate( $value )
{
// Force typecast, because ( false < -100 ) results in (bool) true
$floatValue = (float) $value;
+
if ( ( $value === false ) &&
( ( $floatValue < $this->min ) || ( $floatValue > $this->max ) ) )
{
switch ( $this->position )
{
- case ezcGraph::TOP:
- return $boundings->y0 +
- ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 );
- case ezcGraph::BOTTOM:
- return $boundings->y1 -
- ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 );
case ezcGraph::LEFT:
- return $boundings->x0 +
- ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 );
+ case ezcGraph::TOP:
+ return 0.;
case ezcGraph::RIGHT:
- return $boundings->x1 -
- ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 );
+ case ezcGraph::BOTTOM:
+ return 1.;
}
}
else
{
switch ( $this->position )
{
- case ezcGraph::TOP:
- return $boundings->y0 +
- ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) +
- ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->y1 - $boundings-> y0 ) * ( 1 - $this->axisSpace );
- case ezcGraph::BOTTOM:
- return $boundings->y1 -
- ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) -
- ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->y1 - $boundings-> y0 ) * ( 1 - $this->axisSpace );
case ezcGraph::LEFT:
- return $boundings->x0 +
- ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) +
- ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->axisSpace );
+ case ezcGraph::TOP:
+ return ( $value - $this->min ) / ( $this->max - $this->min );
case ezcGraph::RIGHT:
- return $boundings->x1 -
- ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) -
- ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->axisSpace );
+ case ezcGraph::BOTTOM:
+ return 1 - ( $value - $this->min ) / ( $this->max - $this->min );
}
}
}
OpenPOWER on IntegriCloud