X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=42e87c83e6aecc651635fa9eaba1a3428c4196cf;hb=3adf4a6f00d3577b925338891a0b021ebc5ae325;hp=c7f70873eda50f8a8df947bc90eb0e67e7f3d425;hpb=237060cc571db3965c26e21689c01a87c4cbb8a3;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index c7f7087..42e87c8 100644 --- a/dygraph.js +++ b/dygraph.js @@ -355,6 +355,10 @@ Dygraph.prototype.__init__ = function(div, file, attrs) { attrs = Dygraph.mapLegacyOptions_(attrs); + if (typeof(div) == 'string') { + div = document.getElementById(div); + } + if (!div) { Dygraph.error("Constructing dygraph with a non-existent div!"); return;