]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
chart.update(0) now draws instantly instead of not at all
authorTanner Linsley <tannerlinsley@gmail.com>
Tue, 4 Aug 2015 17:24:27 +0000 (11:24 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Tue, 4 Aug 2015 17:24:27 +0000 (11:24 -0600)
src/core/core.controller.js

index bd843631b03e1ea2dceeb2d3c082d16ea2a330f6..a255167bf02bd5849635715497c45d1083a3fe1b 100644 (file)
 
                render: function render(duration, lazy) {
 
-                       if (this.options.animation.duration !== 0 || duration) {
+                       if ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration == 'undefined' && this.options.animation.duration !== 0)) {
                                var animation = new Chart.Animation();
                                animation.numSteps = (duration || this.options.animation.duration) / 16.66; //60 fps
                                animation.easing = this.options.animation.easing;