Better organize calls in main controller (#7345)

This commit is contained in:
Ben McCann
2020-05-18 06:49:07 -07:00
committed by Evert Timberg
parent 56de3e420c
commit fab8e902bb

View File

@@ -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);