title: ChartJS bar chart fixed width for dynamic data sets
body: <p>I am using ChartJs for creating bar charts. the <strong>datasets</strong> are dynamic.since the datasets are dynamic, the width of the bar is also changing.</p>
  
  <p>For Example bar width only for one label<br>
  <a href="https://i.stack.imgur.com/WP22f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WP22f.png" alt="enter image description here"></a></p>
  
  <p>Bar width for many labels
  <a href="https://i.stack.imgur.com/MoZaG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MoZaG.png" alt="enter image description here"></a></p>
  
  <p><strong>How to have fixed width for the bar irrespective of the number of labels</strong></p>
  
  <p>i am using the following option.</p>
  
  <pre><code>xAxes: [{
      barPercentage: 1,
      categoryPercentage: 0.3
  }]
  </code></pre>