X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=045c394ebbe3b379061ba61f5368c5ab28827f89;hb=e992d194f31a37cbf2cb2a34c08f218ad9be2113;hp=79b53a939248263160b32a81f92c6e7f8c4a94d7;hpb=9d31b3fe6bb776384da58c37dc9b2ba1304f1fd0;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 79b53a9..045c394 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1842,6 +1842,8 @@ Dygraph.prototype.generateLegendHTML_ = function(x, sel_points, oneEmWidth) { */ Dygraph.prototype.setLegendHTML_ = function(x, sel_points) { var labelsDiv = this.attr_("labelsDiv"); + if (!labelsDiv) return; + var sizeSpan = document.createElement('span'); // Calculates the width of 1em in pixels for the legend. sizeSpan.setAttribute('style', 'margin: 0; padding: 0 0 0 1em; border: 0;');