[Chartjs]-Some bars of the bar graph are disappearing from Chart.js

1👍

You don’t need to specify yAxis to datasets(It’ll be good way what you have done if you have 2 datasets only), it will be there anyway,you are adding data to yAxis in case that you are creating vertical chart, it’s only overwriting your data in this case. Remove yAxisID: 'yAxis1' and yAxisID: 'yAxis2' from datasets. It’ll work.

What you need is:

   ticks: {
       max: 80,
       min: 0
   }

Add this to your yAxis conf, it’will look like:

scales: {
      yAxes: [
          {
              id: 'yAxis1',
              position: 'left',
              ticks: {
                  max: 80,
                  min: 0
              }
          },
          {
              id: 'yAxis2',
              position: 'right',
              ticks: {
                  max: 80,
                  min: 0
              }
          }
      ]
  }

Leave a comment