动画
以下为全局选项,在中定义。
'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'
参考 Robert Penner's easing equations.
onProgress
和onComplete
回调对于外部操作同步到图表动画,回调传递一个Chart.Animation
实例:
var chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
animation: {
onProgress: function(animation) {
progress.value = animation.animationObject.currentStep / animation.animationObject.numSteps;
}
}
}
这些回调的另一个例子可以在上找到:该示例显示一个进度条,显示动画的距离。