From 131b18059a095502f14d1da0374a9b9155eac87e Mon Sep 17 00:00:00 2001 From: David Cochrum Date: Fri, 11 Mar 2016 12:21:45 -0500 Subject: [PATCH] Update Chart.js --- Chart.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Chart.js b/Chart.js index 7cdf767e3..8a518d883 100644 --- a/Chart.js +++ b/Chart.js @@ -949,25 +949,25 @@ 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{ @@ -1390,11 +1390,11 @@ 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(){ @@ -2139,7 +2139,7 @@ return; } } - + this.animations.push({ chartInstance: chartInstance, animationObject: animationObject @@ -2155,7 +2155,7 @@ var index = helpers.findNextWhere(this.animations, function(animationWrapper) { return animationWrapper.chartInstance === chartInstance; }); - + if (index) { this.animations.splice(index, 1); @@ -2185,9 +2185,9 @@ 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 @@ -2650,7 +2650,7 @@ 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, @@ -3330,7 +3330,7 @@ helpers.each(this.segments,function(segment){ segment.save(); }); - + this.reflow(); this.render(); }, @@ -3729,4 +3729,4 @@ -}).call(this); \ No newline at end of file +}).call(this); -- 2.47.2