option to fill in two-axes test
authorDan Vanderkam <danvdk@gmail.com>
Fri, 22 Oct 2010 03:19:04 +0000 (23:19 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Fri, 22 Oct 2010 03:19:04 +0000 (23:19 -0400)
dygraph-canvas.js
tests/steps.html
tests/two-axes.html

index c12622f..c5c0ee0 100644 (file)
@@ -320,6 +320,10 @@ DygraphCanvasRenderer = function(dygraph, element, layout, options) {
   ctx.clip();
 };
 
+DygraphCanvasRenderer.prototype.attr_ = function(x) {
+  return this.dygraph_.attr_(x);
+};
+
 DygraphCanvasRenderer.prototype.clear = function() {
   if (this.isIE) {
     // VML takes a while to start up, so we just poll every this.IEDelay
@@ -675,12 +679,13 @@ DygraphCanvasRenderer.prototype._renderAnnotations = function() {
  * Overrides the CanvasRenderer method to draw error bars
  */
 DygraphCanvasRenderer.prototype._renderLineChart = function() {
+  // TODO(danvk): use this.attr_ for many of these.
   var context = this.element.getContext("2d");
   var colorCount = this.options.colorScheme.length;
   var colorScheme = this.options.colorScheme;
   var fillAlpha = this.options.fillAlpha;
   var errorBars = this.layout.options.errorBars;
-  var fillGraph = this.layout.options.fillGraph;
+  var fillGraph = this.attr_("fillGraph");
   var stackedGraph = this.layout.options.stackedGraph;
   var stepPlot = this.layout.options.stepPlot;
 
index b8d08c6..9b7aef0 100644 (file)
       {
         labels: ["Date","GapSeries1","GapSeries2"],
         showRoller: true,
-        stepPlot: true
+        stepPlot: true,
+        GapSeries2: { axis: {} }
       }
     );
     </script>
index e6b1b6d..78c0fb2 100644 (file)
             labelsKMB: true
           }
       );
+
+      function update(el) {
+        g.updateOptions( { fillGraph: el.checked } );
+        g2.updateOptions( { fillGraph: el.checked } );
+      }
     </script>
+
+    <input type=checkbox id="check" onChange="update(this)"><label for="check"> Fill?</label>
 </body>
 </html>