re96
re96

Reputation: 61

Right it can be specified as the value of the text anchor attribute?

This d3 code is correct?

   .attr("text-anchor", "right")

Possible values, start, middle, end only? https://developer.mozilla.org/en/docs/Web/SVG/Attribute/text-anchor

Did you mean right is, d3 own specifications?

Upvotes: 0

Views: 109

Answers (1)

user4895544
user4895544

Reputation: 103

you're right.The documentaion shows only three properties start, mid and end. Again you have many options to change the direction or position of the text.

1)

.style("text-anchor","mid") // you can change to start, end
            .attr("startOffset","50%") //you can change the percentage of offset
            .text("Your Text");

2)there is a property "Text Direction" in style

.style("direction","rtl") //where rtl stands for right to left 

Hope this is what you're looking for.

Upvotes: 1

Related Questions