From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 18 May 2020 13:49:07 +0000 (-0700) Subject: Better organize calls in main controller (#7345) X-Git-Tag: v3.0.0-beta.2~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=925b23da864c07f8e3de2545e3e7bdd35840ff61;p=thirdparty%2FChart.js.git Better organize calls in main controller (#7345) --- 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);