How to align text vertically on a node within a Sankey diagram (D3.JS)?
问题 I have modified Mike Bostok example of a Sankey diagram in D3.Js from http://bost.ocks.org/mike/sankey/ to display the value of each node as this: Sankey http://uweb.cs.uvic.ca/~maleh2/sankey.png node.append("text") .attr("class","nodeValue"); ///align vertically?? node.selectAll("text.nodeValue") .attr("x", sankey.nodeWidth() / 2) .attr("y", function (d) { return (d.dy / 2) }) .text(function (d) { return formatNumber(d.value); }) .attr("text-anchor", "middle"); //.attr("transform", "rotate(