Accepted answer

i added a new div and wrapped your code in another div so all positions stay relative to eachother

the only new code i had to add was this:

  .on("mouseover", function(d) {"#centertooltip")
        .classed("hidden", false)
        .html( + "<br />" +;

and in the div wrapper css i added:

#all {
  width: 700px;

to make sure that everything aligns properly.

here's a fork of your code: plunker

Related Query