[Chartjs]-Chart.js bar chart : Grid color and hide label

11👍

To hide lable i.e nothing but legend:
Use below config in options:

legend:{
       display:false
}

Thus in your code:

options: {
    legend:{
           display:false
    },  
    scales: {
        yAxes: [{
          ticks: {
            beginAtZero: true
          }
        }]
      }
    }

And, for background color use css for canvas element:

<canvas id="myChart" style="background-color: grey;">

Hope this will do for you!

Leave a comment