diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2009-07-21 11:25:18 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2009-07-21 11:25:18 +0000 |
commit | 73061d5af4bcddd2df8169dccca17dfea5bb8477 (patch) | |
tree | dd1a19fe8c644a3f53d5f276ef5facfd5c6b57d6 /src/element | |
parent | 9ce834beee81194e02525a6cb836516dc379eeb7 (diff) | |
download | zetacomponents-graph-73061d5af4bcddd2df8169dccca17dfea5bb8477.zip zetacomponents-graph-73061d5af4bcddd2df8169dccca17dfea5bb8477.tar.gz |
- Implemented: #15133: Better configurable axis spaces.
# Large number of tests added. Had to go through all sensible combinations of
# axis and axis spaces to ensure it works correctly.
Diffstat (limited to 'src/element')
-rw-r--r-- | src/element/axis.php | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/element/axis.php b/src/element/axis.php index 4f38761..0f6af3f 100644 --- a/src/element/axis.php +++ b/src/element/axis.php @@ -221,7 +221,6 @@ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement $this->properties['axisSpace'] = (float) $propertyValue; break; - /* Do not yet allow to modify this value, this need further testing. case 'outerAxisSpace': if ( !is_null( $propertyValue ) && ( !is_numeric( $propertyValue ) || @@ -233,7 +232,6 @@ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement $this->properties['outerAxisSpace'] = $propertyValue; break; - */ case 'majorGrid': $this->properties['majorGrid'] = ezcGraphColor::create( $propertyValue ); break; @@ -482,50 +480,50 @@ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement { case ezcGraph::TOP: $start = new ezcGraphCoordinate( - ( $boundings->x1 - $boundings->x0 ) * $startSpace + - $this->nullPosition * ( $boundings->x1 - $boundings->x0 ) * ( 1 - 2 * $startSpace ), + $boundings->width * $startSpace + + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), 0 ); $end = new ezcGraphCoordinate( - ( $boundings->x1 - $boundings->x0 ) * $endSpace + - $this->nullPosition * ( $boundings->x1 - $boundings->x0 ) * ( 1 - 2 * $endSpace ), - $boundings->y1 - $boundings->y0 + $boundings->width * $startSpace + + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), + $boundings->height ); break; case ezcGraph::BOTTOM: $start = new ezcGraphCoordinate( - ( $boundings->x1 - $boundings->x0 ) * $startSpace + - $this->nullPosition * ( $boundings->x1 - $boundings->x0 ) * ( 1 - 2 * $startSpace ), - $boundings->y1 - $boundings->y0 + $boundings->width * $startSpace + + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), + $boundings->height ); $end = new ezcGraphCoordinate( - ( $boundings->x1 - $boundings->x0 ) * $endSpace + - $this->nullPosition * ( $boundings->x1 - $boundings->x0 ) * ( 1 - 2 * $endSpace ), + $boundings->width * $startSpace + + $this->nullPosition * $boundings->width * ( 1 - ( $startSpace + $endSpace ) ), 0 ); break; case ezcGraph::LEFT: $start = new ezcGraphCoordinate( 0, - ( $boundings->y1 - $boundings->y0 ) * $startSpace + - $this->nullPosition * ( $boundings->y1 - $boundings->y0 ) * ( 1 - 2 * $startSpace ) + $boundings->height * $endSpace + + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); $end = new ezcGraphCoordinate( - $boundings->x1 - $boundings->x0, - ( $boundings->y1 - $boundings->y0 ) * $endSpace + - $this->nullPosition * ( $boundings->y1 - $boundings->y0 ) * ( 1 - 2 * $endSpace ) + $boundings->width, + $boundings->height * $endSpace + + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); break; case ezcGraph::RIGHT: $start = new ezcGraphCoordinate( - $boundings->x1 - $boundings->x0, - ( $boundings->y1 - $boundings->y0 ) * $startSpace + - $this->nullPosition * ( $boundings->y1 - $boundings->y0 ) * ( 1 - 2 * $startSpace ) + $boundings->width, + $boundings->height * $endSpace + + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); $end = new ezcGraphCoordinate( 0, - ( $boundings->y1 - $boundings->y0 ) * $endSpace + - $this->nullPosition * ( $boundings->y1 - $boundings->y0 ) * ( 1 - 2 * $endSpace ) + $boundings->height * $endSpace + + $this->nullPosition * $boundings->height * ( 1 - ( $startSpace + $endSpace ) ) ); break; } |