Chartjs-Error when adding data on top of each bar

0👍

You issue is in your onAnimationComplete function. this.chart.barChartData is undefined which is why the code starts to fail.

Not exactly sure what you are trying to do but if you were to remove those lines that try to edit the undefined properties you will no longer receive the error. But like I say it is unclear from your question what you are trying to achieve so apart from this I do not know what to suggest.

example:
https://jsfiddle.net/leighking2/f3oec1rL/

you do have access to the options this.options and the datasets this.datasets if you wanted to set something in them?

Leave a comment