From 33030f33c02e30364172a94b0dd7bdb6528b0f17 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 13 Sep 2010 19:57:47 -0700 Subject: [PATCH] merge iconWidth/iconHeight with width/height --- dygraph-canvas.js | 10 +++++----- tests/annotation.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dygraph-canvas.js b/dygraph-canvas.js index a8ec2b3..fdebac7 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; } @@ -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)); diff --git a/tests/annotation.html b/tests/annotation.html index 8f6b51d..0976052 100644 --- a/tests/annotation.html +++ b/tests/annotation.html @@ -31,7 +31,7 @@ return "(" + ann.series + ", " + ann.x + ")"; } - g = new DateGraph( + g = new Dygraph( document.getElementById("g"), function() { var zp = function(x) { if (x < 10) return "0"+x; else return x; }; @@ -80,8 +80,8 @@ series: 'another line', x: "20061013", icon: 'dollar.png', - iconWidth: 18, - iconHeight: 23, + width: 18, + height: 23, tickHeight: 4, text: 'Another one', cssClass: 'annotation', -- 2.7.4