Chartjs-Chartsjs only showing two data points

0👍

Try like this, please.

<canvas id="myChart" width="400" height="80"></canvas>
    <script>
        window.onload=function() {
        var ctx = document.getElementById('myChart').getContext('2d');
        var chart = new Chart(ctx, {
             // The type of chart we want to create
             type: 'line',

             // The data for our dataset
             data: {
                   labels: ['2016-12-23','2016-12-24','2016-12-25','2016-12-26']
                   datasets: [{
                          label: 'Tests',
                          backgroundColor: 'rgb(252, 160, 12)',
                          borderColor: 'rgb(8, 19, 42)',
                          data: [200, 300, 400 100]
                          }]
                  },

                  // Configuration options go here
                  options: {
                            legend: {
                                    display: false
                                    },
                            }
                       });
                 };

       </script>

Leave a comment