[Chartjs]-Populate colors on a Chart.js chart dynamically

0👍

If you set background color in this way you set the background color of the first 5 elements because is array of color:

backgroundColor: [
            'rgba(255, 99, 132, 0.6)',
            'rgba(54, 162, 235, 0.6)',
            'rgba(255, 206, 86, 0.6)',
            'rgba(75, 192, 192, 0.6)',
            'rgba(153, 102, 255, 0.6)'
        ],

To resolve this you must insert just one background color but not in string array. Example:

backgroundColor: 'rgba(255, 99, 132, 0.6)'

Leave a comment