[Chartjs]-Setting specific color per label in chart.js

2👍

var graphData = {
    labels: ['Passed', 'Failed', 'In Progress'],
    datasets: [{
        label: 'Data',
        data: [0, 5, 80],
        backgroundColor: [
            "green",
            "red",
            "yellow"
        ],
    }]
};

Or in your chart creation add the data

Only if you do the new Chart(...)

graphData as parameter to the canvas is great

var chr = new Chart(ctx, {
    data: graphData,
    type: 'pie',
    options: options,
});

jsFiddle

Leave a comment