diff --git a/js/lib/bootstrap-tooltip.js b/js/lib/bootstrap-tooltip.js index 5ade4b300..2f222f40a 100644 --- a/js/lib/bootstrap-tooltip.js +++ b/js/lib/bootstrap-tooltip.js @@ -155,12 +155,22 @@ }; function getPosition(node) { - return { - x: node.offsetLeft, - y: node.offsetTop, - w: node.offsetWidth, - h: node.offsetHeight - }; + var mode = d3.select(node).style('position'); + if (mode === 'absolute' || mode === 'static') { + return { + x: node.offsetLeft, + y: node.offsetTop, + w: node.offsetWidth, + h: node.offsetHeight + }; + } else { + return { + x: 0, + y: 0, + w: node.offsetWidth, + h: node.offsetHeight + }; + } } })(this);