diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-19 15:06:09 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-19 15:06:09 +0000 |
commit | c3111edf8caa488c6c27fda8c2d5b923aaaa0337 (patch) | |
tree | 2b5449a854f53b1211a06a5eb526b97eb56f04c3 /tests/numeric_axis_test.php | |
parent | 1cedba6d288b3b4ec1e48023725b2fdcaba78656 (diff) | |
download | zetacomponents-graph-c3111edf8caa488c6c27fda8c2d5b923aaaa0337.zip zetacomponents-graph-c3111edf8caa488c6c27fda8c2d5b923aaaa0337.tar.gz |
- Use custom minimum and maximum values on numeric axis for automatic scaling
Diffstat (limited to 'tests/numeric_axis_test.php')
-rw-r--r-- | tests/numeric_axis_test.php | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/tests/numeric_axis_test.php b/tests/numeric_axis_test.php index f6cc687..688b509 100644 --- a/tests/numeric_axis_test.php +++ b/tests/numeric_axis_test.php @@ -300,6 +300,103 @@ class ezcGraphNumericAxisTest extends ezcTestCase ); } + public function testMixedAutomagicAndManualScaling2() + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 ); + $chart->yAxis->min = 0; + $chart->render( 500, 200 ); + + $this->assertEquals( + 0., + $chart->yAxis->min, + 'As value for: min; ' + ); + + $this->assertEquals( + 1500., + $chart->yAxis->max, + 'As value for: max; ' + ); + + $this->assertEquals( + 500., + $chart->yAxis->majorStep, + 'As value for: majorStep; ' + ); + + $this->assertEquals( + 100., + $chart->yAxis->minorStep, + 'As value for: minorStep; ' + ); + } + + public function testMixedAutomagicAndManualScaling3() + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 ); + $chart->yAxis->max = 2000; + $chart->render( 500, 200 ); + + $this->assertEquals( + 1000., + $chart->yAxis->min, + 'As value for: min; ' + ); + + $this->assertEquals( + 2000., + $chart->yAxis->max, + 'As value for: max; ' + ); + + $this->assertEquals( + 250., + $chart->yAxis->majorStep, + 'As value for: majorStep; ' + ); + + $this->assertEquals( + 50., + $chart->yAxis->minorStep, + 'As value for: minorStep; ' + ); + } + + public function testMixedAutomagicAndManualScaling4() + { + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 ); + $chart->yAxis->min = 0; + $chart->yAxis->max = 2000; + $chart->render( 500, 200 ); + + $this->assertEquals( + 0., + $chart->yAxis->min, + 'As value for: min; ' + ); + + $this->assertEquals( + 2000., + $chart->yAxis->max, + 'As value for: max; ' + ); + + $this->assertEquals( + 1000., + $chart->yAxis->majorStep, + 'As value for: majorStep; ' + ); + + $this->assertEquals( + 250., + $chart->yAxis->minorStep, + 'As value for: minorStep; ' + ); + } + public function testPositionLeft() { $chart = ezcGraph::create( 'Line' ); |