diff --git a/js/lib/d3.tail.js b/js/lib/d3.tail.js index 225892e30..497bde4e1 100644 --- a/js/lib/d3.tail.js +++ b/js/lib/d3.tail.js @@ -1,6 +1,7 @@ d3.tail = function() { var text = false, container, + inner, xmargin = 25, tooltip_size = [0, 0], selection_size = [0, 0], @@ -13,11 +14,12 @@ d3.tail = function() { }); function setup() { - container = d3.select(document.body) .append('div') - .style('display', 'none') - .attr('class', 'tail tooltip-inner'); + .style('display', 'none') + .attr('class', 'tail tooltip-inner'); + + inner = container.append('div'); selection .on('mousemove.tail', mousemove) @@ -28,7 +30,6 @@ d3.tail = function() { .on('mousemove.tail', mousemove); selection_size = selection.size(); - } function show() { @@ -69,7 +70,7 @@ d3.tail = function() { return tail; } text = _; - container.text(text); + inner.text(text); tooltip_size = container.size(); return tail; };