[Chartjs]-Changing style of individual point Chart.js

10👍

https://jsfiddle.net/e8n4xd4z/15822/

You can use an array of colors to the pointBackgroundColor in the options as follows

pointBackgroundColor: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"]

Then if you want to change any individual point color later you can do that as follows

myChart.config.data.datasets[0]['pointBackgroundColor'][4] = 'red';

I have attached the link to the updated jsfiddle. You can check that. Cheers!

Leave a comment