I'm not sure how I need to use the events specified in the docs like getElementsAtEvent. Are there any examples on this? Or can you provide one?
i would like to know more too
Hello,
Example would be similar to Bar example just you would add:
getElementsAtEvent: (elems) => {}
To the list of defined properties for the Bar component, so it would look like:
<Bar
data={data}
width={100}
height={50}
getElementsAtEvent={(elems) => {
console.log(elems);
}}
options={{
maintainAspectRatio: false
}}
/>
Kr,
@gor181 and what is the event that triggers it? I mean is it when the chart changes or you click on the chart or ... ?
As seen in this jsfiddle, (not rcjs2 but shows chart.js functionality) https://jsfiddle.net/f417uxcx/ it shows that this function is called from a user clicking on an active point. Hope this helps!
@jerairrest Yes it does thanks!
Most helpful comment
Hello,
Example would be similar to Bar example just you would add:
getElementsAtEvent: (elems) => {}To the list of defined properties for the
Barcomponent, so it would look like:Kr,