Chartjs-Chart.js zeroLineColor does not work as expected

0👍

This is how achieved the color of zero line.

Chart.defaults.scale.gridLines.color = "#FFFFFF"; //white

0👍

Since the line is horizontal it would seem (believe me, I agree with you) that you need to put the zerLineColor on the xAxes but you need to put it on the yAxes

yAxes: [
  {
    gridLines: {
      zeroLineColor: '#000',
    }
  }
]

-1👍

datasets: [{
      label: '# of Votes',
      data: [12, 19, 3, 5, 2, 3],
      borderColor: "rgba(0, 0, 0, 1)",
    }]

Check with the above given data sets. It can convert the color of line to black.

Leave a comment