[Chartjs]-Console error when using getElementsAtEventForMode

2👍

You can’t use the global chart instance, you need to use your chart instance to call the function like so:

const chartInstance = Chart.getChart(canvasId);

const points = chartInstance.getElementsAtEventForMode("click", 'nearest', { intersect: true }, true);

0👍

In Chartjs, it has getElementsAtEventForMode not eventsForMode..
use

Chart.getElementsAtEventForMode

instead of

Chart.getElementsAtEventsForMode

Leave a comment