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

annotation complete event ??

i have a requirement where i need to save annotation after user is done adding to the chart.. i used event annotations.add.. but this is firing as soon as user clicks mouse first time..

so here is how i think annotations are drawn.. first click annotations are starting.. (this is when 'add' event fires) second clicks after user is done dragging to desire length and in advanced annotations (like parallel channel) third click to adjust the height.. during all these..i know 'afterUpdate' events is being fired..
but is there a way to know after second or third click when user is completely done drawing..

i tried using 'add' event to save annotations.. but i dont think i have enough information to store at this point.. and i need to save annotation information in database for later restore.. so i can not use 'afterUpdate'... since it is being fired too many time..

Is there another way ?
Thanks
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: annotation complete event ??

Hi,

This functionality is not possible from the API and I am not sure if it's possible to find a workaround. As soon as I get sure, I’ll inform you.

You can also file it as an enhancement on our userVoice, or on our github page. Here are the links:
https://highcharts.uservoice.com/forums ... script-api
https://github.com/highcharts/highcharts/

Best regards!
Magdalena Gut
Developer and Highcharts Support Engineer
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: annotation complete event ??

Hi again,

There is the possibility to achieve this using the wrap function.

Here you can find more information about Extending Highcharts:
https://www.highcharts.com/docs/extendi ... highcharts

Demo:
https://jsfiddle.net/BlackLabel/362kfvz4/

Let me know if you have any further questions!
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Stock”