From f7d6278e62d699c4015b0bb600d9a67feef51481 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Thu, 26 Nov 2009 20:44:51 -0500 Subject: [PATCH] clear div --- dygraph.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dygraph.js b/dygraph.js index ea1f904..9b4c3bb 100644 --- a/dygraph.js +++ b/dygraph.js @@ -155,6 +155,10 @@ Dygraph.prototype.__init__ = function(div, file, attrs) { this.wilsonInterval_ = attrs.wilsonInterval || true; this.customBars_ = attrs.customBars || false; + // Clear the div. This ensure that, if multiple dygraphs are passed the same + // div, then only one will be drawn. + div.innerHTML = ""; + // If the div isn't already sized then give it a default size. if (div.style.width == '') { div.style.width = Dygraph.DEFAULT_WIDTH + "px"; -- 2.7.4