3👍
The click
attribute on the canvas element is expecting a callback. In your code, you put the result of the function onClick
as a callback (undefined), not the function itself. So basically, you can remove the paranthesis in your code :
<canvas id="line" class="chart chart-line chart-xl" data="data" labels="labels" legend="true" click="onClick" series="series"></canvas>
Hope this helps,
Cheers
- [Chartjs]-Chartjs v2 xAxes label overlap with scaleLabel
- [Chartjs]-Shorten number labels in Charts.js
Source:stackexchange.com