mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix for allowing parsing:false with stacks (#8934)
* Initial fix for allowing parsing:false with stacks * Added test from #8935 as requested. Co-authored-by: tinfoilpancakes <tfm357@gmail.com>
This commit is contained in:
parent
af7965fc31
commit
c107f895aa
@ -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);
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user