diff --git a/src/core/core.controller.js b/src/core/core.controller.js index bc60d506f..c71c8c26f 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -119,8 +119,6 @@ function updateConfig(chart) { chart.options.scales = scaleConfig; chart._animationsDisabled = isAnimationDisabled(newOptions); - chart.ensureScalesHaveIDs(); - chart.buildOrUpdateScales(); } const KNOWN_POSITIONS = new Set(['top', 'bottom', 'left', 'right', 'chartArea']); @@ -539,6 +537,9 @@ export default class Chart { updateConfig(me); + me.ensureScalesHaveIDs(); + me.buildOrUpdateScales(); + // plugins options references might have change, let's invalidate the cache // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167 plugins.invalidate(me);