
const config = {
  type: 'bar',
  data: data,
  options: {
    animation: {
      onComplete: () =&gt; {
        delayed = true;
      },
      delay: (context) =&gt; {
        let delay = 0;
        if (context.type === 'data' &amp;&amp; context.mode === 'default' &amp;&amp; !delayed) {
          delay = context.dataIndex * 300 + context.datasetIndex * 100;
        }
        return delay;
      },
    },
    scales: {
      x: {
        stacked: true,
      },
      y: {
        stacked: true
      }
    