Mike Robinson, Ihr Beispiel half.
Für diejenigen, die sich fragen, hier ist das, was ich getan habe:
I entfernt:
svg.selectAll(".dot")
.data(data)
.enter().append("circle")
.attr("class", "dot")
.attr("cx", function(d) { return x(d.x); })
.attr("cy", function(d) { return y(d.y); })
.attr("r", 12);
und hinzugefügt:
var node = svg.selectAll("g")
.data(data)
.enter()
.append("g");
node.append("circle")
.attr("class", "dot")
.attr("cx", function(d) { return x(d.x); })
.attr("cy", function(d) { return y(d.y); })
.attr("r", 12);
node.append("text")
.attr("x", function(d) { return x(d.x); })
.attr("y", function(d) { return y(d.y); })
.text("fooLabelsOfScatterPoints");
hängten I "Text" Tags auf "g" Tags, im Gegensatz zum Anhängen von "Text" -Tags an "Kreis" -Tags. (?)
Sind Sie in diesem Beispiel sehen: http : //mbostock.github.com/d3/ex/bubble.html, und es ist Quelle: http://mbostock.github.com/d3/ex/bubble.js –
Mike, von Ihrem Beispiel, ich denke ich müssen Tags an Tags anhängen, im Gegensatz zu Tags auf Tags. Ich werde es jetzt ausprobieren. –