From: Evert Timberg Date: Sat, 11 Apr 2015 23:33:20 +0000 (-0400) Subject: Integrate animation service with chart X-Git-Tag: v2.0-alpha~37^2~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e59438646382d66b2b1313731f237f43c4cc9dc;p=thirdparty%2FChart.js.git Integrate animation service with chart --- diff --git a/src/Chart.Core.js b/src/Chart.Core.js index 36f58723c..2a7908c6b 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -2076,9 +2076,9 @@ Chart.animationService = { animations: [], - addAnimation: function(chart, animationObject) { + addAnimation: function(chartInstance, animationObject) { for (var index = 0; index < this.animations.length; ++ index){ - if (this.animations[index].chart === chart){ + if (this.animations[index].chartInstance === chartInstance){ // replacing an in progress animation this.animations[index].lastTimeRun = null; this.animations[index].animationObject = animationObject; @@ -2087,7 +2087,7 @@ } this.animations.push({ - chart: chart, + chartInstance: chartInstance, animationObject: animationObject, lastTimeRun: null }); @@ -2109,7 +2109,7 @@ currentAnimation.animationObject.currentStep++; } - currentAnimation.animationObject.render(currentAnimation.animationObject); + currentAnimation.animationObject.render(currentAnimation.chartInstance, currentAnimation.animationObject); if (currentAnimation.animationObject.currentStep == currentAnimation.animationObject.numSteps){ // executed the last frame. Remove the animation.