From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 1 Mar 2021 20:06:48 +0000 (-0800) Subject: Fix normalize when null values at edge of dataset (#8547) X-Git-Tag: v3.0.0-beta.13~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3214005322a8fe010e8141138ab991714f891c9a;p=thirdparty%2FChart.js.git Fix normalize when null values at edge of dataset (#8547) * Fix normalize when null values at edge of dataset * Fix test with mismatched number of points --- diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 7413ec954..ba1156444 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -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) { diff --git a/test/fixtures/scale.time/ticks-reverse-linear.js b/test/fixtures/scale.time/ticks-reverse-linear.js index cf2a804ea..e19cf5191 100644 --- a/test/fixtures/scale.time/ticks-reverse-linear.js +++ b/test/fixtures/scale.time/ticks-reverse-linear.js @@ -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: {