diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-08 13:17:08 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-08 13:17:08 +0000 |
commit | cb55e4811f591b3db7f85519d500b4a0cfd88bf5 (patch) | |
tree | 7c9d08c3c03362565889b2f3d9548eb1a544f255 /tests/labeled_axis_test.php | |
parent | 2a50296ac7f6ff7c615baf8cbbf667b1ed509106 (diff) | |
download | zetacomponents-graph-cb55e4811f591b3db7f85519d500b4a0cfd88bf5.zip zetacomponents-graph-cb55e4811f591b3db7f85519d500b4a0cfd88bf5.tar.gz |
- Handle Much data points with labeled axis
Diffstat (limited to 'tests/labeled_axis_test.php')
-rw-r--r-- | tests/labeled_axis_test.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php index 009c3e7..767cbe3 100644 --- a/tests/labeled_axis_test.php +++ b/tests/labeled_axis_test.php @@ -448,6 +448,57 @@ class ezcGraphLabeledAxisTest extends ezcTestCase $chart->render( 500, 200 ); } + + public function testRenderLabeledAxisWithManyPoints() + { + $data = array(); + for ( $i = -100; $i <= 500; ++$i ) + { + $data[$i] = 25 * sin( $i / 50 ); + } + $chart = ezcGraph::create( 'Line' ); + $chart->sinus = $data; + + $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( + 'drawTextBox', + ) ); + + // X-Axis + $mockedRenderer + ->expects( $this->at( 1 ) ) + ->method( 'drawTextBox' ) + ->with( + $this->equalTo( new ezcGraphCoordinate( 122, 102 ) ), + $this->equalTo( '-100' ), + $this->equalTo( 31 ), + $this->equalTo( 8 ), + $this->equalTo( ezcGraph::LEFT | ezcGraph::TOP ) + ); + $mockedRenderer + ->expects( $this->at( 2 ) ) + ->method( 'drawTextBox' ) + ->with( + $this->equalTo( new ezcGraphCoordinate( 155, 102 ) ), + $this->equalTo( '-40' ), + $this->equalTo( 31 ), + $this->equalTo( 8 ), + $this->equalTo( ezcGraph::CENTER | ezcGraph::TOP ) + ); + $mockedRenderer + ->expects( $this->at( 11 ) ) + ->method( 'drawTextBox' ) + ->with( + $this->equalTo( new ezcGraphCoordinate( 450, 102 ) ), + $this->equalTo( '500' ), + $this->equalTo( 31 ), + $this->equalTo( 8 ), + $this->equalTo( ezcGraph::RIGHT | ezcGraph::TOP ) + ); + + $chart->renderer = $mockedRenderer; + + $chart->render( 500, 200 ); + } } ?> |