Chartjs-Why does the horizontal bar size jump when resizing the chart?

0👍

The scale is being recalculated when the chart is resized and the x-axis does not begin at zero, causing the bar to resize unexpectedly.

Setting the beginAtZero property to true will fix the issue:

options: {
  scales: {
    xAxes: [{
      ticks: {
        beginAtZero: true
      }
    }]
  }
}

Leave a comment