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.config.update(me.options);
|
||||||
me.options = me.config.options;
|
me.options = me.config.options;
|
||||||
me._animationsDisabled = !me.options.animation;
|
const animsDisabled = me._animationsDisabled = !me.options.animation;
|
||||||
|
|
||||||
me.ensureScalesHaveIDs();
|
me.ensureScalesHaveIDs();
|
||||||
me.buildOrUpdateScales();
|
me.buildOrUpdateScales();
|
||||||
@ -476,10 +476,14 @@ class Chart {
|
|||||||
|
|
||||||
me._updateLayout();
|
me._updateLayout();
|
||||||
|
|
||||||
// Can only reset the new controllers after the scales have been updated
|
// Only reset the controllers if we have animations
|
||||||
each(newControllers, (controller) => {
|
if (!animsDisabled) {
|
||||||
controller.reset();
|
// 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);
|
me._updateDatasets(mode);
|
||||||
|
|
||||||
|
|||||||
@ -901,7 +901,7 @@ export default class DatasetController {
|
|||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
includeOptions(mode, sharedOptions) {
|
includeOptions(mode, sharedOptions) {
|
||||||
return !sharedOptions || isDirectUpdateMode(mode);
|
return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user