D3 text wrap with text-anchor: middle
问题 In D3 I would like to wrap texts which have a middle text anchor. I looked at this example from Mike Bostok but I cannot wrap my head around the settings. I would like to see the text to be in the center (horizontal and vertical) of the red box. var plot = d3.select(container) .insert("svg") .attr('width', 100) .attr('height', 200); plot.append("text") .attr("x", 50) .attr("y", 100) .attr("text-anchor", "middle") .attr("alignment-baseline", "alphabetic") .text("The brown fox jumps!") .call