summaryrefslogtreecommitdiffstats
path: root/tests/numeric_axis_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2008-01-07 09:05:00 +0000
committerKore Nordmann <github@kore-nordmann.de>2008-01-07 09:05:00 +0000
commitbd8a1c9052a0c97f374a760618ea04bdda3d79d3 (patch)
treeda184a102af680468403fa85880f68dead0b300e /tests/numeric_axis_test.php
parent38fe4b46581adecc69ef2c44baa2753856d3b8f3 (diff)
downloadzetacomponents-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.php66
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();
OpenPOWER on IntegriCloud