Chartjs-Chart.js: Why are there two y axes in my line graph?

1👍

Because you have two axes defined for yAxes. Using proper indentation helps notice these:

yAxes: [
  {
    ticks: {
      min: 6, 
      max:16,
    },
    color: 'white',
  },
  {
    gridLines: {
      color: 'white', //give the needful color
      zeroLineColor: 'white',
    }
  },
],

See how after color you close the object and start another. Put them as one object and you won’t have two axes:

yAxes: [
  {
    ticks: {
      min: 6, 
      max:16,
    },
    color: 'white',
    gridLines: {
      color: 'white', //give the needful color
      zeroLineColor: 'white',
    }
  },
],

Leave a comment