From 925b23da864c07f8e3de2545e3e7bdd35840ff61 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 18 May 2020 06:49:07 -0700 Subject: [PATCH] Better organize calls in main controller (#7345) --- src/core/core.controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.47.2