mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Skip reset when animations are disabled (#8248)
* Skip reset when animations are disabled * Review update
This commit is contained in:
parent
12682c619d
commit
c2091fc77d
@ -453,7 +453,7 @@ class Chart {
|
||||
|
||||
me.config.update(me.options);
|
||||
me.options = me.config.options;
|
||||
me._animationsDisabled = !me.options.animation;
|
||||
const animsDisabled = me._animationsDisabled = !me.options.animation;
|
||||
|
||||
me.ensureScalesHaveIDs();
|
||||
me.buildOrUpdateScales();
|
||||
@ -476,10 +476,14 @@ class Chart {
|
||||
|
||||
me._updateLayout();
|
||||
|
||||
// Only reset the controllers if we have animations
|
||||
if (!animsDisabled) {
|
||||
// Can only reset the new controllers after the scales have been updated
|
||||
// Reset is done to get the starting point for the initial animation
|
||||
each(newControllers, (controller) => {
|
||||
controller.reset();
|
||||
});
|
||||
}
|
||||
|
||||
me._updateDatasets(mode);
|
||||
|
||||
|
||||
@ -901,7 +901,7 @@ export default class DatasetController {
|
||||
* @protected
|
||||
*/
|
||||
includeOptions(mode, sharedOptions) {
|
||||
return !sharedOptions || isDirectUpdateMode(mode);
|
||||
return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user