]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add an option to control the minimum number of animation steps.
authorEvert Timberg <evert.timberg@gmail.com>
Sat, 11 Apr 2015 23:17:30 +0000 (19:17 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Sat, 11 Apr 2015 23:17:30 +0000 (19:17 -0400)
src/Chart.Core.js

index 2b8aa78f872ae8ad128fbb0165d12f1b00841635..6288f9699069b229ccb7fe692018f6f09dbd4df1 100755 (executable)
@@ -60,6 +60,9 @@
 
                        // Number - Number of animation steps
                        animationSteps: 60,
+                       
+                       // Number - Minimum number of animation steps to complete regardless of frame rate
+                       minAnimationSteps: 10,
 
                        // String - Animation easing effect
                        animationEasing: "easeOutQuart",
                        if (this.options.animation && !reflow){
                                var animation = new Chart.Animation();
                                animation.numSteps = this.options.animationSteps;
-                               animation.minSteps = 10; // TODO: add an option for this
+                               animation.minSteps = this.options.minAnimationSteps;
                                animation.easing = this.options.animationEasing;
                                
                                // render function
        Chart.Animation = Chart.Element.extend({
                currentStep: null, // the current animation step
                numSteps: 60, // default number of steps
-               minSteps: 10, // TODO: create an option for this
+               minSteps: 10, // default minimum number of steps. 
                easing: "", // the easing to use for this animation
                render: null, // render function used by the animation service