Chartjs-Howto draw horizontalBar with dynamic thickness (automatic rescale on browser window height resize) in Chart.js 2.9.3?

0👍

Instead of using barThickness, you could define categoryPercentage together with barPercentage

datasets: [{
  categoryPercentage: 1, 
  barPercentage: 0.5,
  data: [100, 90, 85, 95]
}]

categoryPercentage: Percent (0-1) of the available width each category should be within the sample width.

barPercentage: Percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.

Leave a comment