Anycharts.com has wonderful javascript libraries to create stock charts. It is however complicated to get a mouse Y value, only a (X,Y) value of an object in the chart.
I tried everything from using the crosshair (sticks to the candles), the mouseclick event etcetera but I have so far not been able to solve this. I hoped to get the labelValue and hoped this would be the mouse coordinate in the labelValue but it turns out to be the Y coordinate of object where the crosshairs would be. For example:
chart.tooltip().format(function(e){
myLastIndex = e.index;
myLastDate = e.x;
let label = plot.crosshair().yLabel();
let labelValue = label.text();
myLastHigh = parseFloat(labelValue);
});
After enough fiddling around, found that changing the crosshair setting from "sticky" to "float" was the answer.