Question

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 !

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top