From 9090b53410e18ca91b79341e24f76633a56589a5 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 13 Dec 2019 20:52:18 -0800 Subject: [PATCH] Make elements optional (#6829) --- src/core/core.datasetController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 82afe4316..1a82ff484 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -624,7 +624,7 @@ helpers.extend(DatasetController.prototype, { const chart = this.chart; const meta = this._cachedMeta; const metaData = meta.data; - const ilen = metaData.length; + const ilen = meta._parsed.length; const stacked = canStack && meta._stacked; const indices = getSortedDatasetIndices(chart, true); const otherScale = this._getOtherScale(scale); @@ -639,7 +639,7 @@ helpers.extend(DatasetController.prototype, { parsed = meta._parsed[i]; value = parsed[scale.id]; otherValue = parsed[otherScale.id]; - if (item.hidden || isNaN(value) || + if ((item && item.hidden) || isNaN(value) || otherMin > otherValue || otherMax < otherValue) { continue; } -- 2.47.2