From 0c38f187748e6bdc28045389355c97fd84c3d227 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 27 Mar 2011 23:05:01 -0400 Subject: [PATCH] fix roller positioning; add labels to docs page --- docs/index.html | 4 +++- dygraph.js | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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"; -- 2.7.4