mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 00:14:03 +01:00
Bad values for data are now converted to NaN
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user