1👍
You must pass the data in the prop. I.e. fastest solution for you would be to have fillData()
return the datacollection
in the correct format.
E.g.
fillData(){
return {
datasets: [
{
data: [
this.boardColumnData[0].total.$numberDecimal,
this.boardColumnData[1].total.$numberDecimal,
this.boardColumnData[2].total.$numberDecimal,
this.boardColumnData[3].total.$numberDecimal,
],
backgroundColor: ["#83dd1a", "#d5d814", "#fdab2f", "#1ad4dd"],
borderColor: ["#83dd1a", "#d5d814", "#fdab2f", "#1ad4dd"],
},
];
}
}
You need to do the same for the options, but pass them in a new options=yourOptions()
prop.
This drove me absolutely bonkers. I hope this still helps you (or someone else).
- [Chartjs]-In bar chartjs report zero values are skipped so bars are invalid
- [Chartjs]-How to send data to chart js using angular
Source:stackexchange.com