projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6611837
)
Clear graph when numAxes goes from 1 -> 2 in updateOptions
author
Mike Smith
<sendmikestuff@gmail.com>
Thu, 6 Oct 2016 17:02:39 +0000
(10:02 -0700)
committer
Dan Vanderkam
<danvdk@gmail.com>
Sun, 6 May 2018 22:54:48 +0000
(18:54 -0400)
src/dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/src/dygraph.js
b/src/dygraph.js
index
1de4485
..
4676a2e
100644
(file)
--- a/
src/dygraph.js
+++ b/
src/dygraph.js
@@
-3103,6
+3103,7
@@
Dygraph.prototype.updateOptions = function(input_attrs, block_redraw) {
// copyUserAttrs_ drops the "file" parameter as a convenience to us.
var file = input_attrs.file;
var attrs = Dygraph.copyUserAttrs_(input_attrs);
// copyUserAttrs_ drops the "file" parameter as a convenience to us.
var file = input_attrs.file;
var attrs = Dygraph.copyUserAttrs_(input_attrs);
+ var prevNumAxes = this.attributes_.numAxes();
// TODO(danvk): this is a mess. Move these options into attr_.
if ('rollPeriod' in attrs) {
// TODO(danvk): this is a mess. Move these options into attr_.
if ('rollPeriod' in attrs) {
@@
-3126,6
+3127,7
@@
Dygraph.prototype.updateOptions = function(input_attrs, block_redraw) {
this.attributes_.reparseSeries();
this.attributes_.reparseSeries();
+ if (prevNumAxes < this.attributes_.numAxes()) this.plotter_.clear();
if (file) {
// This event indicates that the data is about to change, but hasn't yet.
// TODO(danvk): support cancellation of the update via this event.
if (file) {
// This event indicates that the data is about to change, but hasn't yet.
// TODO(danvk): support cancellation of the update via this event.