# Animation Progress Bar

# Initial animation

# Other animations

const config = {
  type: 'line',
  data: data,
  options: {
    animation: {
      duration: 2000,
      onProgress: function(context) {
        if (context.initial) {
          initProgress.value = context.currentStep / context.numSteps;
        } else {
          progress.value = context.currentStep / context.numSteps;
        }
      },
      onComplete: function(context) {
        if (context.initial) {
          console.log('Initial animation finished');
        } else {
          console.log('animation finished');
        }
      }
    },
    interaction: {
      mode: 'nearest',
      axis: 'x',
      intersect: false
    },
    plugins: {
      title: {
        display: true,
        text: 'Chart.js Line Chart - Animation Progress Bar'
      }
    },
  },
};

# Docs

Last Updated: 8/3/2022, 12:46:38 PM