From f77b6199f5503c48a7be80e6ec110c083282c6ae Mon Sep 17 00:00:00 2001 From: tinfoilpancakes Date: Sun, 18 Apr 2021 00:44:43 -0700 Subject: [PATCH 1/2] Initial fix for allowing parsing:false with stacks --- src/core/core.datasetController.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/core.datasetController.js b/src/core/core.datasetController.js index 8d8e9a95ec9..a3882e9e66d 100644 --- a/src/core/core.datasetController.js +++ b/src/core/core.datasetController.js @@ -392,6 +392,7 @@ export default class DatasetController { if (me._parsing === false) { meta._parsed = data; meta._sorted = true; + parsed = data; } else { if (isArray(data[start])) { parsed = me.parseArrayData(meta, data, start, count); From 5c1be67d101a6b4e0d2fcf62386be472c9196512 Mon Sep 17 00:00:00 2001 From: tinfoilpancakes Date: Sun, 18 Apr 2021 01:00:08 -0700 Subject: [PATCH 2/2] Added test from #8935 as requested. --- test/specs/core.datasetController.tests.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/specs/core.datasetController.tests.js b/test/specs/core.datasetController.tests.js index d9075754ca4..ce7d121b6c9 100644 --- a/test/specs/core.datasetController.tests.js +++ b/test/specs/core.datasetController.tests.js @@ -699,6 +699,29 @@ describe('Chart.DatasetController', function() { Chart.defaults.parsing = originalDefault; }); + it('should not fail to produce stacks when parsing is off', function() { + var chart = acquireChart({ + type: 'line', + data: { + datasets: [{ + data: [{x: 1, y: 10}] + }, { + data: [{x: 1, y: 20}] + }] + }, + options: { + parsing: false, + scales: { + x: {stacked: true}, + y: {stacked: true} + } + } + }); + + var meta = chart.getDatasetMeta(0); + expect(meta._parsed[0]._stacks).toEqual(jasmine.objectContaining({y: {0: 10, 1: 20}})); + }); + describe('resolveDataElementOptions', function() { it('should cache options when possible', function() { const chart = acquireChart({