Chartjs-SetInterval on myDoughnut animation

2👍

You should pass a proper function to setInterval.

I looked for a way to replay the animation of Chart object but i couldn’t find any directive in ChartJS documentation.

Here is how you function should look like:

setInterval(function () {
  myDoughnut = new Chart(document.getElementById("CSS3").getContext("2d")).Doughnut(doughnutData);
           }, 2000);

Here is working JSFiddle.

2👍

setInterval takes a function as parameter.

Try:

setInterval(function(){ Chart(); }, 500);

Leave a comment