Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for allowing parsing:false with stacks #8934

Merged
merged 2 commits into from Apr 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/core.datasetController.js
Expand Up @@ -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);
Expand Down
23 changes: 23 additions & 0 deletions test/specs/core.datasetController.tests.js
Expand Up @@ -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({
Expand Down