X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-canvas.js;h=8d3bfe22f0bbccec71f9c07ccce645643485355d;hb=3bf2fa91283b89ad65728efa6236978541558fa7;hp=a8ec2b37032bc74cb8bd893a17349649a2b97a51;hpb=d14b9eed5b7ee0fc3935cbdb2c9a66cf881fd87a;p=dygraphs.git diff --git a/dygraph-canvas.js b/dygraph-canvas.js index a8ec2b3..8d3bfe2 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -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; } @@ -501,7 +501,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 +547,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));