Add option to many-points-benchmark that unaligns timestamps
[dygraphs.git] / plugins / legend.js
index 85424c6..f16e632 100644 (file)
@@ -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";
 };
 
 /**