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

line segment annotations and others

the Default behavior of stock tool is such that you click on the line tool.. then draw the line.. then to draw another line you have to select the line tool again..

is there a way to change that and make it like toggle.. for example, select the line segment tool by clicking.. then draw line.. once done, you can still draw another or multiple lines.. and finally clicking the same 'line segment' button will turn the feature off..

Thanks
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: line segment annotations and others

Hello there,

Thank you for contacting us with that request.

Since it's not a standard Highcharts Stock functionality, please allow us to have a bit more time to prepare a solution and check whether that possible to achieve.

I'll be back with an update as soon as it's possible.

Thank you for your patience,
Best regards!
Kamil Musiałowski
Highcharts Developer
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: line segment annotations and others

Hello again,

I spoke to my team and did some investigation to check that feature, but sadly it is not implemented in our API and it's not easy to create a workaround for it since it would require to modify some of the core functionalities. If you want, you can play around with creating a custom bindings (tutorial here: https://www.highcharts.com/docs/stock/stock-tools).

In case of any other questions, feel free to contact us again,
Best regards!
Kamil Musiałowski
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: line segment annotations and others

Thanks for reply. i am trying to add custom binding. but it looks like every time annotation is drawn, deselectButton event is fired.
and even though i am trying NOT to remove the active button (or fire click event again) its not working..

can you point me to the right example please ?

https://jsfiddle.net/k47a3nre/

Do i have to modify how these (selectButton and deselectButton) gets triggered ?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: line segment annotations and others

I'm afraid that in that case, you would have to modify the functions responsible for annotation deselect, in the core files (i.e NavigationBindings.ts). Because on every deselect, you would need to immediately draw a new annotation line.

You can always create a feature request on GitHub, and with enough users voices we will consider rewriting the module to implement that functionality.
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”