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 thecanvas
is great
var chr = new Chart(ctx, {
data: graphData,
type: 'pie',
options: options,
});
Source:stackexchange.com