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

annotation --> parallel channels height issue

we have requirement where we store annotations in database and restore it as per demand. everything is working fine, but when user changes the height of parallel channels.. there is no way for us to save it.. since highstock does seem to save it..

https://jsfiddle.net/qewhndbm/1/

steps to re-create
1. add parallel channel to the chart
2. save the chart in local storage using button.
3. click on run again so you will get blank chart.. now restore annotation.
4. select the annotation and using control button (middle bottom) change the height of channel make it wider of very narrow.
5. save again.. and restore again.. you will notice that height is not being saved..

is this bug or may be i am missing something ?

Thanks
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: annotation --> parallel channels height issue

Hello jahnvi25,
Thank you for contacting us with your issue.

It is a bug and unfortunately, I can't provide you with any workaround at this moment, as it most likely would require some changes in the source code.

I have created a ticket with the issue:
https://github.com/highcharts/highcharts/issues/17305

Feel free to follow it for any updates and workaround.

Thanks for letting us know about the problem and in case of any further questions feel free to contact us again.
Regards!
Hubert Kozik
Highcharts Developer
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: annotation --> parallel channels height issue

Hello jahnvi25,
My colleague has found a workaround for this bug. All you need to add to your project is this plugin:

Code: Select all

(function(H) {
  H.wrap(
    H._modules['Extensions/Annotations/Types/Tunnel.js'].prototype,
    'translateHeight',
    function(proceed, ...args) {
      proceed.apply(this, args);

      this.userOptions.typeOptions.height = this.options.typeOptions.height;
    }

  );
})(Highcharts);
Demo: https://jsfiddle.net/BlackLabel/rvh0dbmf/

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”