Users could be notified by chart which item touched so we need to implement a callback feature for all over the library to be able to use it in many places without repetition
options: {
onClick: (e) => {
const canvasPosition = Chart.helpers.getRelativePosition(e, chart);
// Substitute the appropriate scale IDs
const dataX = chart.scales.x.getValueForPixel(canvasPosition.x);
const dataY = chart.scales.y.getValueForPixel(canvasPosition.y);
}
}
Users could be notified by chart which item touched so we need to implement a callback feature for all over the library to be able to use it in many places without repetition