Highcharts: how to make tooltip position visible in viewport
I am using a vertical length chart that is wrapped inside a container with credential scrolling enabled. Everything works fine. However, when I create a tooltip (large in my case), it hides from time to time because it thinks the chart view port is large. Is there a way to make the tooltip at a fixed position, or always appear in the viewport of the parent container?
Example fiddle with similar issue: http://jsfiddle.net/Swsbb/52/
<div style='max-height:300px;overflow-y:auto'>
<div id="container" style="height: 1000px"></div>
</div>
+3
source to share
1 answer
The tooltip has a useHTML option that adds advanced formatting to the tooltip, and the positioner option is a callback function that allows you to change the position for the tooltip.
// fixed position
positioner: function () {
return { x: 10, y: 10 };
},
// change position only for y
positioner: function (labelWidth, labelHeight, point) {
return { x: point.plotX, y: point.plotY - 50 };
}
+1
source to share