summaryrefslogtreecommitdiffstats
path: root/tests/labeled_axis_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-08 13:17:08 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-08 13:17:08 +0000
commitcb55e4811f591b3db7f85519d500b4a0cfd88bf5 (patch)
tree7c9d08c3c03362565889b2f3d9548eb1a544f255 /tests/labeled_axis_test.php
parent2a50296ac7f6ff7c615baf8cbbf667b1ed509106 (diff)
downloadzetacomponents-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.php51
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 );
+ }
}
?>
OpenPOWER on IntegriCloud