1👍
I believe your dataset is wrongly structured.
For stacked bar chart, the structure should be like this:
"datasets": [{
"label": "MY",
"stack": "stack1",
"backgroundColor": "#f9aabd",
"data": [2, 2, 22]
}, {
"label": "ID",
"stack": "stack1",
"backgroundColor": "#ff980070",
"data": [41, 64, 25]
}, {
"label": "PH",
"stack": "stack1",
"backgroundColor": "#cce1f3",
"data": [26, 3, 0]
}]
For each "country code" (MY, ID, PH), there should be one object. The values for the months are specified in the data array respectively.
The stack
attribute specifies name of the stack in the particular month. If you specify more stack
s, there will be more columns for each of the months.
- Chartjs-Is there anyway to remove the dots for points from angularjs charts
- Chartjs-How to highlight stack bar in ChartJS with onclick
Source:stackexchange.com