Chartjs-Is there a way to avoid grid lines and just have a plane back ground?

0👍

You can define gridLines.drawOnChartArea: false on both axes.

From Chart.js documentation.

drawOnChartArea: If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn.

Please have a look on below runnable code snippet.

new Chart(document.getElementById('canvas'), {
  type: 'horizontalBar',
  data: {
    labels: ['A', 'B', 'C', 'D'],
    datasets: [{
      label: 'data',
      data: [15, 12, 8, 13],
      backgroundColor: ['red', 'blue', 'green', 'orange']
    }]
  },
  options: {
    responsive: true,
    legend: {
      display: false
    },
    title: {
      display: false
    },
    scales: {
      yAxes: [{
        gridLines: {
          drawOnChartArea: false
        }
      }],
      xAxes: [{
        ticks: {
          beginAtZero: true
        },
        gridLines: {
          drawOnChartArea: false
        }
      }]
    }    
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
<canvas id="canvas" height="90"></canvas>

Leave a comment