X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Flegend.js;h=f16e6323510dca89f2c3288bfcc9285cd0f3416e;hb=0a14b0f9fbe3e97e0163b4e6ad7893e49d3bf2ff;hp=85424c6d47a414dc8ffca22f0f5189d541743d7b;hpb=c3b1d17da4b5d6badbeeb2cf25cb8f8061e1ccd5;p=dygraphs.git diff --git a/plugins/legend.js b/plugins/legend.js index 85424c6..f16e632 100644 --- a/plugins/legend.js +++ b/plugins/legend.js @@ -5,7 +5,6 @@ */ Dygraph.Plugins.Legend = (function() { - /* Current bits of jankiness: @@ -152,8 +151,10 @@ legend.prototype.predraw = function(e) { // TODO(danvk): only use real APIs for this. e.dygraph.graphDiv.appendChild(this.legend_div_); var area = e.dygraph.plotter_.area; - this.legend_div_.style.left = area.x + area.w - e.dygraph.getOption("labelsDivWidth") - 1 + "px"; + var labelsDivWidth = e.dygraph.getOption("labelsDivWidth"); + this.legend_div_.style.left = area.x + area.w - labelsDivWidth - 1 + "px"; this.legend_div_.style.top = area.y + "px"; + this.legend_div_.style.width = labelsDivWidth + "px"; }; /**