I am currently utilizing jQuery Flot in my application, but am encountering an issue with the tooltip positioned furthest to the right, causing it to overflow outside of the window. When hovering over the left point on the green line of the graph, everything appears fine. However, when I hover over the rightmost point on the green line, the tooltip element extends beyond the window.
https://i.sstatic.net/81CSR.png
This is the CSS for the tooltip element:
$("<div id='tooltip'></div>").css({
position: "absolute",
display: "none",
border: "1px solid #222",
padding: "2px 5px",
"background-color": "#000",
opacity: 0.80,
zIndex: 999,
color: "#fff"
}).appendTo("body");
Any suggestions on how to ensure that the last tooltip remains within the visible area?
Thank you for your assistance.