Search code examples
dojodojox.charting

Dojo charts, replace linear acceleration in animation


When using the chart module (here a barchart) defined in Dojo, there is the possibility to set an animation like this :

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

My question is the following:

  • How can you replace the linear acceleration of the animation, by a "gravity"-like, accelerated animation ?

Thanks in advance !


Solution

  • You can try something like the following:

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

    See dojo/fx/easing for various easing functions.