]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix normalize when null values at edge of dataset (#8547)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Mon, 1 Mar 2021 20:06:48 +0000 (12:06 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 20:06:48 +0000 (15:06 -0500)
* Fix normalize when null values at edge of dataset

* Fix test with mismatched number of points

src/core/core.datasetController.js
test/fixtures/scale.time/ticks-reverse-linear.js

index 7413ec954feda4906685b758d20b9a35676e0cfb..ba1156444355c9a1acbc16b6ad4b8d33301b34d2 100644 (file)
@@ -566,7 +566,7 @@ export default class DatasetController {
       parsed = _parsed[i];
       value = parsed[scale.axis];
       otherValue = parsed[otherScale.axis];
-      return (!isFinite(value) || !isFinite(otherValue) || otherMin > otherValue || otherMax < otherValue);
+      return !isFinite(value) || otherMin > otherValue || otherMax < otherValue;
     }
 
     for (i = 0; i < ilen; ++i) {
index cf2a804eaff7ebee101f761b905179d5983b122e..e19cf51912d6718dc3e13266380f629d4983f1a6 100644 (file)
@@ -4,7 +4,7 @@ module.exports = {
     type: 'line',
     data: {
       labels: ['2017', '2019', '2020', '2025', '2042'],
-      datasets: [{data: [0, 1, 2, 3, 4, 5], fill: false}]
+      datasets: [{data: [0, 1, 2, 3, 4], fill: false}]
     },
     options: {
       scales: {