blah
authorDan Vanderkam <dan@dygraphs.com>
Fri, 6 Jul 2012 01:24:55 +0000 (21:24 -0400)
committerDan Vanderkam <dan@dygraphs.com>
Fri, 6 Jul 2012 01:25:09 +0000 (21:25 -0400)
dygraph.js

index 8979c6f..99fdf3b 100644 (file)
@@ -2102,7 +2102,10 @@ Dygraph.prototype.predraw_ = function() {
   this.computeYAxes_();
 
   // Create a new plotter.
-  if (this.plotter_) this.plotter_.clear();
+  if (this.plotter_) {
+    this.cascadeEvents_('clear');
+    this.plotter_.clear();
+  }
   this.plotter_ = new DygraphCanvasRenderer(this,
                                             this.hidden_,
                                             this.hidden_ctx_,
@@ -2330,7 +2333,9 @@ Dygraph.prototype.drawGraph_ = function() {
  * @private
  */
 Dygraph.prototype.renderGraph_ = function(is_initial_draw) {
+  this.cascadeEvents_('clear');
   this.plotter_.clear();
+
   this.plotter_.render();
 
   // TODO(danvk): is this a performance bottleneck when panning?