diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-08 16:00:09 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-08 16:00:09 +0000 |
commit | f98ef3a072c9469d99d6f78c7b0fc33f74cccda5 (patch) | |
tree | 3bf725e75408adb9794c090ee86f9c9dad508a2a /tests/labeled_axis_test.php | |
parent | a06f707fb0f0721d42c1c603423def575161aca2 (diff) | |
download | zetacomponents-graph-f98ef3a072c9469d99d6f78c7b0fc33f74cccda5.zip zetacomponents-graph-f98ef3a072c9469d99d6f78c7b0fc33f74cccda5.tar.gz |
- Added grids to line charts (tests & implementation)
Diffstat (limited to 'tests/labeled_axis_test.php')
-rw-r--r-- | tests/labeled_axis_test.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php index 767cbe3..c5736a6 100644 --- a/tests/labeled_axis_test.php +++ b/tests/labeled_axis_test.php @@ -392,6 +392,59 @@ class ezcGraphLabeledAxisTest extends ezcTestCase $chart->render( 500, 200 ); } + public function testRenderNumericAxisMajorGrid() + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 ); + $chart->X_axis->grid = '#BBBBBB'; + + $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( + 'drawLine', + ) ); + + // X-Axis + $mockedRenderer + ->expects( $this->at( 1 ) ) + ->method( 'drawLine' ) + ->with( + $this->equalTo( ezcGraphColor::fromHex( '#BBBBBB' ) ), + $this->equalTo( new ezcGraphCoordinate( 120, 0 ) ), + $this->equalTo( new ezcGraphCoordinate( 120, 200 ) ), + $this->equalTo( false ) + ); + $mockedRenderer + ->expects( $this->at( 3 ) ) + ->method( 'drawLine' ) + ->with( + $this->equalTo( ezcGraphColor::fromHex( '#BBBBBB' ) ), + $this->equalTo( new ezcGraphCoordinate( 240, 0 ) ), + $this->equalTo( new ezcGraphCoordinate( 240, 200 ) ), + $this->equalTo( false ) + ); + $mockedRenderer + ->expects( $this->at( 5 ) ) + ->method( 'drawLine' ) + ->with( + $this->equalTo( ezcGraphColor::fromHex( '#BBBBBB' ) ), + $this->equalTo( new ezcGraphCoordinate( 361, 0 ) ), + $this->equalTo( new ezcGraphCoordinate( 361, 200 ) ), + $this->equalTo( false ) + ); + $mockedRenderer + ->expects( $this->at( 7 ) ) + ->method( 'drawLine' ) + ->with( + $this->equalTo( ezcGraphColor::fromHex( '#BBBBBB' ) ), + $this->equalTo( new ezcGraphCoordinate( 481, 0 ) ), + $this->equalTo( new ezcGraphCoordinate( 481, 200 ) ), + $this->equalTo( false ) + ); + + $chart->renderer = $mockedRenderer; + + $chart->render( 500, 200 ); + } + public function testRenderLabeledAxisLabels() { $chart = ezcGraph::create( 'Line' ); |