If you set the rotation transform (180), it rotates the element relative to the beginning , but not relative to the text anchor. So, if your text elements also have the x and y attribute set to place them, it is likely that you rotated the text overs. For example, if you tried,
<text x="200" y="100" transform="rotate(180)">Hello!</text>
the text anchor will be at the level of β¨-200 100β©. If you want the text anchor to remain at the β¨200,100 level, you can use the transform to place the text before rotating it, thereby changing the origin.
<text transform="translate(200,100)rotate(180)">Hello!</text>
Another option is to use the optional cx and cy arguments for the SVG rotate transform so that you can indicate the start of the rotation. This ends up being a little redundant, but for completeness it looks like this:
<text x="200" y="100" transform="rotate(180,200,100)">Hello World!</text>
mbostock Jun 29 '12 at 6:30 2012-06-29 06:30
source share