]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
When only the dataset array changes scales did not update correctly. This was due...
authorEvert Timberg <evert.timberg@gmail.com>
Wed, 9 Dec 2015 00:57:58 +0000 (19:57 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Wed, 9 Dec 2015 00:57:58 +0000 (19:57 -0500)
src/core/core.controller.js

index b12c430a40555630c9a5e6928c750ba31047aaa0..b1fd2387503900e83efa9cb1adc379c5d1c62854 100644 (file)
 
                                if (dataset.controller) {
                                        dataset.controller.updateIndex(datasetIndex);
-                                       return;
-                               }
-
-                               dataset.controller = new Chart.controllers[type](this, datasetIndex);
+                               } else {
+                                       dataset.controller = new Chart.controllers[type](this, datasetIndex);
 
-                               if (resetNewControllers) {
-                                       dataset.controller.reset();
+                                       if (resetNewControllers) {
+                                               dataset.controller.reset();
+                                       }
                                }
                        }, this);
 
                        // In case the entire data object changed
                        this.tooltip._data = this.data;
 
-                       Chart.scaleService.update(this, this.chart.width, this.chart.height);
-
                        // Make sure dataset controllers are updated and new controllers are reset
                        this.buildOrUpdateControllers(true);
 
+                       Chart.scaleService.update(this, this.chart.width, this.chart.height);
+
                        // Make sure all dataset controllers have correct meta data counts
                        helpers.each(this.data.datasets, function(dataset, datasetIndex) {
                                dataset.controller.buildOrUpdateElements();