mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 08:24:05 +01:00
Enable changing the chart type (#8226)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user