Chartjs-Vertical grid line not taking full hight of the canvas in chart js 3.3.2

0👍

I was assuming that instead of defining scales.y.grid.display: false, scales.y.grid.drawOnChartArea: false would work, but it doesn’t.

As a workaround, you can define scales.y.grid.color as shown below.

scales: {
  y: {        
    grid: {
      color: ['rgb(180,180,180)', null, null, null, 'rgb(180,180,180)'],
      drawTicks: false
    },
    ...

Please take a look at your amended StackBlitz and see how it works.

Leave a comment