diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-06 14:33:35 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-06 14:33:35 +0000 |
commit | 51bbe683d53acf187ebaca6af0e8dcf8dc2db6e7 (patch) | |
tree | c210178cbb44bd302e4dc2decc447468f2852961 /src/axis | |
parent | c925b7cbd916a294e96d361585c396cd107a827e (diff) | |
download | zetacomponents-graph-51bbe683d53acf187ebaca6af0e8dcf8dc2db6e7.zip zetacomponents-graph-51bbe683d53acf187ebaca6af0e8dcf8dc2db6e7.tar.gz |
- Added outomatic colorization from pallets
Diffstat (limited to 'src/axis')
-rw-r--r-- | src/axis/labeled.php | 28 | ||||
-rw-r--r-- | src/axis/numeric.php | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/axis/labeled.php b/src/axis/labeled.php index 8525460..341e36b 100644 --- a/src/axis/labeled.php +++ b/src/axis/labeled.php @@ -96,16 +96,16 @@ class ezcGraphChartElementLabeledAxis extends ezcGraphChartElementAxis { case ezcGraph::TOP: return $boundings->y0 + - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ); + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ); case ezcGraph::BOTTOM: return $boundings->y1 - - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ); + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ); case ezcGraph::LEFT: return $boundings->x0 + - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ); case ezcGraph::RIGHT: return $boundings->x1 - - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ); } } else @@ -114,20 +114,20 @@ class ezcGraphChartElementLabeledAxis extends ezcGraphChartElementAxis { case ezcGraph::TOP: return $boundings->y0 + - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ) + - ( $boundings->y1 - $boundings->y0 ) * ( 1 - $this->padding ) / ( count ( $this->labels ) - 1 ) * $key; + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) + + ( $boundings->y1 - $boundings->y0 ) * ( 1 - $this->axisSpace ) / ( count ( $this->labels ) - 1 ) * $key; case ezcGraph::BOTTOM: return $boundings->y1 - - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ) - - ( $boundings->y1 - $boundings->y0 ) * ( 1 - $this->padding ) / ( count ( $this->labels ) - 1 ) * $key; + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) - + ( $boundings->y1 - $boundings->y0 ) * ( 1 - $this->axisSpace ) / ( count ( $this->labels ) - 1 ) * $key; case ezcGraph::LEFT: return $boundings->x0 + - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ) + - ( $boundings->x1 - $boundings->x0 ) * ( 1 - $this->padding ) / ( count ( $this->labels ) - 1 ) * $key; + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) + + ( $boundings->x1 - $boundings->x0 ) * ( 1 - $this->axisSpace ) / ( count ( $this->labels ) - 1 ) * $key; case ezcGraph::RIGHT: return $boundings->x1 - - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ) - - ( $boundings->x1 - $boundings->x0 ) * ( 1 - $this->padding ) / ( count ( $this->labels ) - 1 ) * $key; + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) - + ( $boundings->x1 - $boundings->x0 ) * ( 1 - $this->axisSpace ) / ( count ( $this->labels ) - 1 ) * $key; } } } @@ -171,8 +171,8 @@ class ezcGraphChartElementLabeledAxis extends ezcGraphChartElementAxis $yStepsize = ( $end->y - $start->y ) / $steps; // Caluclate datafree chart border - $xBorder = abs ( ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ) ); - $yBorder = abs ( ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ) ); + $xBorder = abs ( ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) ); + $yBorder = abs ( ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) ); for ( $i = 0; $i <= $steps; ++$i ) { diff --git a/src/axis/numeric.php b/src/axis/numeric.php index 161130c..2640eb5 100644 --- a/src/axis/numeric.php +++ b/src/axis/numeric.php @@ -234,16 +234,16 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis { case ezcGraph::TOP: return $boundings->y0 + - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ); + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ); case ezcGraph::BOTTOM: return $boundings->y1 - - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ); + ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ); case ezcGraph::LEFT: return $boundings->x0 + - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ); case ezcGraph::RIGHT: return $boundings->x1 - - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ); } } else @@ -252,20 +252,20 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis { case ezcGraph::TOP: return $boundings->y0 + - ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ) + - ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->y1 - $boundings-> y0 ) * ( 1 - $this->padding ); + ( $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->padding / 2 ) - - ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->y1 - $boundings-> y0 ) * ( 1 - $this->padding ); + ( $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->padding / 2 ) + - ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->padding ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) + + ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->axisSpace ); case ezcGraph::RIGHT: return $boundings->x1 - - ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ) - - ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->padding ); + ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) - + ( $value - $this->min ) / ( $this->max - $this->min ) * ( $boundings->x1 - $boundings-> x0 ) * ( 1 - $this->axisSpace ); } } } @@ -309,8 +309,8 @@ class ezcGraphChartElementNumericAxis extends ezcGraphChartElementAxis $yStepsize = ( $end->y - $start->y ) / $steps; // Caluclate datafree chart border - $xBorder = abs ( ( $boundings->x1 - $boundings->x0 ) * ( $this->padding / 2 ) ); - $yBorder = abs ( ( $boundings->y1 - $boundings->y0 ) * ( $this->padding / 2 ) ); + $xBorder = abs ( ( $boundings->x1 - $boundings->x0 ) * ( $this->axisSpace / 2 ) ); + $yBorder = abs ( ( $boundings->y1 - $boundings->y0 ) * ( $this->axisSpace / 2 ) ); for ( $i = 0; $i <= $steps; ++$i ) { |