X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fdygraph.js;h=4676a2eecb47896ddd5405a8f72ba33d7839bfc5;hb=refs%2Fheads%2Fmaster;hp=531191fa8141bba036abea6589a33695d9eda7a2;hpb=64f1c4dfd7425931fcd1bd9949157c0ba6958656;p=dygraphs.git diff --git a/src/dygraph.js b/src/dygraph.js index 531191f..4676a2e 100644 --- a/src/dygraph.js +++ b/src/dygraph.js @@ -89,7 +89,7 @@ var Dygraph = function(div, data, opts) { }; Dygraph.NAME = "Dygraph"; -Dygraph.VERSION = "2.0.0"; +Dygraph.VERSION = "2.1.0"; // Various default values Dygraph.DEFAULT_ROLL_PERIOD = 1; @@ -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); + var prevNumAxes = this.attributes_.numAxes(); // 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(); + 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.