]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update Chart.js 2118/head
authorDavid Cochrum <davidcochrum@users.noreply.github.com>
Fri, 11 Mar 2016 17:21:45 +0000 (12:21 -0500)
committerDavid Cochrum <davidcochrum@users.noreply.github.com>
Fri, 11 Mar 2016 17:21:45 +0000 (12:21 -0500)
Chart.js

index 7cdf767e314a3596736c2a0f0bdb54017464cb5d..8a518d883bf2ced100280fcf6550b0581c723a60 100644 (file)
--- a/Chart.js
+++ b/Chart.js
                        if (reflow){
                                this.reflow();
                        }
-
+                       
                        if (this.options.animation && !reflow){
                                var animation = new Chart.Animation();
                                animation.numSteps = this.options.animationSteps;
                                animation.easing = this.options.animationEasing;
-
+                               
                                // render function
                                animation.render = function(chartInstance, animationObject) {
                                        var easingFunction = helpers.easingEffects[animationObject.easing];
                                        var stepDecimal = animationObject.currentStep / animationObject.numSteps;
                                        var easeDecimal = easingFunction(stepDecimal);
-
+                                       
                                        chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
                                };
-
+                               
                                // user events
                                animation.onAnimationProgress = this.options.onAnimationProgress;
                                animation.onAnimationComplete = this.options.onAnimationComplete;
-
+                               
                                Chart.animationService.addAnimation(this, animation);
                        }
                        else{
                numSteps: 60, // default number of steps
                easing: "", // the easing to use for this animation
                render: null, // render function used by the animation service
-
-               onAnimationProgress: null, // user specified callback to fire on each step of the animation
+               
+               onAnimationProgress: null, // user specified callback to fire on each step of the animation 
                onAnimationComplete: null, // user specified callback to fire when the animation finishes
        });
-
+       
        Chart.Tooltip = Chart.Element.extend({
                draw : function(){
 
                                        return;
                                }
                        }
-
+                       
                        this.animations.push({
                                chartInstance: chartInstance,
                                animationObject: animationObject
                        var index = helpers.findNextWhere(this.animations, function(animationWrapper) {
                                return animationWrapper.chartInstance === chartInstance;
                        });
-
+                       
                        if (index)
                        {
                                this.animations.splice(index, 1);
                                if(this.animations[i].animationObject.currentStep > this.animations[i].animationObject.numSteps){
                                        this.animations[i].animationObject.currentStep = this.animations[i].animationObject.numSteps;
                                }
-
+                               
                                this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject);
-
+                               
                                // Check if executed the last frame.
                                if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){
                                        // Call onAnimationComplete
                        var index = atIndex !== undefined ? atIndex : this.segments.length;
                        if ( typeof(segment.color) === "undefined" ) {
                                segment.color = Chart.defaults.global.segmentColorDefault[index % Chart.defaults.global.segmentColorDefault.length];
-                               segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length];
+                               segment.highlight = Chart.defaults.global.segmentHighlightColorDefaults[index % Chart.defaults.global.segmentHighlightColorDefaults.length];                            
                        }
                        this.segments.splice(index, 0, new this.SegmentArc({
                                value : segment.value,
                        helpers.each(this.segments,function(segment){
                                segment.save();
                        });
-
+                       
                        this.reflow();
                        this.render();
                },
 
 
 
-}).call(this);
\ No newline at end of file
+}).call(this);