diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-12 11:44:21 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-12 11:44:21 +0000 |
commit | 378316b058f3d1fbe1662d102e6dc08124be8780 (patch) | |
tree | 82093b6dcbba6a83a1739d3dedd9dd740f1d2093 /src/charts/pie.php | |
parent | cbb748d7d430f2244839ed37ada0647a020ce7cd (diff) | |
download | zetacomponents-graph-378316b058f3d1fbe1662d102e6dc08124be8780.zip zetacomponents-graph-378316b058f3d1fbe1662d102e6dc08124be8780.tar.gz |
- Moved pie chart options to own option class
Diffstat (limited to 'src/charts/pie.php')
-rw-r--r-- | src/charts/pie.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/charts/pie.php b/src/charts/pie.php index 118be7c..9e4ac5b 100644 --- a/src/charts/pie.php +++ b/src/charts/pie.php @@ -15,13 +15,9 @@ class ezcGraphPieChart extends ezcGraphChart { - protected $maxLabelHeight = .15; - - protected $label = '%1$s: %2$d (%3$.1f%%)'; - public function __construct( array $options = array() ) { - $this->options = new ezcGraphChartOptions( $options ); + $this->options = new ezcGraphPieChartOptions( $options ); parent::__construct( $options ); } @@ -106,7 +102,7 @@ class ezcGraphPieChart extends ezcGraphChart (int) round( cos( deg2rad( $middle ) ) * $radius * 2 / 3 + $center->x ), (int) round( sin( deg2rad( $middle ) ) * $radius * 2 / 3 + $center->y ) ), - sprintf( $this->label, $label, $value, $value * 100 / $sum ) + sprintf( $this->options->label, $label, $value, $value * 100 / $sum ) ); $angle = $endAngle; } @@ -114,10 +110,10 @@ class ezcGraphPieChart extends ezcGraphChart $labelHeight = (int) round( min( ( $boundings->y1 - $boundings->y0 ) / count( $labels[0] ), ( $boundings->y1 - $boundings->y0 ) / count( $labels[1] ), - ( $boundings->y1 - $boundings->y0 ) * $this->maxLabelHeight + ( $boundings->y1 - $boundings->y0 ) * $this->options->maxLabelHeight ) ); - $symbolSize = 6; + $symbolSize = $this->options->symbolSize; // Finally draw labels foreach ( $labels as $side => $labelPart ) |