]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
stop animations when destroying a chart 1070/head
authorKuba Suder <jakub.suder@gmail.com>
Thu, 16 Apr 2015 20:40:34 +0000 (22:40 +0200)
committerKuba Suder <jakub.suder@gmail.com>
Thu, 16 Apr 2015 20:41:53 +0000 (22:41 +0200)
otherwise the animation keeps updating the chart for some time after it
was supposed to be destroyed, and when the canvas might have been
already reused for a new chart

src/Chart.Core.js

index 296844ea2ecc5f863ce894bd66d900ddb2ecc810..83bfdfb32cdc1a6d296363b3a2a0fd3f4c5f4c50 100755 (executable)
                        return template(this.options.legendTemplate,this);
                },
                destroy : function(){
+                       this.stop();
                        this.clear();
                        unbindEvents(this, this.events);
                        var canvas = this.chart.canvas;