score:0

you need to add this html below

<canvas id="canvas"></canvas>
<progress id="animationprogress" max="1" value="0" style="width: 100%"></progress> // you missed this html
        
var months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
        var progress = document.getelementbyid('animationprogress'); // and missed this
        
      
        var config = {
            type: 'line',
            data: {
                labels: ["january", "february", "march", "april", "may", "june", "july"],
                datasets: []// your dataset
            },
            options: {
                title:{
                    display:true,
                    text: "progress bar"
                },
                animation: {
                    duration: 2000,
                    onprogress: function(animation) {
                        //add progress
                        progress.value = animation.currentstep / animation.numsteps;
                    },
                    oncomplete: function(animation) {
                        window.settimeout(function() {
                            progress.value = 0;
                        }, 2000);
                    }
                }
            }
        };

        window.onload = function() {
            var ctx = document.getelementbyid("canvas").getcontext("2d");
            window.myline = new chart(ctx, config);
        };


Related Query

More Query from same tag