var stepDecimal = animationObject.currentStep / animationObject.numSteps;
var easeDecimal = easingFunction(stepDecimal);
- chartInstance.draw(chartInstance, easeDecimal, stepDecimal, currentStep);
+ chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
};
// user events
// If there are no animations queued, manually kickstart a digest, for lack of a better word
if (this.animations.length) {
- helpers.requestAnimFrame(this.startDigest);
+ helpers.requestAnimFrame.call(window, this.digestWrapper);
}
},
+ // calls startDigest with the proper context
+ digestWrapper: function() {
+ Chart.animationService.startDigest.call(Chart.animationService);
+ },
startDigest: function() {
for (var i = 0; i < this.animations.length; i++) {
// Do we have more stuff to animate?
if (this.animations.length > 0){
- requestAnimationFrame(this.startDigest);
+ helpers.requestAnimFrame.call(window, this.digestWrapper);
}
}
};