0๐
You can avoid this issue by using the third parameter you get in the onClick listener, this is the chartInstance already:
onClick: (evt, activeEls, chartInstance) => {
// Custom code
}
- Chartjs-Iterating through array in Chart.js data field
- Chartjs-How to show label for second y-axis in charts.js?
Source:stackexchange.com