diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-07-13 17:33:46 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-07-13 17:33:46 +0000 |
commit | 14f4f83b181822bb65c55ca76eb0e28157ba43b4 (patch) | |
tree | 576656980d94b2ddcf05d3f1c4784a336c1971ce | |
parent | 70674b102034998db08071c26e6ff0f801d4c1b9 (diff) | |
download | zetacomponents-graph-14f4f83b181822bb65c55ca76eb0e28157ba43b4.zip zetacomponents-graph-14f4f83b181822bb65c55ca76eb0e28157ba43b4.tar.gz |
- Fixed pie chart labeling
- Fixed some test cases
-rw-r--r-- | src/charts/pie.php | 2 | ||||
-rw-r--r-- | tests/data/compare/ezcGraphCompleteRenderingTest_testRenderPieChart.png | bin | 82956 -> 82033 bytes | |||
-rw-r--r-- | tests/pie_test.php | 10 | ||||
-rw-r--r-- | tests/renderer_2d_test.php | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/charts/pie.php b/src/charts/pie.php index 0abf6a8..f886c36 100644 --- a/src/charts/pie.php +++ b/src/charts/pie.php @@ -72,7 +72,7 @@ class ezcGraphPieChart extends ezcGraphChart $dataset->color[$label], $angle, $angle += $value / $sum * 360, - sprintf( $this->options->label, $label, $value, $sum / $value * 100 ), + sprintf( $this->options->label, $label, $value, $value / $sum * 100 ), $dataset->highlight[$label] ); } diff --git a/tests/data/compare/ezcGraphCompleteRenderingTest_testRenderPieChart.png b/tests/data/compare/ezcGraphCompleteRenderingTest_testRenderPieChart.png Binary files differindex 3270033..109163d 100644 --- a/tests/data/compare/ezcGraphCompleteRenderingTest_testRenderPieChart.png +++ b/tests/data/compare/ezcGraphCompleteRenderingTest_testRenderPieChart.png diff --git a/tests/pie_test.php b/tests/pie_test.php index ccf88a8..4783cde 100644 --- a/tests/pie_test.php +++ b/tests/pie_test.php @@ -107,7 +107,7 @@ class ezcGraphPieChartTest extends ezcTestCase $this->equalTo( ezcGraphColor::fromHex( '#4E9A06' ) ), $this->equalTo( 0., 1. ), $this->equalTo( 220.5, .1 ), - $this->equalTo( 'Mozilla' ), + $this->equalTo( 'Mozilla: 4375 (61.3%)' ), $this->equalTo( false ) ); $mockedRenderer @@ -118,7 +118,7 @@ class ezcGraphPieChartTest extends ezcTestCase $this->equalTo( ezcGraphColor::fromHex( '#CC0000' ) ), $this->equalTo( 220.5, .1 ), $this->equalTo( 238., 1. ), - $this->equalTo( 'IE' ), + $this->equalTo( 'IE: 345 (4.8%)' ), $this->equalTo( false ) ); $mockedRenderer @@ -129,7 +129,7 @@ class ezcGraphPieChartTest extends ezcTestCase $this->equalTo( ezcGraphColor::fromHex( '#EDD400' ) ), $this->equalTo( 238., 1. ), $this->equalTo( 298.6, 1. ), - $this->equalTo( 'Opera' ), + $this->equalTo( 'Opera: 1204 (16.9%)' ), $this->equalTo( false ) ); $mockedRenderer @@ -140,7 +140,7 @@ class ezcGraphPieChartTest extends ezcTestCase $this->equalTo( ezcGraphColor::fromHex( '#75505B' ) ), $this->equalTo( 298.6, 1. ), $this->equalTo( 310., 1. ), - $this->equalTo( 'wget' ), + $this->equalTo( 'wget: 231 (3.2%)' ), $this->equalTo( true ) ); $mockedRenderer @@ -151,7 +151,7 @@ class ezcGraphPieChartTest extends ezcTestCase $this->equalTo( ezcGraphColor::fromHex( '#F57900' ) ), $this->equalTo( 310., 1. ), $this->equalTo( 360., 1. ), - $this->equalTo( 'Safari' ), + $this->equalTo( 'Safari: 987 (13.8%)' ), $this->equalTo( false ) ); diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php index 41ed9d8..04cd408 100644 --- a/tests/renderer_2d_test.php +++ b/tests/renderer_2d_test.php @@ -101,7 +101,7 @@ class ezcGraphRenderer2dTest extends ezcTestCase ->expects( $this->at( 3 ) ) ->method( 'drawCircle' ) ->with( - $this->equalTo( new ezcGraphCoordinate( 202., 157. ), 1. ), + $this->equalTo( new ezcGraphCoordinate( 205., 160. ), 1. ), $this->equalTo( 6 ), $this->equalTo( 6 ), $this->equalTo( ezcGraphColor::fromHex( '#000000' ) ), @@ -111,7 +111,7 @@ class ezcGraphRenderer2dTest extends ezcTestCase ->expects( $this->at( 4 ) ) ->method( 'drawCircle' ) ->with( - $this->equalTo( new ezcGraphCoordinate( 289.5, 147. ), 1. ), + $this->equalTo( new ezcGraphCoordinate( 292.5, 150. ), 1. ), $this->equalTo( 6 ), $this->equalTo( 6 ), $this->equalTo( ezcGraphColor::fromHex( '#000000' ) ), |