]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Reset only when animating (#4923)
authorBen McCann <benjamin.j.mccann@gmail.com>
Tue, 7 Nov 2017 23:26:37 +0000 (15:26 -0800)
committerEvert Timberg <evert.timberg+github@gmail.com>
Tue, 7 Nov 2017 23:26:37 +0000 (18:26 -0500)
src/core/core.controller.js

index 9e4984a9af6026bfbc7e219f62ec649c51f51b6c..5fd4b2d6aa6d433f94f6fefae8a3a99cd897c794 100644 (file)
@@ -365,9 +365,11 @@ module.exports = function(Chart) {
                        me.updateLayout();
 
                        // Can only reset the new controllers after the scales have been updated
-                       helpers.each(newControllers, function(controller) {
-                               controller.reset();
-                       });
+                       if (me.options.animation && me.options.animation.duration) {
+                               helpers.each(newControllers, function(controller) {
+                                       controller.reset();
+                               });
+                       }
 
                        me.updateDatasets();