fix roller positioning; add labels to docs page
authorDan Vanderkam <dan@dygraphs.com>
Mon, 28 Mar 2011 03:05:01 +0000 (23:05 -0400)
committerDan Vanderkam <dan@dygraphs.com>
Mon, 28 Mar 2011 03:05:01 +0000 (23:05 -0400)
docs/index.html
dygraph.js

index 2a14b3c..91753e7 100644 (file)
@@ -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)'
           }
         );
       </script>
index d7f25e1..f5a2ce2 100644 (file)
@@ -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";