Commit 4b8f2aeb by Axel Pirek

Fix tooltips sometimes rendering outside of graph panel

I noticed tooltips on other panels rendering outside of their panel or
even the browser window when hovering on the very edge of graphs with
relative time overrides.
parent 138a79c2
......@@ -181,8 +181,8 @@ function ($, core) {
// get pageX from position on x axis and pageY from relative position in original panel
if (pos.panelRelY) {
var pointOffset = plot.pointOffset({x: pos.x});
if (Number.isNaN(pointOffset.left) || pointOffset.left < 0) {
$tooltip.detach();
if (Number.isNaN(pointOffset.left) || pointOffset.left < 0 || pointOffset.left > elem.width()) {
self.clear(plot);
return;
}
pos.pageX = elem.offset().left + pointOffset.left;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment