jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

annotation closepopup

is there a way not to close annotation edit dialog.. even if user clicks outside,. i have certain situation in which i need annotation dialog to stay open.
i have custom annotation edit dialog.. as shown in screenshot below which has color chooser (input type = 'color') and when user chooses the color and clicks outside(on plot or chart area) which triggers event to close popup.. which i would like avoid.
error.png
error.png (78.97 KiB) Viewed 488 times
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: annotation closepopup

Please any reply for this question ?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: annotation closepopup

Hello jahnvi25,

Thanks for contacting us with your question.

It is not possible to do something like that from API level. You need a plugin. Here is a demo: https://jsfiddle.net/BlackLabel/83zgdsvu/
More info about extending Highcharts: https://www.highcharts.com/docs/extendi ... highcharts

Let me know if that was what you were looking for!
Regards!
Mateusz Bernacik
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: annotation closepopup

Thanks a lot. it looks like its working.. but i would need to understand plugin code and stuff. not familiar with that part yet..
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: annotation closepopup

Hi jahnvi25,

The change that I did was actually very small. I found in code a function which was responsible for closing that popup and commented out that functionality.

Code: Select all

  !closestPolyfill(clickEvent.target, '.' + PREFIX + 'popup')) {
        //fireEvent(navigation, 'closePopup');
Even though the change is very small there is a lot of code because I had to overwrite whole bindingsChartClick method. Sometimes it is possible to only alter returned value and in such cases there is usually less code. You can read more about it in the linked article.

Anyway, glad to hear it works for you.
Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”