Tooltip positioning; absolute vs fixed

Share RGraph:   Share or Like RGraph on Facebook!

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by MNewman on 20th February 2013
In my current layout, my canvas tags are placed as fixed elements in the layout. When I set hover tooltips on the piechart I'm displaying, the absolute positioning of the tooltips doesn't follow scrolling down the page (for example, they display near the top, off screen, while viewing at the bottom of the page).

As a temporary fix for this particular instance, I've modified line 87 in RGraph.common.tooltips.js to read
tooltipObj.style.position = 'fixed';
rather than
tooltipObj.style.position = 'absolute';


What's a better way to handle this?
Posted by RGraph support on 21st February 2013
Hi there,

No fix at the moment - the getMouseXY() doesn't currently support fixed positioning. Waht you have now may be fine if the canvas itself is fixed, but if the canvas is in a DIV that's fixed (or more likely, a table) - it may break;




Richard
Posted by RGraph support on 21st February 2013
Hi there,

Evidentally it was easier than I first thought. It will be part of the next beta.


Richard, RGraph Support
Posted by RGraph support on 3rd March 2013
Hi there,

I've now modified the tooltip function so that it now checks to see if the canvas or one of its parents is fixed. If it is then the tooltip position is fixed. There's the demo here where the canvas sits in a table which in turn sits in a DIV. And the DIV is fixed (so the table and canvas are too).



Richard, RGraph Support

Add a reply




« Back to message list