Animations
The following animation options are available. The global options for are defined in .
'linear'
'easeInQuad'
'easeOutQuad'
'easeInOutQuad'
'easeInCubic'
'easeOutCubic'
'easeInQuart'
'easeOutQuart'
'easeInOutQuart'
'easeInQuint'
'easeInOutQuint'
'easeInSine'
'easeOutSine'
'easeInOutSine'
'easeInExpo'
'easeOutExpo'
'easeInOutExpo'
'easeInCirc'
'easeOutCirc'
'easeInOutCirc'
'easeInElastic'
'easeOutElastic'
'easeInOutElastic'
'easeInOutBack'
'easeInBounce'
'easeOutBounce'
'easeInOutBounce'
See .
The onProgress
and onComplete
callbacks are useful for synchronizing an external draw to the chart animation. The callback is passed a Chart.Animation
instance:
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
animation: {
onProgress: function(animation) {
progress.value = animation.animationObject.currentStep / animation.animationObject.numSteps;
}
}
}
Another example usage of these callbacks can be found on Github: this sample displays a progress bar showing how far along the animation is.