[Chartjs]-Chart.JS i want to put different color for each Y axis value grid line color

2👍

You can change each individual line on the Y-axis by adding a color array to gridLines.

options={{
     scales: {
         yAxes: [{
             gridLines: {
                  color: ['rgba(36, 206, 0, 0.8)', 'rgba(255, 255, 0, .8)','rgba(255, 162, 0, 0.8)','rgba(36, 206, 0, 0.8)'],
             }
          }],
      },
 }}

1👍

You can set individual colors for the horizontal and vertical gridlines by adding a scales configuration to your options:

scales: {
    yAxes: [{
        gridLines: {
            color: 'green'
        }
    }],
    xAxes: [{
        gridLines: {
            color: 'red'
        }  
    }]
}

Leave a comment