I encountered a problem concerning negatives values for my smooties charts graphs :
every time I did a resetBounds the graph was reseting completely..
TimeSeries.prototype.resetBounds = function() {
if (this.data.length) {
// Walk through all data points, finding the min/max value
// this.maxValue = this.data[0][1];
// this.minValue = this.data[0][1];
var tempMaxValue = this.data[0][1];
var tempMinValue = this.data[0][1];
for (var i = 1; i < this.data.length; i++) {
for (var j = 1; j < this.data[i].length; j++) {
var value = parseInt(this.data[i][j]);
if (value > tempMaxValue) {
tempMaxValue = parseInt(value);
}
if (value < tempMinValue) {
tempMinValue = parseInt(value);
}
}
}
if (tempMaxValue<tempMinValue) {
this.maxValue = parseInt(tempMinValue);
this.minValue = parseInt(tempMaxValue);
} else {
this.maxValue = parseInt(tempMaxValue);
this.minValue = parseInt(tempMinValue);
}
} else {
// No data exists, so set min/max to NaN
this.maxValue = Number.NaN;
this.minValue = Number.NaN;
}
};