running into some issues with ordering
authorDan Vanderkam <dan@dygraphs.com>
Fri, 6 Jul 2012 03:58:30 +0000 (20:58 -0700)
committerDan Vanderkam <dan@dygraphs.com>
Fri, 6 Jul 2012 03:58:30 +0000 (20:58 -0700)
dygraph.js
plugins/README
tests/demo.html

index aea8830..4f6b41b 100644 (file)
@@ -1128,7 +1128,7 @@ Dygraph.prototype.getPropertiesForSeries = function(series_name) {
     name: series_name,
     column: idx,
     visible: this.visibility()[idx - 1],
-    color: this.plotter_.colors[series_name],
+    color: this.colorsMap_[series_name],
     axis: 1 + this.seriesToAxisMap_[series_name]
   };
 };
@@ -2341,6 +2341,10 @@ Dygraph.prototype.renderGraph_ = function(is_initial_draw) {
   this.cascadeEvents_('clearChart');
   this.plotter_.clear();
 
+  this.cascadeEvents_('drawChart', {
+    canvas: this.hidden_,
+    drawingContext: this.hidden_ctx_,
+  });
   this.plotter_.render();
 
   // TODO(danvk): is this a performance bottleneck when panning?
@@ -2353,11 +2357,6 @@ Dygraph.prototype.renderGraph_ = function(is_initial_draw) {
   if (this.rangeSelector_) {
     this.rangeSelector_.renderInteractiveLayer();
   }
-
-  this.cascadeEvents_('drawChart', {
-    canvas: this.hidden_,
-    drawingContext: this.hidden_ctx_,
-  });
   if (this.attr_("drawCallback") !== null) {
     this.attr_("drawCallback")(this, is_initial_draw);
   }
index 7956d55..f216545 100644 (file)
@@ -99,8 +99,15 @@ Plugin Events Reference:
 - select
 - deselect
 
+TODO(danvk): document all event properties for each event.
+
+
 Special methods:
 - (constructor)
 - activate
 - destroy
 
+
+----------------
+
+Notes on plugin registration and event cascade ordering/behavior.
index 6435ca1..94582dc 100644 (file)
@@ -48,7 +48,8 @@
                 xlabel: 'Date',
                 ylabel: 'Count',
                 axisLineColor: 'white',
-                drawXGrid: false
+                gridLineWidth: 10
+                // drawXGrid: false
               }
           );
     </script>