Author: Kore Nordmann
Date: 2007-01-18 12:24:32 +0100 (Thu, 18 Jan 2007)
New Revision: 4522

Log:
- Fixed issue #10018: axis scale incorrect when startDate != first day of month

Added:
   trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg
   trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg
Modified:
   trunk/Graph/ChangeLog
   trunk/Graph/src/axis/date.php
   trunk/Graph/tests/date_axis_test.php

Modified: trunk/Graph/ChangeLog
===================================================================
--- trunk/Graph/ChangeLog       2007-01-18 09:47:26 UTC (rev 4521)
+++ trunk/Graph/ChangeLog       2007-01-18 11:24:32 UTC (rev 4522)
@@ -7,6 +7,7 @@
   exception
 - Fixed issue #10025: Wrong statement in tutorial about swf versions supported
   by ext/ming
+- Fixed issue #10018: Axis scale incorrect when startDate != first day of month
 
 1.0 - Monday 18 December 2006
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Modified: trunk/Graph/src/axis/date.php
===================================================================
--- trunk/Graph/src/axis/date.php       2007-01-18 09:47:26 UTC (rev 4521)
+++ trunk/Graph/src/axis/date.php       2007-01-18 11:24:32 UTC (rev 4522)
@@ -32,6 +32,12 @@
 class ezcGraphChartElementDateAxis extends ezcGraphChartElementAxis
 {
     
+    const MONTH = 2629800;
+
+    const YEAR = 31536000;
+
+    const DECADE = 315360000;
+
     /**
      * Minimum inserted date
      * 
@@ -77,11 +83,11 @@
         // Week
         604800      => 'W',
         // Month
-        2629800     => 'M y',
+        self::MONTH => 'M y',
         // Year
-        31536000    => 'Y',
+        self::YEAR  => 'Y',
         // Decade
-        315360000   => 'Y',
+        self::DECADE => 'Y',
     );
 
     /**
@@ -227,35 +233,50 @@
      */
     protected function calculateLowerNiceDate( $min, $interval )
     {
-        $dateSteps = array( 60, 60, 24, 7, 52 );
+        switch ( $interval )
+        {
+            case self::MONTH:
+                // Special handling for months - not covered by the default 
+                // algorithm 
+                return mktime(
+                    1,
+                    0,
+                    0,
+                    (int) date( 'm', $min ),
+                    1,
+                    (int) date( 'Y', $min )
+                );
+            default:
+                $dateSteps = array( 60, 60, 24, 7, 52 );
 
-        $date = array(
-            (int) date( 's', $min ),
-            (int) date( 'i', $min ),
-            (int) date( 'H', $min ),
-            (int) date( 'd', $min ),
-            (int) date( 'm', $min ),
-            (int) date( 'Y', $min ),
-        );
+                $date = array(
+                    (int) date( 's', $min ),
+                    (int) date( 'i', $min ),
+                    (int) date( 'H', $min ),
+                    (int) date( 'd', $min ),
+                    (int) date( 'm', $min ),
+                    (int) date( 'Y', $min ),
+                );
 
-        $element = 0;
-        while ( ( $step = array_shift( $dateSteps ) ) &&
-                ( $interval > $step ) )
-        {
-            $interval /= $step;
-            $date[$element++] = (int) ( $element > 2 );
-        }
+                $element = 0;
+                while ( ( $step = array_shift( $dateSteps ) ) &&
+                        ( $interval > $step ) )
+                {
+                    $interval /= $step;
+                    $date[$element++] = (int) ( $element > 2 );
+                }
 
-        $date[$element] -= $date[$element] % $interval;
+                $date[$element] -= $date[$element] % $interval;
 
-        return mktime(
-            $date[2],
-            $date[1],
-            $date[0],
-            $date[4],
-            $date[3],
-            $date[5]
-        );
+                return mktime(
+                    $date[2],
+                    $date[1],
+                    $date[0],
+                    $date[4],
+                    $date[3],
+                    $date[5]
+                );
+        }
     }
 
     /**
@@ -287,7 +308,7 @@
      */
     public function calculateMaximum( $min, $max )
     {
-        $this->properties['endDate'] = $this->calculateLowerNiceDate( $max, 
$this->interval );
+        $this->properties['endDate'] = $this->properties['startDate'];
 
         while ( $this->properties['endDate'] < $max )
         {

Added: 
trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg
===================================================================
--- trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg  
2007-01-18 09:47:26 UTC (rev 4521)
+++ trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg  
2007-01-18 11:24:32 UTC (rev 4522)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="500" height="200" version="1.0" 
id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" 
shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path 
d=" M 0.0000,200.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,200.0000 L 
0.0000,200.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 
100.0000,0.0000 L 100.0000,200.0000 L 0.0000,200.0000 z " style="fill: #000000; 
fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M 
2.0000,9.0000 L 9.0000,2.0000 L 16.0000,9.0000 L 9.0000,16.0000 L 2.0000,9.0000 
z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_3"/><path d=" M 100.0000,180.0000 L 500.0000,180.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_5"/><path d=" 
M 492.0000,184.0000 L 500.0000,180.0000 L 492.0000,176.0000 L 492.0000,184.0000 
z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_6"/><path d=" M 140.0000,200.0000 L 140.0000,0.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_7"/><path d=" 
M 137.5000,5.0000 L 140.0000,0.0000 L 142.5000,5.0000 L 137.5000,5.0000 z " 
style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_8"/><path d=" M 245.6000,20.0000 L 245.6000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_10"/><path d=" 
M 246.6667,177.0000 L 246.6667,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_11"/><path d=" M 354.4000,20.0000 L 354.4000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_13"/><path d=" 
M 353.3333,177.0000 L 353.3333,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_14"/><path d=" M 460.0000,20.0000 L 460.0000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" 
M 460.0000,177.0000 L 460.0000,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_17"/><path d=" M 140.0000,180.0000 L 
460.0000,180.0000" style="fill: none; stroke: #000000; stroke-width: 1; 
stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_19"/><path d=" M 140.0000,180.0000 L 143.0000,180.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_20"/><path d=" 
M 140.0000,160.8000 L 460.0000,159.2000" style="fill: none; stroke: #000000; 
stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_22"/><path d=" M 140.0000,160.0000 L 
141.0000,160.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_23"/><path d=" M 140.0000,140.0000 L 460.0000,140.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_24"/><path d=" 
M 140.0000,140.0000 L 141.0000,140.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_25"/><path d=" M 140.0000,120.8000 L 
460.0000,119.2000" style="fill: none; stroke: #000000; stroke-width: 1; 
stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_26"/><path d=" M 140.0000,120.0000 L 141.0000,120.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" 
M 140.0000,100.0000 L 460.0000,100.0000" style="fill: none; stroke: #000000; 
stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_28"/><path d=" M 140.0000,100.0000 L 
143.0000,100.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_29"/><path d=" M 140.0000,80.8000 L 460.0000,79.2000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" 
M 140.0000,80.0000 L 141.0000,80.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_32"/><path d=" M 140.0000,60.0000 L 460.0000,60.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_33"/><path d=" 
M 140.0000,60.0000 L 141.0000,60.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_34"/><path d=" M 140.0000,40.8000 L 460.0000,39.2000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><path d=" 
M 140.0000,40.0000 L 141.0000,40.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_36"/><path d=" M 140.0000,20.0000 L 460.0000,20.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_37"/><path d=" 
M 140.0000,20.0000 L 143.0000,20.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_38"/><path d=" M 192.5667,37.1937 L 192.5667,37.1937" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" 
M 192.5667,37.1937 L 241.7750,58.2204" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_41"/><path d=" M 241.7750,58.2204 L 315.3685,76.6188" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_42"/><path d=" 
M 315.3685,76.6188 L 343.4041,95.0171" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_43"/><path d=" M 343.4041,95.0171 L 367.9352,126.5572" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_44"/><path d=" 
M 367.9352,126.5572 L 388.9619,150.2122" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_45"/><path d=" M 388.9619,150.2122 L 
448.5375,176.3860" style="fill: none; stroke: #3465a4; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_46"/><path d=" M 189.5667,37.1937 L 192.5667,34.1937 L 
195.5667,37.1937 L 192.5667,40.1937 L 189.5667,37.1937 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_47"/><path d=" 
M 238.7750,58.2204 L 241.7750,55.2204 L 244.7750,58.2204 L 241.7750,61.2204 L 
238.7750,58.2204 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_48"/><path d=" M 312.3685,76.6188 L 315.3685,73.6188 L 
318.3685,76.6188 L 315.3685,79.6188 L 312.3685,76.6188 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_49"/><path d=" 
M 340.4041,95.0171 L 343.4041,92.0171 L 346.4041,95.0171 L 343.4041,98.0171 L 
340.4041,95.0171 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_50"/><path d=" M 364.9352,126.5572 L 367.9352,123.5572 L 
370.9352,126.5572 L 367.9352,129.5572 L 364.9352,126.5572 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_51"/><path d=" 
M 385.9619,150.2122 L 388.9619,147.2122 L 391.9619,150.2122 L 388.9619,153.2122 
L 385.9619,150.2122 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: 
none;" id="ezcGraphPolygon_52"/><path d=" M 445.5375,176.3860 L 
448.5375,173.3860 L 451.5375,176.3860 L 448.5375,179.3860 L 445.5375,176.3860 z 
" style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_53"/><g id="ezcGraphTextBox_4"><path d=" M 16.5000,17.0000 
L 16.5000,1.5000 L 84.7800,1.5000 L 84.7800,17.0000 L 16.5000,17.0000 z " 
style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_54"/><text id="ezcGraphTextBox_4_text" x="17" 
text-length="66.78px" y="13.9" style="font-size: 14px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">some data</text></g><g 
id="ezcGraphTextBox_9"><path d=" M 141.5000,198.0000 L 141.5000,181.5000 L 
190.7000,181.5000 L 190.7000,198.0000 L 141.5000,198.0000 z " style="fill: 
#ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_55"/><text 
id="ezcGraphTextBox_9_text" x="142" text-length="47.7px" y="194.75" 
style="font-size: 15px; font-family: sans-serif; fill: #2e3436; fill-opacity: 
1.00; stroke: none;">Oct 06</text></g><g id="ezcGraphTextBox_12"><path d=" M 
248.1667,198.0000 L 248.1667,181.5000 L 297.3667,181.5000 L 297.3667,198.0000 L 
248.1667,198.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_56"/><text id="ezcGraphTextBox_12_text" x="248.6667" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Oct 
06</text></g><g id="ezcGraphTextBox_15"><path d=" M 354.8333,198.0000 L 
354.8333,181.5000 L 404.0333,181.5000 L 404.0333,198.0000 L 354.8333,198.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_57"/><text id="ezcGraphTextBox_15_text" x="355.3333" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Nov 
06</text></g><g id="ezcGraphTextBox_18"><path d=" M 409.8000,198.0000 L 
409.8000,181.5000 L 459.0000,181.5000 L 459.0000,198.0000 L 409.8000,198.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_58"/><text id="ezcGraphTextBox_18_text" x="410.3" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dec 
06</text></g><g id="ezcGraphTextBox_21"><path d=" M 128.2000,179.0000 L 
128.2000,162.5000 L 139.0000,162.5000 L 139.0000,179.0000 L 128.2000,179.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_59"/><text id="ezcGraphTextBox_21_text" x="128.7" 
text-length="9.3px" y="175.75" style="font-size: 15px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">6</text></g><g 
id="ezcGraphTextBox_30"><path d=" M 128.2000,99.0000 L 128.2000,82.5000 L 
139.0000,82.5000 L 139.0000,99.0000 L 128.2000,99.0000 z " style="fill: 
#ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_60"/><text 
id="ezcGraphTextBox_30_text" x="128.7" text-length="9.3px" y="95.75" 
style="font-size: 15px; font-family: sans-serif; fill: #2e3436; fill-opacity: 
1.00; stroke: none;">7</text></g><g id="ezcGraphTextBox_39"><path d=" M 
128.2000,38.0000 L 128.2000,21.5000 L 139.0000,21.5000 L 139.0000,38.0000 L 
128.2000,38.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_61"/><text id="ezcGraphTextBox_39_text" x="128.7" 
text-length="9.3px" y="34.75" style="font-size: 15px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">8</text></g></g></svg>


Property changes on: 
trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval1.svg
___________________________________________________________________
Name: svn:eol-style
   + native

Added: 
trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg
===================================================================
--- trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg  
2007-01-18 09:47:26 UTC (rev 4521)
+++ trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg  
2007-01-18 11:24:32 UTC (rev 4522)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"; width="500" height="200" version="1.0" 
id="ezcGraph"><defs/><g id="ezcGraphChart" color-rendering="optimizeQuality" 
shape-rendering="geometricPrecision" text-rendering="optimizeLegibility"><path 
d=" M 0.0000,200.0000 L 0.0000,0.0000 L 500.0000,0.0000 L 500.0000,200.0000 L 
0.0000,200.0000 z " style="fill: #eeeeec; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_1"/><path d=" M 0.0000,200.0000 L 0.0000,0.0000 L 
100.0000,0.0000 L 100.0000,200.0000 L 0.0000,200.0000 z " style="fill: #000000; 
fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_2"/><path d=" M 
2.0000,9.0000 L 9.0000,2.0000 L 16.0000,9.0000 L 9.0000,16.0000 L 2.0000,9.0000 
z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_3"/><path d=" M 100.0000,180.0000 L 500.0000,180.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_5"/><path d=" 
M 492.0000,184.0000 L 500.0000,180.0000 L 492.0000,176.0000 L 492.0000,184.0000 
z " style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_6"/><path d=" M 140.0000,200.0000 L 140.0000,0.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_7"/><path d=" 
M 137.5000,5.0000 L 140.0000,0.0000 L 142.5000,5.0000 L 137.5000,5.0000 z " 
style="fill: #2e3436; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_8"/><path d=" M 245.6000,20.0000 L 245.6000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_10"/><path d=" 
M 246.6667,177.0000 L 246.6667,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_11"/><path d=" M 354.4000,20.0000 L 354.4000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_13"/><path d=" 
M 353.3333,177.0000 L 353.3333,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_14"/><path d=" M 460.0000,20.0000 L 460.0000,180.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_16"/><path d=" 
M 460.0000,177.0000 L 460.0000,180.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_17"/><path d=" M 140.0000,180.0000 L 
460.0000,180.0000" style="fill: none; stroke: #000000; stroke-width: 1; 
stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_19"/><path d=" M 140.0000,180.0000 L 143.0000,180.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_20"/><path d=" 
M 140.0000,160.8000 L 460.0000,159.2000" style="fill: none; stroke: #000000; 
stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_22"/><path d=" M 140.0000,160.0000 L 
141.0000,160.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_23"/><path d=" M 140.0000,140.0000 L 460.0000,140.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_24"/><path d=" 
M 140.0000,140.0000 L 141.0000,140.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_25"/><path d=" M 140.0000,120.8000 L 
460.0000,119.2000" style="fill: none; stroke: #000000; stroke-width: 1; 
stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_26"/><path d=" M 140.0000,120.0000 L 141.0000,120.0000" 
style="fill: none; stroke: #2e3436; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_27"/><path d=" 
M 140.0000,100.0000 L 460.0000,100.0000" style="fill: none; stroke: #000000; 
stroke-width: 1; stroke-opacity: 0.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_28"/><path d=" M 140.0000,100.0000 L 
143.0000,100.0000" style="fill: none; stroke: #2e3436; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_29"/><path d=" M 140.0000,80.8000 L 460.0000,79.2000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_31"/><path d=" 
M 140.0000,80.0000 L 141.0000,80.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_32"/><path d=" M 140.0000,60.0000 L 460.0000,60.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_33"/><path d=" 
M 140.0000,60.0000 L 141.0000,60.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_34"/><path d=" M 140.0000,40.8000 L 460.0000,39.2000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_35"/><path d=" 
M 140.0000,40.0000 L 141.0000,40.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_36"/><path d=" M 140.0000,20.0000 L 460.0000,20.0000" 
style="fill: none; stroke: #000000; stroke-width: 1; stroke-opacity: 0.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_37"/><path d=" 
M 140.0000,20.0000 L 143.0000,20.0000" style="fill: none; stroke: #2e3436; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_38"/><path d=" M 182.0534,37.1937 L 182.0534,37.1937" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_40"/><path d=" 
M 182.0534,37.1937 L 231.2617,58.2204" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_41"/><path d=" M 231.2617,58.2204 L 304.8551,76.6188" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_42"/><path d=" 
M 304.8551,76.6188 L 332.8907,95.0171" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_43"/><path d=" M 332.8907,95.0171 L 357.4219,126.5572" 
style="fill: none; stroke: #3465a4; stroke-width: 1; stroke-opacity: 1.00; 
stroke-linecap: round; stroke-linejoin: round;" id="ezcGraphLine_44"/><path d=" 
M 357.4219,126.5572 L 378.4486,150.2122" style="fill: none; stroke: #3465a4; 
stroke-width: 1; stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: 
round;" id="ezcGraphLine_45"/><path d=" M 378.4486,150.2122 L 
438.0242,176.3860" style="fill: none; stroke: #3465a4; stroke-width: 1; 
stroke-opacity: 1.00; stroke-linecap: round; stroke-linejoin: round;" 
id="ezcGraphLine_46"/><path d=" M 179.0534,37.1937 L 182.0534,34.1937 L 
185.0534,37.1937 L 182.0534,40.1937 L 179.0534,37.1937 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_47"/><path d=" 
M 228.2617,58.2204 L 231.2617,55.2204 L 234.2617,58.2204 L 231.2617,61.2204 L 
228.2617,58.2204 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_48"/><path d=" M 301.8551,76.6188 L 304.8551,73.6188 L 
307.8551,76.6188 L 304.8551,79.6188 L 301.8551,76.6188 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_49"/><path d=" 
M 329.8907,95.0171 L 332.8907,92.0171 L 335.8907,95.0171 L 332.8907,98.0171 L 
329.8907,95.0171 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_50"/><path d=" M 354.4219,126.5572 L 357.4219,123.5572 L 
360.4219,126.5572 L 357.4219,129.5572 L 354.4219,126.5572 z " style="fill: 
#3465a4; fill-opacity: 1.00; stroke: none;" id="ezcGraphPolygon_51"/><path d=" 
M 375.4486,150.2122 L 378.4486,147.2122 L 381.4486,150.2122 L 378.4486,153.2122 
L 375.4486,150.2122 z " style="fill: #3465a4; fill-opacity: 1.00; stroke: 
none;" id="ezcGraphPolygon_52"/><path d=" M 435.0242,176.3860 L 
438.0242,173.3860 L 441.0242,176.3860 L 438.0242,179.3860 L 435.0242,176.3860 z 
" style="fill: #3465a4; fill-opacity: 1.00; stroke: none;" 
id="ezcGraphPolygon_53"/><g id="ezcGraphTextBox_4"><path d=" M 16.5000,17.0000 
L 16.5000,1.5000 L 84.7800,1.5000 L 84.7800,17.0000 L 16.5000,17.0000 z " 
style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_54"/><text id="ezcGraphTextBox_4_text" x="17" 
text-length="66.78px" y="13.9" style="font-size: 14px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">some data</text></g><g 
id="ezcGraphTextBox_9"><path d=" M 141.5000,198.0000 L 141.5000,181.5000 L 
190.7000,181.5000 L 190.7000,198.0000 L 141.5000,198.0000 z " style="fill: 
#ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_55"/><text 
id="ezcGraphTextBox_9_text" x="142" text-length="47.7px" y="194.75" 
style="font-size: 15px; font-family: sans-serif; fill: #2e3436; fill-opacity: 
1.00; stroke: none;">Oct 06</text></g><g id="ezcGraphTextBox_12"><path d=" M 
248.1667,198.0000 L 248.1667,181.5000 L 297.3667,181.5000 L 297.3667,198.0000 L 
248.1667,198.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_56"/><text id="ezcGraphTextBox_12_text" x="248.6667" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Nov 
06</text></g><g id="ezcGraphTextBox_15"><path d=" M 354.8333,198.0000 L 
354.8333,181.5000 L 404.0333,181.5000 L 404.0333,198.0000 L 354.8333,198.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_57"/><text id="ezcGraphTextBox_15_text" x="355.3333" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Dec 
06</text></g><g id="ezcGraphTextBox_18"><path d=" M 409.8000,198.0000 L 
409.8000,181.5000 L 459.0000,181.5000 L 459.0000,198.0000 L 409.8000,198.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_58"/><text id="ezcGraphTextBox_18_text" x="410.3" 
text-length="47.7px" y="194.75" style="font-size: 15px; font-family: 
sans-serif; fill: #2e3436; fill-opacity: 1.00; stroke: none;">Jan 
07</text></g><g id="ezcGraphTextBox_21"><path d=" M 128.2000,179.0000 L 
128.2000,162.5000 L 139.0000,162.5000 L 139.0000,179.0000 L 128.2000,179.0000 z 
" style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_59"/><text id="ezcGraphTextBox_21_text" x="128.7" 
text-length="9.3px" y="175.75" style="font-size: 15px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">6</text></g><g 
id="ezcGraphTextBox_30"><path d=" M 128.2000,99.0000 L 128.2000,82.5000 L 
139.0000,82.5000 L 139.0000,99.0000 L 128.2000,99.0000 z " style="fill: 
#ffffff; fill-opacity: 0.00; stroke: none;" id="ezcGraphPolygon_60"/><text 
id="ezcGraphTextBox_30_text" x="128.7" text-length="9.3px" y="95.75" 
style="font-size: 15px; font-family: sans-serif; fill: #2e3436; fill-opacity: 
1.00; stroke: none;">7</text></g><g id="ezcGraphTextBox_39"><path d=" M 
128.2000,38.0000 L 128.2000,21.5000 L 139.0000,21.5000 L 139.0000,38.0000 L 
128.2000,38.0000 z " style="fill: #ffffff; fill-opacity: 0.00; stroke: none;" 
id="ezcGraphPolygon_61"/><text id="ezcGraphTextBox_39_text" x="128.7" 
text-length="9.3px" y="34.75" style="font-size: 15px; font-family: sans-serif; 
fill: #2e3436; fill-opacity: 1.00; stroke: none;">8</text></g></g></svg>


Property changes on: 
trunk/Graph/tests/data/compare/ezcGraphDateAxisTest_testMonthInterval2.svg
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/Graph/tests/date_axis_test.php
===================================================================
--- trunk/Graph/tests/date_axis_test.php        2007-01-18 09:47:26 UTC (rev 
4521)
+++ trunk/Graph/tests/date_axis_test.php        2007-01-18 11:24:32 UTC (rev 
4522)
@@ -501,6 +501,54 @@
             $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'
+        );
+    }
 }
 
 ?>

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to