From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sat, 14 Dec 2019 04:52:18 +0000 (-0800) Subject: Make elements optional (#6829) X-Git-Tag: v3.0.0-alpha~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9090b53410e18ca91b79341e24f76633a56589a5;p=thirdparty%2FChart.js.git Make elements optional (#6829) --- 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; }