title: applying background-color in bar chart using chart.js
body: <pre><code>var myChart = new Chart(ctx, {
  type: 'horizontalBar',
  data: {
      labels:cmpny_timing,
      datasets: [{
          label: 'Hourly Attendance',
          data: d,
          backgroundColor: [
              'rgba(255, 99, 132, 0.2)',
              'rgba(54, 162, 235, 0.2)',
              'rgba(255, 206, 86, 0.2)',
              'rgba(75, 192, 192, 0.2)',
              'rgba(153, 102, 255, 0.2)'
          ],
          borderColor: [
              'rgba(255,99,132,1)',
              'rgba(54, 162, 235, 1)',
              'rgba(255, 206, 86, 1)',
              'rgba(75, 192, 192, 1)',
              'rgba(153, 102, 255, 1)
            ],
          borderWidth: 1
      }]
  },
  </code></pre>
  
  <p>is there anyway i can change the color of each bar according to the data....i want to make background colors according to the data in my data i have an array of length 15 so is there anyway  i can create 15 colors bars dynamically rather than hardcoding the background color property of chart.js</p>