Skip to content

Commit

Permalink
Cache me._type
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jan 23, 2019
1 parent b2cdacc commit 31ffe80
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/core.datasetController.js
Expand Up @@ -101,6 +101,7 @@ helpers.extend(DatasetController.prototype, {
me.index = datasetIndex;
me.linkScales();
me.addElements();
me._type = me.getMeta().type;
},

updateIndex: function(datasetIndex) {
Expand Down Expand Up @@ -241,9 +242,7 @@ helpers.extend(DatasetController.prototype, {
*/
_defaults: function() {
var me = this;
var dataset = me.getDataset();
var type = helpers.valueOrDefault(dataset.type, me.chart.config.type);
return defaults.datasets[type];
return defaults.datasets[me._type] || {};
},

update: helpers.noop,
Expand Down

0 comments on commit 31ffe80

Please sign in to comment.