Hello,
I am trying to find a way to mark the points where a straight line and a spline are crossing.
Here is an example: https://jsfiddle.net/cpm9L5yk/
I've looked at similar solutions but they only work with chart type `line` and not with `spline`.
This demo for example, finds the intersection points using linear interpolation https://jsfiddle.net/sxrbmg69/2/ but if we switch the `line` type to `spline` then it doesn't work anymore.
From what I've read I found that I have to calculate the intersections using a the method that highcharts use for drawing these splines - cubic bezier curve.
I've tried to implement that separately but when I compare the calculated points to the highcharts intersections manually I am seeing a difference.
I've read further and I found out that highcharts is using a smoothing value to the control points and maybe that's the reason for the diff that I am seeing.
viewtopic.php?t=35013
So as a last resort, looking at this thread viewtopic.php?t=36066 I understood that I have to build the control points the same way the highcharts library does but the implementation there is too complex for me to wrap my head around and I am starting to feel a bit discouraged.
Is it really that hard to detect intersections between a line and a spline? It would be great if someone is able to help me with tracing this down to a working formula.
The worst case would be to just use a `line` for all series in my chart but that would make the whole chart uglier.