Chartjs-Laravel – Leave status is giving wrong result in chartjs BarChart

0πŸ‘

βœ…

Some of your bars may be present in the chart but actually hidden because the yAxis starts at 1. Therefore you should add the following scales.yAxes.ticks definition inside the chart options. This will also solve the problem with the decimals in the yAxis tick labels.

options: {
  scales: {
    yAxes: [{
      ticks: {
        beginAtZero: true,
        stepSize: 1
      }
    }]
  }
  ...

Make sure also, that the position of the values in individual datasets.data arrays is the same as the corresponding label in the labels array. That way, the bars should appear at the correct position also.

Leave a comment