projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into pluggable-renderer
[dygraphs.git]
/
dygraph.js
diff --git
a/dygraph.js
b/dygraph.js
index
abd2973
..
38c1d05
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-2102,7
+2102,10
@@
Dygraph.prototype.predraw_ = function() {
this.computeYAxes_();
// Create a new plotter.
this.computeYAxes_();
// Create a new plotter.
- if (this.plotter_) this.plotter_.clear();
+ if (this.plotter_) {
+ this.cascadeEvents_('clearChart');
+ this.plotter_.clear();
+ }
this.plotter_ = new DygraphCanvasRenderer(this,
this.hidden_,
this.hidden_ctx_,
this.plotter_ = new DygraphCanvasRenderer(this,
this.hidden_,
this.hidden_ctx_,
@@
-2330,8
+2333,13
@@
Dygraph.prototype.drawGraph_ = function() {
* @private
*/
Dygraph.prototype.renderGraph_ = function(is_initial_draw) {
* @private
*/
Dygraph.prototype.renderGraph_ = function(is_initial_draw) {
+ this.cascadeEvents_('clearChart');
this.plotter_.clear();
this.plotter_.clear();
+
this.plotter_.render();
this.plotter_.render();
+
+ // TODO(danvk): is this a performance bottleneck when panning?
+ // The interaction canvas should already be empty in that situation.
this.canvas_.getContext('2d').clearRect(0, 0, this.canvas_.width,
this.canvas_.height);
this.canvas_.getContext('2d').clearRect(0, 0, this.canvas_.width,
this.canvas_.height);