From: Evert Timberg Date: Sat, 23 Apr 2016 14:52:02 +0000 (-0400) Subject: Fix adding data to pie, doughnut, and polar area charts X-Git-Tag: 2.1.0~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f0caed24b2db8e16ad1dd149964c2c080a1cf41;p=thirdparty%2FChart.js.git Fix adding data to pie, doughnut, and polar area charts --- diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 9e7b52253..3791b105d 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -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();