summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-11-30 09:00:07 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-11-30 09:00:07 +0000
commita624a3e637586a8efc327cd5e8e6021bf3546c00 (patch)
tree0105a96ccd6db32baf911a4fcda3338f322cb0d8 /src
parent0df549c064a08505b195eaa20e13cdf41c2d37e5 (diff)
downloadzetacomponents-graph-a624a3e637586a8efc327cd5e8e6021bf3546c00.zip
zetacomponents-graph-a624a3e637586a8efc327cd5e8e6021bf3546c00.tar.gz
- Fixed: Bug #9655 (pieChartOffset and highlight do not work together in 2d
renderer)
Diffstat (limited to 'src')
-rw-r--r--src/renderer/2d.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/renderer/2d.php b/src/renderer/2d.php
index c49b727..f2c7b61 100644
--- a/src/renderer/2d.php
+++ b/src/renderer/2d.php
@@ -120,6 +120,10 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
$label = false,
$moveOut = false )
{
+ // Apply offset
+ $startAngle += $this->options->pieChartOffset;
+ $endAngle += $this->options->pieChartOffset;
+
// Calculate position and size of pie
$center = new ezcGraphCoordinate(
$boundings->x0 + ( $boundings->width ) / 2,
@@ -135,7 +139,7 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
// Move pie segment out of the center
if ( $moveOut )
{
- $direction = $startAngle + ( $endAngle - $startAngle ) / 2;
+ $direction = ( $endAngle + $startAngle ) / 2;
$center = new ezcGraphCoordinate(
$center->x + $this->options->moveOut * $radius * cos( deg2rad( $direction ) ),
@@ -149,15 +153,15 @@ class ezcGraphRenderer2d extends ezcGraphRenderer
'context' => $context,
'width' => $radius * 2 * ( 1 - $this->options->moveOut ),
'height' => $radius * 2 * ( 1 - $this->options->moveOut ),
- 'start' => $startAngle + $this->options->pieChartOffset,
- 'end' => $endAngle + $this->options->pieChartOffset,
+ 'start' => $startAngle,
+ 'end' => $endAngle,
'color' => $color,
);
if ( $label )
{
// Determine position of label
- $direction = $startAngle + ( $endAngle - $startAngle ) / 2 + $this->options->pieChartOffset;
+ $direction = ( $endAngle + $startAngle ) / 2;
$pieSegmentCenter = new ezcGraphCoordinate(
$center->x + cos( deg2rad( $direction ) ) * $radius,
$center->y + sin( deg2rad( $direction ) ) * $radius
OpenPOWER on IntegriCloud