Tooltip with dynamic height depending on text to display

This commit is contained in:
Jan Philipp Timme 2017-12-29 23:52:12 +01:00
parent 73536d4871
commit c1d8b95aa0

View File

@ -263,7 +263,7 @@ function createLineGraph(containerId, raceData){
tooltipGroup.append("rect") tooltipGroup.append("rect")
.attr("style", "fill:rgb(225,225,225);stroke:black;stroke-width:2;") .attr("style", "fill:rgb(225,225,225);stroke:black;stroke-width:2;")
.attr("width", "150") .attr("width", "150")
.attr("height", "100") .attr("height", (textArr.length + 1) + "em")
.attr("x", function() { return x(d.lap) + 10; }) .attr("x", function() { return x(d.lap) + 10; })
.attr("y", function() { return y(d.position) + 10; }); .attr("y", function() { return y(d.position) + 10; });