meta = chart.getDatasetMeta(i);
arcs = meta.data;
controller = meta.controller;
- if (controller !== this) {
- controller.configure();
- }
break;
}
}
return;
}
+ for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
+ this.getDatasetMeta(i).controller.configure();
+ }
+
for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);
}
const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);
this.options = config.createResolver(scopes, this.getContext());
this._parsing = this.options.parsing;
+ this._cachedDataOpts = {};
}
/**
*/
_update(mode) {
const meta = this._cachedMeta;
- this.configure();
- this._cachedDataOpts = {};
this.update(mode || 'default');
meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));
}
--- /dev/null
+module.exports = {
+ description: 'https://github.com/chartjs/Chart.js/issues/9832',
+ config: {
+ type: 'doughnut',
+ data: {
+ datasets: [{
+ label: 'Set 1',
+ data: [50, 50, 25],
+ backgroundColor: ['#BF616A', '#D08770', '#EBCB8B'],
+ borderWidth: 0
+ },
+ {
+ label: 'Se1 2',
+ data: [50, 50, 25],
+ backgroundColor: ['#BF616A', '#D08770', '#EBCB8B'],
+ borderWidth: 0
+ }]
+ },
+ options: {
+ rotation: -90
+ }
+ },
+ options: {
+ canvas: {
+ width: 512,
+ height: 512
+ },
+ run(chart) {
+ chart.options.circumference = 180;
+ chart.update();
+ }
+ }
+};
var meta = chart.getDatasetMeta(0);
- meta.controller.reset(); // reset first
+ chart.reset(); // reset first
// Line element
expect(meta.dataset.options).toEqual(jasmine.objectContaining({
}));
});
- // Now update controller and ensure proper updates
- meta.controller._update();
+ chart.update();
[
{x: 256, y: 120, cppx: 246, cppy: 120, cpnx: 272, cpny: 120},
chart.data.datasets[0].pointBorderColor = 'rgb(56, 57, 58)';
chart.data.datasets[0].pointBorderWidth = 1.123;
- meta.controller._update();
+ chart.update();
expect(meta.dataset.options).toEqual(jasmine.objectContaining({
backgroundColor: 'rgb(98, 98, 98)',