From: Evert Timberg Date: Wed, 23 Dec 2020 18:38:51 +0000 (-0500) Subject: Enable changing the chart type (#8226) X-Git-Tag: v3.0.0-beta.8~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ffcd93d10a08d926fe2bd43d2b2b6d01297e755;p=thirdparty%2FChart.js.git Enable changing the chart type (#8226) --- diff --git a/src/core/core.config.js b/src/core/core.config.js index b02cc750f..ce32047e0 100644 --- a/src/core/core.config.js +++ b/src/core/core.config.js @@ -51,8 +51,9 @@ function mergeScaleConfig(config, options) { const scaleConf = configScales[id]; const axis = determineAxis(id, scaleConf); const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis); + const defaultScaleOptions = chartDefaults.scales || {}; firstIDs[axis] = firstIDs[axis] || id; - scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, chartDefaults.scales[axis], chartDefaults.scales[defaultId]]); + scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]); }); // Backward compatibility @@ -163,6 +164,10 @@ export default class Config { return this._config.type; } + set type(type) { + this._config.type = type; + } + get data() { return this._config.data; }