From: Dan Vanderkam Date: Mon, 28 Mar 2011 03:05:01 +0000 (-0400) Subject: fix roller positioning; add labels to docs page X-Git-Tag: v1.0.0~545 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=0c38f187748e6bdc28045389355c97fd84c3d227;p=dygraphs.git fix roller positioning; add labels to docs page --- diff --git a/docs/index.html b/docs/index.html index 2a14b3c..91753e7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -98,7 +98,9 @@ rollPeriod: 14, showRoller: true, customBars: true, - yAxisLabelWidth: 30 + yAxisLabelWidth: 30, + title: 'Temperatures in New York vs. San Francisco', + ylabel: 'Temperature (F)' } ); diff --git a/dygraph.js b/dygraph.js index d7f25e1..f5a2ce2 100644 --- a/dygraph.js +++ b/dygraph.js @@ -948,10 +948,11 @@ Dygraph.prototype.createRollInterface_ = function() { var display = this.attr_('showRoller') ? 'block' : 'none'; + var area = this.plotter_.area; var textAttr = { "position": "absolute", "zIndex": 10, - "top": (this.plotter_.area.h - 25) + "px", - "left": (this.plotter_.area.x + 1) + "px", + "top": (area.y + area.h - 25) + "px", + "left": (area.x + 1) + "px", "display": display }; this.roller_.size = "2";