Merge branch 'master' of http://github.com/kberg/dygraphs
authorRobert Konigsberg <konigsberg@google.com>
Mon, 29 Nov 2010 22:16:30 +0000 (17:16 -0500)
committerRobert Konigsberg <konigsberg@google.com>
Mon, 29 Nov 2010 22:16:30 +0000 (17:16 -0500)
Conflicts:
dygraph.js
tests/zoom.html

docs/index.html
dygraph.js
tests/callback.html
tests/zoom.html

index adc7c15..b9eff54 100644 (file)
@@ -625,9 +625,9 @@ perl -ne 'BEGIN{print "Month,Nominal,Real\n"} chomp; ($m,$cpi,$low,$close,$high)
         </tr>
         <tr>
           <td><strong>zoomCallback</strong></td>
-          <td><code>function(minDate,<br/>maxDate,<br/>minValue,<br/>maxValue){}</code></td>
+          <td><code>function(minDate,<br/>maxDate,<br/>yRanges){}</code></td>
           <td><code>null</code></td>
-          <td>A function to call when the zoom window is changed (either by zooming in or out). minDate and maxDate are milliseconds since epoch. minValue and maxValue are y-axis range values.
+          <td>A function to call when the zoom window is changed (either by zooming in or out). minDate and maxDate are milliseconds since epoch. yRanges is an array of [bottom, top] pairs, one for each y-axis.
           <div class="tests">Tests: <a href="tests/callback.html">callback</a> <a href="tests/zoom.html">zoom</a></div>
           </td>
         </tr>
index 0dba534..e28c273 100644 (file)
@@ -1086,7 +1086,6 @@ Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) {
   this.dateWindow_ = [minDate, maxDate];
   this.drawGraph_();
   if (this.attr_("zoomCallback")) {
-    var yRange = this.yAxisRange();
     this.attr_("zoomCallback")(minDate, maxDate, this.yAxisRanges());
   }
 };
index 04ed8ea..3a14ff3 100644 (file)
@@ -81,8 +81,8 @@
                 s.innerHTML += "<b>Point Click</b> " + p.name + ": " + p.x + "<br/>";
               },
 
-              zoomCallback: function(minX, maxX) {
-                s.innerHTML += "<b>Zoom</b> [" + minX + ", " + maxX + "]<br/>";
+              zoomCallback: function(minX, maxX, yRanges) {
+                s.innerHTML += "<b>Zoom</b> [" + minX + ", " + maxX + ", [" + yRanges + "]]<br/>";
               },
 
               drawCallback: function(g) {
index cba823a..1b60936 100644 (file)
@@ -42,6 +42,7 @@
               errorBars: true,
              zoomCallback : function(minDate, maxDate, yRanges) {
                  showDimensions(minDate, maxDate, yRanges); }
+              }
             }
           );
 
         elem.innerHTML = "dateWindow : [" + first + ", "+ second + "]";
       }
 
-      function showYDimensions(values) {
+      function showYDimensions(ranges) {
         var elem = document.getElementById("ydimensions");
-        elem.innerHTML = "valueRange : [" + values + "]";
+        elem.innerHTML = "valueRange : [" + ranges + "]";
       }
 
       function zoomGraphX(minDate, maxDate) {
         g.updateOptions({
           dateWindow: [minDate, maxDate]
         });
-           showXDimensions(minDate, maxDate);
+        showXDimensions(minDate, maxDate);
       }
 
       function zoomGraphY(minValue, maxValue) {