// Init if doesn't exist
else if (!this._view[key]) {
- if (typeof value === 'number') {
+ if (typeof value === 'number' && isNaN(this._view[key]) === false) {
this._view[key] = value * ease;
} else {
this._view[key] = value || null;
}
// Number transitions
else if (typeof value === 'number') {
- var startVal = this._start[key] !== undefined ? this._start[key] : 0;
+ var startVal = this._start[key] !== undefined && isNaN(this._start[key]) === false ? this._start[key] : 0;
this._view[key] = ((this._model[key] - startVal) * ease) + startVal;
}
// Everything else
else {
this._view[key] = value;
}
-
}, this);
if (ease === 1) {
return index * angleMultiplier - (Math.PI / 2);
},
getDistanceFromCenterForValue: function(value) {
- if (value === null) return 0; // null always in center
+ if (value === null || value === undefined || isNaN(value)) {
+ return 0; // null always in center
+ }
+
// Take into account half font size + the yPadding of the top value
var scalingFactor = this.drawingArea / (this.max - this.min);
if (this.options.reverse) {