Support for vertical panning.
[dygraphs.git] / dygraph-canvas.js
index a8ec2b3..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) {
@@ -41,9 +41,9 @@ DygraphLayout.prototype.setAnnotations = function(ann) {
       return;
     }
     if (ann[i].icon &&
-        !(ann[i].hasOwnProperty('iconWidth') &&
-          ann[i].hasOwnProperty('iconHeight'))) {
-      this.dygraph_.error("Must set iconWidth and iconHeight when setting " +
+        !(ann[i].hasOwnProperty('width') &&
+          ann[i].hasOwnProperty('height'))) {
+      this.dygraph_.error("Must set width and height when setting " +
                           "annotation.icon property");
       return;
     }
@@ -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);
     }
   }
@@ -501,7 +494,7 @@ DygraphCanvasRenderer.prototype._renderAnnotations = function() {
     "position": "absolute",
     "fontSize": this.options.axisLabelFontSize + "px",
     "zIndex": 10,
-    "overflow": "hidden",
+    "overflow": "hidden"
   };
 
   var bindEvt = function(eventName, classEventName, p, self) {
@@ -547,8 +540,8 @@ DygraphCanvasRenderer.prototype._renderAnnotations = function() {
     if (a.hasOwnProperty('icon')) {
       var img = document.createElement("img");
       img.src = a.icon;
-      img.width = width = a.iconWidth;
-      img.height = height = a.iconHeight;
+      img.width = width;
+      img.height = height;
       div.appendChild(img);
     } else if (p.annotation.hasOwnProperty('shortText')) {
       div.appendChild(document.createTextNode(p.annotation.shortText));