Skip to content

Commit

Permalink
Allow updating dataset types
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jul 30, 2017
1 parent 53b7a63 commit b5a6ed4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/core.controller.js
Expand Up @@ -289,8 +289,14 @@ module.exports = function(Chart) {

helpers.each(me.data.datasets, function(dataset, datasetIndex) {
var meta = me.getDatasetMeta(datasetIndex);
var type = dataset.type || me.config.type;
if (!meta.type) {
meta.type = dataset.type || me.config.type;
meta.type = type;
} else if (meta.type !== type) {
meta.controller.destroy();
delete me.data.datasets[datasetIndex]._meta;
meta = me.getDatasetMeta(datasetIndex);
meta.type = type;
}

types.push(meta.type);
Expand Down

0 comments on commit b5a6ed4

Please sign in to comment.