1๐
If you have switched to chart.js v2, this error will occur since there is a new syntax.
Here is a link to the issue and here is a link to the new syntax.
Here is an example:
var config = {
type: 'pie',
data: {
datasets: [{
data: [
pAmt,
iAmt,
pFee
],
backgroundColor: [
"#F7464A",
"#46BFBD",
"#FDB45C"
],
}],
labels: [
"Principal Amount",
"Interest Amount",
"Processing Fee"
]
},
options: {
responsive: true
}
};
window.onload = function() {
var ctx = document.getElementById("emichart").getContext("2d");
window.myPie = new Chart(ctx, config);
};
- [Chartjs]-Chart js. How to align text by the center of the tooltip?
- [Chartjs]-Chart js how to fill legend box with colour
Source:stackexchange.com