diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2008-01-07 09:05:00 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2008-01-07 09:05:00 +0000 |
commit | bd8a1c9052a0c97f374a760618ea04bdda3d79d3 (patch) | |
tree | da184a102af680468403fa85880f68dead0b300e /tests/numeric_axis_test.php | |
parent | 38fe4b46581adecc69ef2c44baa2753856d3b8f3 (diff) | |
download | zetacomponents-graph-bd8a1c9052a0c97f374a760618ea04bdda3d79d3.zip zetacomponents-graph-bd8a1c9052a0c97f374a760618ea04bdda3d79d3.tar.gz |
- Fixed issue #12295: Broken automatic scaling with manually set min value,
not divisible by major step
Diffstat (limited to 'tests/numeric_axis_test.php')
-rw-r--r-- | tests/numeric_axis_test.php | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/numeric_axis_test.php b/tests/numeric_axis_test.php index 9c84621..8ec4c77 100644 --- a/tests/numeric_axis_test.php +++ b/tests/numeric_axis_test.php @@ -488,6 +488,72 @@ class ezcGraphNumericAxisTest extends ezcTestCase ); } + public function testMixedAutomagicAndManualScaling7() + { + $chart = new ezcGraphLineChart(); + $chart->data['sample'] = new ezcGraphArrayDataSet( array( 113.5, 1800, -45 ) ); + $chart->yAxis->majorStep = 500; + $chart->yAxis->min = -100; + $chart->render( 500, 200 ); + + $this->assertEquals( + -100, + $chart->yAxis->min, + 'As value for: min; ' + ); + + $this->assertEquals( + 1900, + $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 testMixedAutomagicAndManualScaling8() + { + $chart = new ezcGraphLineChart(); + $chart->data['sample'] = new ezcGraphArrayDataSet( array( 113.5, 1800, -45 ) ); + $chart->yAxis->majorStep = 500; + $chart->yAxis->max = 1900; + $chart->render( 500, 200 ); + + $this->assertEquals( + -100, + $chart->yAxis->min, + 'As value for: min; ' + ); + + $this->assertEquals( + 1900, + $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 testPositionLeft() { $chart = new ezcGraphLineChart(); |