diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-03-05 14:51:14 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-03-05 14:51:14 +0000 |
commit | eff7a30681180181dc22b9500e6db45a7a916183 (patch) | |
tree | 25e8b982e8307e4c349b78a0066c909efb0891a9 /tests/renderer_3d_test.php | |
parent | 13e25053bf3b1583cebac63e072135ee017cfd67 (diff) | |
download | zetacomponents-graph-eff7a30681180181dc22b9500e6db45a7a916183.zip zetacomponents-graph-eff7a30681180181dc22b9500e6db45a7a916183.tar.gz |
- Added visual tests for depth in 3d renderer
Diffstat (limited to 'tests/renderer_3d_test.php')
-rw-r--r-- | tests/renderer_3d_test.php | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php index 3334d9b..35f2661 100644 --- a/tests/renderer_3d_test.php +++ b/tests/renderer_3d_test.php @@ -896,6 +896,102 @@ class ezcGraphRenderer3dTest extends ezcGraphTestCase ); } + public function testRenderLineChartWithSmallDepth() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $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']->symbol = ezcGraph::NO_SYMBOL; + $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']->symbol = ezcGraph::NO_SYMBOL; + + $chart->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->depth = .01; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderBarChartWithSmallDepth() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $chart = new ezcGraphBarChart(); + $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']->symbol = ezcGraph::NO_SYMBOL; + $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']->symbol = ezcGraph::NO_SYMBOL; + + $chart->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->depth = .01; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderLineChartWithDepth() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $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']->symbol = ezcGraph::NO_SYMBOL; + $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']->symbol = ezcGraph::NO_SYMBOL; + + $chart->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->depth = .5; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testRenderBarChartWithDepth() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $chart = new ezcGraphBarChart(); + $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']->symbol = ezcGraph::NO_SYMBOL; + $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']->symbol = ezcGraph::NO_SYMBOL; + + $chart->renderer = new ezcGraphRenderer3d(); + $chart->renderer->options->depth = .5; + + $chart->driver = new ezcGraphSvgDriver(); + $chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + public function testRender3dLineChartSmallMaxFontSize() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; |