0👍
Check creating new chart https://www.chartjs.org/docs/latest/developers/charts.html, you are missing options, structure should look like:
new Chart(ctx, {
type: 'MyType',
data: data,
options: options
});
Next thing is that labels what you send to chart should be in array, you can’t write like labels: something
it should be labels: [something]
, because it’s trying to map array with labels and you don’t have array, then it reproduces error.
- Chartjs-I want to show decimal values on my y axis but my chart doesn't show data how can i fix it?
- Chartjs-Injecting chart.js sparkline to jqxGrid widget in Angular with typescript
Source:stackexchange.com