I am using the template of the motion chart in D3 to create something similar. It works, but I need to do more work on it. One thing is to show the tooltip that contains all of x , y, and radius info in it. I want the tooltip to show up when the mouse moves over each bubble. Does anyone know how to do that? Thank you. The source page you can find at https://github.com/mbostock/bost.ocks.org/blob/gh-pages/mike/nations/index.html
Here is what I did:
var tooltip = d3.select("body")
.append("div")
.style("position", "absolute")
.style("z-index", "10")
.style("visibility", "hidden")
.text("a simple tooltip");
tooltip.text("my tooltip text");
var dots = svg.append("g")
.attr("class", "dots");
var dot = dots.selectAll(".dot")
.data(interpolateData(1990))
.enter().append("circle")
.attr("class", "dot")
.style("fill", function (d) {
return colorScale(color(d));
})
.on("mouseover", function(d){return tooltip.style("visibility", "visible");})
.on("mousemove", function(d){return tooltip.style("top",(d3.event.pageY-10)+"px").style("left",(d3.event.pageX+10)+"px");})
.on("mouseout", function (d){return tooltip.style("visibility", "hidden");})