. - "text-anchor"="end" "startOffset"="100%".
, , d3, , , , :
http://jsfiddle.net/CZ6Dp/8/
, , , ( ), , .
(, "left" "right" text-anchor ).
@defghi1977 , , , .
- ( ), , .
, ( ). @defghi1977 , , . , , DOM, <textPath>. ( , - DOM!)
var path = g.append("svg:path")
.attr("d", arct)
.style("fill","#ccc")
.attr("transform", "translate("+cfg.w/2+","+cfg.h/2+")")
.each(function(d,i) {
var justArc = /(^.+?)L/;
var thisSelected = d3.select(this);
var arcD = justArc.exec( thisSelected.attr("d") )[1];
defs.append("path")
.attr("id", "yyy")
.attr("d", arcD)
.attr("transform", thisSelected.attr("transform") );
});
var text = g.append("text")
.style("font-size",30)
.style("fill","#000")
.attr("dy",0)
.append("textPath")
.attr("xlink:href","#yyy")
.style("text-anchor","end")
.attr("startOffset","100%")
.text("some text");
http://jsfiddle.net/CZ6Dp/9/
, DOM load @defghi1977, , , getTotalLength. , .
.