logo       

4139 - in trunk/Graph: . src/renderer tests tests/data/compare [eZComponent: msg#00312

web.ezcomponents.cvs

Subject: 4139 - in trunk/Graph: . src/renderer tests tests/data/compare [eZComponents: Trunk]

Author: Kore Nordmann
Date: 2006-11-30 10:00:07 +0100 (Thu, 30 Nov 2006)
New Revision: 4139

Log:
- Fixed: Bug #9655 (pieChartOffset and highlight do not work together in 2d
renderer)

Added:

trunk/Graph/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithHighlightAndOffset.svg
Modified:
trunk/Graph/ChangeLog
trunk/Graph/src/renderer/2d.php
trunk/Graph/tests/renderer_2d_test.php

Modified: trunk/Graph/ChangeLog
===================================================================
--- trunk/Graph/ChangeLog 2006-11-30 08:56:48 UTC (rev 4138)
+++ trunk/Graph/ChangeLog 2006-11-30 09:00:07 UTC (rev 4139)
@@ -5,8 +5,10 @@
- Renamed pie chart options percentTreshHold to percentThreshold and
absoluteTreshHold to absoluteThreshold

+- Fixed issue #9655: pieChartOffset and highlight do not work together in 2d
+ renderer
+- Fixed issue #9586: No data rendered with string keys on date axis.
- Fixed issue #9583: Data typecasting should only be done in axis
-- Fixed issue #9586: No data rendered with string keys on date axis.

1.0beta2 - Monday 20 November 2006
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Modified: trunk/Graph/src/renderer/2d.php
===================================================================
--- trunk/Graph/src/renderer/2d.php 2006-11-30 08:56:48 UTC (rev 4138)
+++ trunk/Graph/src/renderer/2d.php 2006-11-30 09:00:07 UTC (rev 4139)
@@ -120,6 +120,10 @@
$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 @@
// 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 @@
'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

Added:
trunk/Graph/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithHighlightAndOffset.svg
===================================================================
---
trunk/Graph/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithHighlightAndOffset.svg
2006-11-30 08:56:48 UTC (rev 4138)
+++
trunk/Graph/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithHighlightAndOffset.svg
2006-11-30 09:00:07 UTC (rev 4139)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="500" height="200" version="1.0"
id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality"
shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path
d=" M 0.0000,200.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,200.0000 L
0.0000,200.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;"
id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L
100.0000,0.0000 L 100.0000,200.0000 L 0.0000,200.0000 z " style="fill: #000000;
fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M
2.0000,16.0000 L 2.0000,2.0000 L 16.0000,2.0000 L 16.0000,16.0000 L
2.0000,16.0000 z " style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;"
id="ezcGraphPolygon_3"/><path d=" M 2.0000,34.0000 L 2.0000,20.0000 L
16.0000,20.0000 L 16.0000,34.0000 L 2.0000,34.0000 z " style="fill: #cc000
0; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_5"/><path d=" M
2.0000,52.0000 L 2.0000,38.0000 L 16.0000,38.0000 L 16.0000,52.0000 L
2.0000,52.0000 z " style="fill: #edd400; fill-opacity: 1.00; stroke: none;"
id="ezcGraphPolygon_7"/><path d=" M 2.0000,70.0000 L 2.0000,56.0000 L
16.0000,56.0000 L 16.0000,70.0000 L 2.0000,70.0000 z " style="fill: #75505b;
fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_9"/><path d=" M
2.0000,88.0000 L 2.0000,74.0000 L 16.0000,74.0000 L 16.0000,88.0000 L
2.0000,88.0000 z " style="fill: #f57900; fill-opacity: 1.00; stroke: none;"
id="ezcGraphPolygon_11"/><path d="M 300.00,100.00 L 321.77,187.33 A 90.00,90.00
0 1,1 340.19,19.47 z" style="fill: #4e9a06; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircleSector_13"/><path d="M 300.00,100.00 L 321.77,187.33 A
90.00,90.00 0 1,1 340.19,19.47 z" style="fill: none; stroke: #274d03;
stroke-width
: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;"
id="ezcGraphCircleSector_14"/><path d="M 300.00,100.00 L 340.19,19.47 A
90.00,90.00 0 0,1 362.42,35.17 z" style="fill: #cc0000; fill-opacity: 1.00;
stroke: none;" id="ezcGraphCircleSector_15"/><path d="M 300.00,100.00 L
340.19,19.47 A 90.00,90.00 0 0,1 362.42,35.17 z" style="fill: none; stroke:
#660000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round;
stroke-linejoin: round;" id="ezcGraphCircleSector_16"/><path d="M 300.00,100.00
L 362.42,35.17 A 90.00,90.00 0 0,1 387.09,122.69 z" style="fill: #edd400;
fill-opacity: 1.00; stroke: none;" id="ezcGraphCircleSector_17"/><path d="M
300.00,100.00 L 362.42,35.17 A 90.00,90.00 0 0,1 387.09,122.69 z" style="fill:
none; stroke: #776a00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap:
round; stroke-linejoin: round;" id="ezcGraphCircleSector_18"/><path d
="M 300.00,100.00 L 387.09,122.69 A 90.00,90.00 0 0,1 380.72,139.80 z"
style="fill: #75505b; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircleSector_19"/><path d="M 300.00,100.00 L 387.09,122.69 A
90.00,90.00 0 0,1 380.72,139.80 z" style="fill: none; stroke: #3b282e;
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin:
round;" id="ezcGraphCircleSector_20"/><path d="M 306.28,107.79 L 387.00,147.59
A 90.00,90.00 0 0,1 328.05,195.11 z" style="fill: #f57900; fill-opacity: 1.00;
stroke: none;" id="ezcGraphCircleSector_21"/><path d="M 306.28,107.79 L
387.00,147.59 A 90.00,90.00 0 0,1 328.05,195.11 z" style="fill: none; stroke:
#7b3d00; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round;
stroke-linejoin: round;" id="ezcGraphCircleSector_22"/><path d=" M
233.7313,92.7269 L 194.6068,89.0000" style="fill: none; stroke: #000000;
stroke-width: 1; stroke-opac
ity: 1.00; stroke-linecap: round; stroke-linejoin: round;"
id="ezcGraphLine_23"/><ellipse cx="233.73125529542" cy="92.726904391935" rx="3"
ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircle_24"/><ellipse cx="194.60684128171" cy="89" rx="3" ry="3"
style="fill: #000000; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircle_25"/><path d=" M 338.4493,45.5381 L 363.2364,18.0000"
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00;
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><ellipse
cx="338.44926663939" cy="45.538101948814" rx="3" ry="3" style="fill: #000000;
fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_28"/><ellipse
cx="363.23635208502" cy="18" rx="3" ry="3" style="fill: #000000; fill-opacity:
1.00; stroke: none;" id="ezcGraphCircle_29"/><path d=" M 364.1672,81.9163 L
402.0000,72.0000" style="fill: non
e; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00; stroke-linecap:
round; stroke-linejoin: round;" id="ezcGraphLine_31"/><ellipse
cx="364.16715269617" cy="81.91627916298" rx="3" ry="3" style="fill: #000000;
fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_32"/><ellipse cx="402"
cy="72" rx="3" ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircle_33"/><path d=" M 362.4744,123.2679 L 400.0425,134.0000"
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 1.00;
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><ellipse
cx="362.47437378236" cy="123.26794071133" rx="3" ry="3" style="fill: #000000;
fill-opacity: 1.00; stroke: none;" id="ezcGraphCircle_36"/><ellipse
cx="400.04254356407" cy="134" rx="3" ry="3" style="fill: #000000; fill-opacity:
1.00; stroke: none;" id="ezcGraphCircle_37"/><path d=" M 348.1182,159.68
60 L 358.6783,185.0000" style="fill: none; stroke: #000000; stroke-width: 1;
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;"
id="ezcGraphLine_39"/><ellipse cx="348.11819704604" cy="159.68598571538" rx="3"
ry="3" style="fill: #000000; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircle_40"/><ellipse cx="358.67826876426" cy="185" rx="3" ry="3"
style="fill: #000000; fill-opacity: 1.00; stroke: none;"
id="ezcGraphCircle_41"/><text id="ezcGraphTextBox_4" x="17"
text-length="51.94px" y="13.9" style="font-size: 14px; font-family: sans-serif;
fill: #2e3436; fill-opacity: 1.00; stroke: none;">Mozilla</text><text
id="ezcGraphTextBox_6" x="17" text-length="14.84px" y="31.9" style="font-size:
14px; font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke:
none;">IE</text><text id="ezcGraphTextBox_8" x="17" text-length="37.1px"
y="49.9" style="font-size: 14px; font
-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke:
none;">Opera</text><text id="ezcGraphTextBox_10" x="17" text-length="29.68px"
y="67.9" style="font-size: 14px; font-family: sans-serif; fill: #2e3436;
fill-opacity: 1.00; stroke: none;">wget</text><text id="ezcGraphTextBox_12"
x="17" text-length="44.52px" y="85.9" style="font-size: 14px; font-family:
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke:
none;">Safari</text><text id="ezcGraphTextBox_26" x="126.59684128171"
text-length="62.01px" y="87.6" style="font-size: 9px; font-family: sans-serif;
fill: #2e3436; fill-opacity: 1.00; stroke: none;">Mozilla: 4375</text><text
id="ezcGraphTextBox_26" x="155.21684128171" text-length="33.39px" y="97.5"
style="font-size: 9px; font-family: sans-serif; fill: #2e3436; fill-opacity:
1.00; stroke: none;">(61.3%)</text><text id="ezcGraphTextBox_30"
x="369.23635208502" text-length="66
.78px" y="21.15" style="font-size: 9px; font-family: sans-serif; fill:
#2e3436; fill-opacity: 1.00; stroke: none;">IE: 345 (4.8%)</text><text
id="ezcGraphTextBox_34" x="408" text-length="90.63px" y="75.15"
style="font-size: 9px; font-family: sans-serif; fill: #2e3436; fill-opacity:
1.00; stroke: none;">Opera: 1204 (16.9%)</text><text id="ezcGraphTextBox_38"
x="406.04254356407" text-length="76.32px" y="137.15" style="font-size: 9px;
font-family: sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke:
none;">wget: 231 (3.2%)</text><text id="ezcGraphTextBox_42" x="364.67826876426"
text-length="90.63px" y="188.15" style="font-size: 9px; font-family:
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Safari: 987
(13.8%)</text></g></svg>


Property changes on:
trunk/Graph/tests/data/compare/ezcGraphRenderer2dTest_testRenderPieChartWithHighlightAndOffset.svg
___________________________________________________________________
Name: svn:eol-style
+ native

Modified: trunk/Graph/tests/renderer_2d_test.php
===================================================================
--- trunk/Graph/tests/renderer_2d_test.php 2006-11-30 08:56:48 UTC (rev
4138)
+++ trunk/Graph/tests/renderer_2d_test.php 2006-11-30 09:00:07 UTC (rev
4139)
@@ -1687,6 +1687,32 @@
);
}

+ public function testRenderPieChartWithHighlightAndOffset()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphPieChart();
+ $chart->data['sample'] = new ezcGraphArrayDataSet( array(
+ 'Mozilla' => 4375,
+ 'IE' => 345,
+ 'Opera' => 1204,
+ 'wget' => 231,
+ 'Safari' => 987,
+ ) );
+
+ $chart->data['sample']->highlight['Safari'] = true;
+
+ $chart->renderer->options->pieChartOffset = 76;
+
+ $chart->driver = new ezcGraphSvgDriver();
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ .
'.svg'
+ );
+ }
+
public function testRenderPieChartWithBackgroundBottomRight()
{
$filename = $this->tempDir . __FUNCTION__ . '.svg';



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise