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

annotation parallel channel extend to right

is it possible to extend any annotation (specially parallel channel) all the way to the right end of chart.. ? like end to plot area..
but also without changing the default control point..

I tried extending parallel channel annotation by modifying the typeOptions.points.. but that is changing the control points as well..
i would like to keep the original control points.

so like Ray.. it is extended to both edges.. but shows controls points where i clicked (selected 2 points)

Hope this make sense..
Thanks
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: annotation parallel channel extend to right

Hi!

Thanks for reaching out to us with your question!

Of course, you have the possibility to extend Highcharts by wrapping functions or even fully overriding them. You can read more about it here: https://www.highcharts.com/docs/extendi ... highcharts. As for making parallel channel extend to the end of plot area without changing the control points (like in the Ray arrow), you'd have to incorporate InfinityLine functions responsible for finding plot area edges as the parallel channel is created. Then, during the shapes creation, they would have to be extended, so that their end points are related directly to InfinityLine edge points.

Here are the methods responsible for finding edge points:
https://github.com/highcharts/highchart ... s#L48-L159

And here are functions that create Tunnel type annotations, such as parallel channel:
https://github.com/highcharts/highchart ... 8C3-L149C6

Let me know if you happen to have any more questions!
Best regards!
Jędrzej Ruta
Highcharts Developer
jahnvi25
Posts: 284
Joined: Thu Oct 04, 2012 12:16 pm

Re: annotation parallel channel extend to right

so its not possible to extend to end of the plot area, after annotation is created unless i re-draw..we would like to provide settings to the user "Extend to Right" and "Extend to Left"... any of those are selected.. then lines would have to extend... so unless i write my own binding (modification of parallel channel) its not possible ? since i would not have access to those methods...

Thanks
jedrzej.r
Posts: 700
Joined: Tue Jan 24, 2023 11:21 am

Re: annotation parallel channel extend to right

Indeed, after the annotation is created, it would require heavy modification, such as extending the popup with custom selection box and processing this setting, so that parallel channel can be extended. Other way around could be by adding a SVGRenderer path with starting points as ending points of parallel channel, and end points as end of plot area. Although this approach seems easier to achieve, it would also require incorporating a function calculating end points from the linear equation. I'm afraid that this functionality goes beyond the scope of our forum. If you need help with your implementation, you can try to look for it on the more general forums like StackOverflow or contact the Black Label company that specializes in Highcharts custom projects. See official Black Label site: https://blacklabel.pl

To sum up: the best way to achieve described effect is by creating your own binding or overriding Tunnel type annotation method, which can be found in this file: https://code.highcharts.com/modules/ann ... ced.src.js

API: https://api.highcharts.com/class-refere ... derer#path

Let me know if you have any more questions!
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Stock”