Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions smoothie.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function TimeSeries(options) {
options.resetBounds = options.resetBounds || true; // Enable or disable the resetBounds timer
this.options = options;
this.data = [];
this.referenceSeries = options.referenceSeries || this;

this.maxValue = Number.NaN; // The maximum value ever seen in this time series.
this.minValue = Number.NaN; // The minimum value ever seen in this time series.
Expand All @@ -56,6 +57,11 @@ function TimeSeries(options) {

// Reset the min and max for this timeseries so the graph rescales itself
TimeSeries.prototype.resetBounds = function() {
if (this.referenceSeries !== this) {
this.maxValue = this.referenceSeries.maxValue;
this.minValue = this.referenceSeries.minValue;
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a semicolon

}
this.maxValue = Number.NaN;
this.minValue = Number.NaN;
for (var i = 0; i < this.data.length; i++) {
Expand Down