BestCareAnyLea
BestCareAnyLea5mo ago

Chart onClick Events

Hello, I have created a line chart with Chart.js and was wondering if it is possible to have an event triggered, for example to open a modal with additional information, when one of the data points in the chart is clicked. Can anyone point me into the right direction for this? If this should or can be done with the other chart libraries I would also appreciate information on this. Thanks in advance!
2 Replies
rubenf
rubenf5mo ago
you can try passing functions in the JSON mode and follow this: https://www.chartjs.org/docs/latest/configuration/interactions.html but we haven't tried ourselves
Interactions | Chart.js
Open source HTML5 Charts for your website
rubenf
rubenf5mo ago
I suggest making it frontend script for clarity