I ran into problems in order to correctly position the custom tooltip on the Plotly.js heatmap.
I use the l2p method (why is this acronym worth it?) In combination with pointNumber data to get relative positioning in the heatmap. It looks like this:
x: point.xaxis.l2p(point.pointNumber[1]), y: point.yaxis.l2p(point.pointNumber[0])
But the problem is that it refers to the top / left pole of the svg heatmap itself without external labels x and y, so I really skip this part and wonder if there is built-in functionality to get this location information directly? The problem with using external divs as a tooltip area is that they are completely outside the chart, and for this purpose I need information with reference to the top / left beginning outside the chart and the axis designation.
Which seems to work to use the private private _offset property and add it at the x and y positions above, so I get
x: point.xaxis.l2p(point.pointNumber[1]) + point.xaxis._offset, y: point.yaxis.l2p(point.pointNumber[0]) + point.yaxis._offset
But it looks pretty unpleasant to me. Can someone point me to some kind of documentation or demo on how to do this? for heat map?
source share