diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-08-15 12:10:39 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-08-15 12:10:39 +0000 |
commit | 4c85aee953e34bb0f997af13fc9b35e5ed29699c (patch) | |
tree | c0d501e58acbcb00302e2d2ffdfcae0650eae590 /tests/renderer_3d_test.php | |
parent | e3f5f4876b49a8274979527fba29fcc004465f85 (diff) | |
download | zetacomponents-graph-4c85aee953e34bb0f997af13fc9b35e5ed29699c.zip zetacomponents-graph-4c85aee953e34bb0f997af13fc9b35e5ed29699c.tar.gz |
- Added implementation for bar charts to 3d renderer
Diffstat (limited to 'tests/renderer_3d_test.php')
-rw-r--r-- | tests/renderer_3d_test.php | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index 8b0074b..7491169 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -46,7 +46,10 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase */ public function tearDown() { - $this->removeTempDir(); + if( !$this->hasFailed() ) + { + $this->removeTempDir(); + } } public function testRenderBackgroundImage() @@ -559,6 +562,33 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase ); } + public function testRenderBarChart() + { + $filename = $this->tempDir . __FUNCTION__ . '.png'; + + $chart = new ezcGraphLineChart(); + $chart->palette = new ezcGraphPaletteBlack(); + + $chart->data['Line 0'] = new ezcGraphArrayDataSet( array( 'sample 1' => 432, 'sample 2' => 43, 'sample 3' => 65, 'sample 4' => 97, 'sample 5' => 154) ); + $chart->data['Line 0']->displayType = ezcGraph::BAR; + $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) ); + $chart->data['Line 1']->displayType = ezcGraph::BAR; + + $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer(); + + $chart->driver = new ezcGraphGdDriver(); + $chart->renderer = new ezcGraphRenderer3d(); + $chart->options->font = $this->basePath . 'font.ttf'; + $chart->render( 500, 200, $filename ); + + $this->assertImageSimilar( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.png', + 'Image does not look as expected.', + 2000 + ); + } + public function testRender3dLineChart() { $filename = $this->tempDir . __FUNCTION__ . '.png'; |