From: Tanner Linsley Date: Fri, 23 Oct 2015 22:36:59 +0000 (-0600) Subject: Bad values for data are now converted to NaN X-Git-Tag: 2.0.0-beta~3^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b13e902fff33a98c04b33cd2e5708bb96fd24f4;p=thirdparty%2FChart.js.git Bad values for data are now converted to NaN --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 133801150..02fa87ce6 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -315,10 +315,13 @@ isHorizontal: function() { return this.options.position == "top" || this.options.position == "bottom"; }, - - // Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not + + // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not getRightValue: function(rawValue) { - return (typeof(rawValue) === "object" && rawValue !== null) ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue; + if (isNaN(rawValue) || rawValue === null || typeof(rawValue) === 'undefined') { + return NaN; + } + return typeof(rawValue) === "object" ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue; }, // Used to get the value to display in the tooltip for the data at the given index