I am trying to show count report in stacked vertical bar chart using angular chart (ngx-charts-bar-vertical-stacked), but I'm getting the following error:
dynamically build the data so for example //app.ts i declare
array chartDataNGX:any[];
then in constructor call getChatrtData()
then in getchartdata i go something like
this.chartDataNGX.push(
{"name": "TEST2","series": [
{"name": "Target","value": 40632},
{"name": "Actual","value": 36953},
{"name": "Projected","value": 31476}
]},
{"name": "TEST3","series": [
{"name": "Target","value": 40632},
{"name": "Actual","value": 36953},
{"name": "Projected","value": 31476}
]
});
it fails with 'Cannot read property 'length' of undefined' so what am i doing wrong?
Please help.