Tooltip positioning; absolute vs fixed

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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;

PS Could you link to the RGraph website - thanks.

Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/support
Posted by RGraph support on 21st February 2013
Hi there,

Evidentally it was easier than I first thought - here's a page that has a fixed position DIV which contains a table which contains the canvas:

dev.rgraph.net/tests/2013-02-28/fixed-positioning.html

It will be part of the next beta.


PS Could you link to the RGraph website - thanks.

Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/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).

dev.rgraph.net/tests/2013-02-28/fixed-positioning.html


Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/support

Add a reply




« Back to message list