javascript - Reversing SVG text on bottom of a radial? -
text past degree should mirrored...i'm positive it's translate attribute, think may have redo way i'm appending text & textpath, maybe svg:path before it. when apply translate
doesn't seem relative anything.
path.append("text") .style("font-size", "15px") .attr("dy", function(d) { return 20 - (d.value / 2) // return (d.value * 15) - (d.value * 2); }) .attr('transform', function(d) { var angle = (d.x + d.dx / 2) * 180 / math.pi - 90; if (math.floor(angle) == 119) { return "" } else { return "" } // return 'scale(-1 1)' }) .append("textpath") .attr("textlength", function(d, i) { return 120 - * 4; }) .attr("xlink:href", function(d, i) { // debugger; return "#" + d.name + i; // return "#" + (i); }) .attr("startoffset", function(d, i) { return 3 / 29; }) .attr("dy", "-1em") .text(function(d) { return d.name; })
any appreciated. not sure if i'm on right track.
Comments
Post a Comment