From 5494f63476e4baa446b017e32755b087d32c1255 Mon Sep 17 00:00:00 2001 From: Kore Nordmann Date: Thu, 18 Jan 2007 11:24:32 +0000 Subject: - Fixed issue #10018: axis scale incorrect when startDate != first day of month --- .../ezcGraphDateAxisTest_testMonthInterval1.svg | 2 + .../ezcGraphDateAxisTest_testMonthInterval2.svg | 2 + tests/date_axis_test.php | 48 ++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg create mode 100644 tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg (limited to 'tests') diff --git a/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg b/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg new file mode 100644 index 0000000..5bf792a --- /dev/null +++ b/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg @@ -0,0 +1,2 @@ + +some dataOct 06Oct 06Nov 06Dec 06678 diff --git a/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg b/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg new file mode 100644 index 0000000..0df8f65 --- /dev/null +++ b/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg @@ -0,0 +1,2 @@ + +some dataOct 06Nov 06Dec 06Jan 07678 diff --git a/tests/date_axis_test.php b/tests/date_axis_test.php index aecd37e..b4b3a97 100644 --- a/tests/date_axis_test.php +++ b/tests/date_axis_test.php @@ -501,6 +501,54 @@ class ezcGraphDateAxisTest extends ezcGraphTestCase $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' ); } + + public function testMonthInterval1() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $this->chart->data['some data'] = new ezcGraphArrayDataSet( array( + strtotime( '2006-10-16' ) => 7.78507871321, + strtotime( '2006-10-30' ) => 7.52224503765, + strtotime( '2006-11-20' ) => 7.29226557153, + strtotime( '2006-11-28' ) => 7.06228610541, + strtotime( '2006-12-05' ) => 6.66803559206, + strtotime( '2006-12-11' ) => 6.37234770705, + strtotime( '2006-12-28' ) => 6.04517453799, + ) ); + $this->chart->data['some data']->symbol = ezcGraph::DIAMOND; + $this->chart->xAxis->startDate = strtotime( '2006-10-01' ); + + $this->chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } + + public function testMonthInterval2() + { + $filename = $this->tempDir . __FUNCTION__ . '.svg'; + + $this->chart->data['some data'] = new ezcGraphArrayDataSet( array( + strtotime( '2006-10-16' ) => 7.78507871321, + strtotime( '2006-10-30' ) => 7.52224503765, + strtotime( '2006-11-20' ) => 7.29226557153, + strtotime( '2006-11-28' ) => 7.06228610541, + strtotime( '2006-12-05' ) => 6.66803559206, + strtotime( '2006-12-11' ) => 6.37234770705, + strtotime( '2006-12-28' ) => 6.04517453799, + ) ); + $this->chart->xAxis->startDate = strtotime( '2006-10-04' ); + $this->chart->data['some data']->symbol = ezcGraph::DIAMOND; + + $this->chart->render( 500, 200, $filename ); + + $this->compare( + $filename, + $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg' + ); + } } ?> -- cgit v1.1