1

使用 Dojo 中定义的图表模块(此处为条形图)时,可以设置如下动画:

chart.addPlot('default', {
    type: 'Columns',
    markers: true,
    animate: {duration: 1000}
});

我的问题如下:

  • 如何用类似“重力”的加速动画代替动画的线性加速度?

提前致谢 !

4

1 回答 1

2

您可以尝试以下方法:

require(["dojo/fx/easing", ...], function(easing, ...){
  chart.addPlot('default', {
      type: 'Columns',
      markers: true,
      animate: {duration: 1000, easing: easing.cubicIn}
  });
});

有关各种缓动函数,请参见 dojo/fx/easing。

于 2013-05-28T15:06:51.747 回答