fernandom
Posts: 8
Joined: Tue Dec 21, 2021 3:17 pm

Get ElementRef from point on click

Hi,
I´m currently using a line chart where when click a data point a function is fired taking the SeriesClickEventObject as parameter.
Then I want to be able to create a custom popover box positioned near the clicked point. However, to do this I need to be able to retrieve the ElementRef from the point clicked.

Is there anyway to obtained the element ref from the point?

I´m using the latest version o Highcharts-angular.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Get ElementRef from point on click

Hi fernandom,

Thanks for contacting us with your question.

You can use a point.graphic.element as point element ref.
Demo: https://stackblitz.com/edit/highcharts- ... ine-31ptei

Let me know if you have any further questions!
Regards!
Mateusz Bernacik
Highcharts Developer
fernandom
Posts: 8
Joined: Tue Dec 21, 2021 3:17 pm

Re: Get ElementRef from point on click

mateusz.b wrote: Wed Jan 12, 2022 1:19 pm Hi fernandom,

Thanks for contacting us with your question.

You can use a point.graphic.element as point element ref.
Demo: https://stackblitz.com/edit/highcharts- ... ine-31ptei

Let me know if you have any further questions!
Regards!
Thank you! That was the solution I was looking for!
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Get ElementRef from point on click

You're welcome! In case of any further questions, feel free to contact us again.
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”