【发布时间】:2015-05-01 14:06:45
【问题描述】:
目标:将文本附加到 d3 强制布局中的每个节点
BUG:文本附加到对象(我认为,请参见控制台)但未显示在屏幕上
这是jsfiddle。
node.append("svg:text")
.text(function (d) { return d.name; }) // note that this works for
// storing the name as the id, as seen by selecting that element by
// it's ID in the CSS (see red-stroked node)
.style("fill", "#555")
.style("font-family", "Arial")
.style("font-size", 12);
如果有任何想法,我将不胜感激。
【问题讨论】:
标签: javascript svg d3.js label force-layout