Fix to bug 111, now always rendering all points whether they're in the canvas viewpor...
authorRobert Konigsberg <konigsberg@google.com>
Fri, 24 Sep 2010 14:52:53 +0000 (10:52 -0400)
committerRobert Konigsberg <konigsberg@google.com>
Fri, 24 Sep 2010 14:52:53 +0000 (10:52 -0400)
dygraph-canvas.js
dygraph.js
tests/data.js
tests/visibility.html
tests/zoom.html

index 8d3bfe2..182f29d 100644 (file)
@@ -19,7 +19,7 @@ DygraphLayout = function(dygraph, options) {
   this.options = {};  // TODO(danvk): remove, use attr_ instead.
   Dygraph.update(this.options, options ? options : {});
   this.datasets = new Array();
-  this.annotations = new Array()
+  this.annotations = new Array();
 };
 
 DygraphLayout.prototype.attr_ = function(name) {
@@ -103,13 +103,6 @@ DygraphLayout.prototype._evaluateLineCharts = function() {
         name: setName
       };
 
-      // limit the x, y values so they do not overdraw
-      if (point.y <= 0.0) {
-        point.y = 0.0;
-      }
-      if (point.y >= 1.0) {
-        point.y = 1.0;
-      }
       this.points.push(point);
     }
   }
index f20e1e1..5a8b9ca 100644 (file)
@@ -1012,9 +1012,9 @@ Dygraph.prototype.doZoomXDates_ = function(minDate, maxDate) {
 Dygraph.prototype.doZoomY_ = function(lowY, highY) {
   // Find the highest and lowest values in pixel range.
   var r = this.toDataCoords(null, lowY);
-  var minValue = r[1];
-  r = this.toDataCoords(null, highY);
   var maxValue = r[1];
+  r = this.toDataCoords(null, highY);
+  var minValue = r[1];
 
   this.doZoomYValues_(minValue, maxValue);
 };
@@ -1029,7 +1029,7 @@ Dygraph.prototype.doZoomY_ = function(lowY, highY) {
  * @private
  */
 Dygraph.prototype.doZoomYValues_ = function(minValue, maxValue) {
-  this.valueWindow_ = [maxValue, minValue];
+  this.valueWindow_ = [minValue, maxValue];
   this.drawGraph_(this.rawData_);
   if (this.attr_("zoomCallback")) {
     var xRange = this.xAxisRange(); 
index 5f61b95..3cf75fb 100644 (file)
@@ -435,6 +435,16 @@ return "" +
 "20061129,1.41093474427,0.495309102312,3.02013422819,0.701020603129";
 }
 
+function NoisyData2() {
+return "" +
+"Date,A,B\n" +
+"20061027,2.30905861456\n" +
+"20061028,4.09252669039\n" +
+"20061029,2.66903914591\n" +
+"20061030,4.74516695958\n" +
+"20061031,2.78260869565\n" +
+"20061101,1.5873015873\n";
+}
 function data_showzerovalues() {
        return "" +
        "20070101,0,39\n" +
index 01f0ef0..c18feb8 100644 (file)
@@ -1,6 +1,6 @@
 <html>
   <head>
-    <title>noise</title>
+    <title>visibility</title>
     <!--[if IE]>
     <script type="text/javascript" src="excanvas.js"></script>
     <![endif]-->
index 608ae6d..24a2828 100644 (file)
@@ -1,6 +1,6 @@
 <html>
   <head>
-    <title>noise</title>
+    <title>zoom</title>
     <!--[if IE]>
     <script type="text/javascript" src="excanvas.js"></script>
     <![endif]-->
@@ -23,7 +23,7 @@
       <input type="button" value="Y (0,4)" onclick="zoomGraphY(0,4)">&nbsp;
       <input type="button" value="Y (2,4)" onclick="zoomGraphY(2,4)">&nbsp;
       <input type="button" value="Y (0,2)" onclick="zoomGraphY(0,2)">&nbsp;
-      <input type="button" value="Y (1,0)" onclick="zoomGraphY(1,0)">&nbsp;
+      <input type="button" value="Y (0,1)" onclick="zoomGraphY(0,1)">&nbsp;
       <br>
       <input type="button" value="Oct 8-13" onclick="zoomGraphX(1160261979962, 1163905694248)">&nbsp;
       <input type="button" value="Oct 22-28" onclick="zoomGraphX(1161489164461 , 1162008465957)">&nbsp;