Fix adding data to pie, doughnut, and polar area charts

This commit is contained in:
Evert Timberg 2016-04-23 10:52:02 -04:00
parent d583a7bf19
commit 8f0caed24b

View File

@ -250,6 +250,11 @@ module.exports = function(Chart) {
// Make sure dataset controllers are updated and new controllers are reset
var newControllers = this.buildOrUpdateControllers();
// Make sure all dataset controllers have correct meta data counts
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.buildOrUpdateElements();
});
Chart.layoutService.update(this, this.chart.width, this.chart.height);
// Can only reset the new controllers after the scales have been updated
@ -257,11 +262,6 @@ module.exports = function(Chart) {
controller.reset();
});
// Make sure all dataset controllers have correct meta data counts
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.buildOrUpdateElements();
});
// This will loop through any data and do the appropriate element update for the type
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
dataset.controller.update();