http://www.w3.org/TR/SVG/text.html#TextElement
There are a number of examples in the Git repository, the wiki, and
the website that show how to use svg:text elements. Typically, you use
x & y attributes (or a transform) to set the position, and then the
text operator to set the content. The fill style controls the color.
The text-anchor, dx & dy attributes are used to control alignment and
baseline.
If you want help debugging your code, please post it to the group so
we can see what the error is.
Mike
You could probably calculate a center of mass or something but my guess is you'd still be unhappy with the result. I'd make all the labels draggable, manually adjust their placement and then serialize the json of there positions for reuse.
Perfect centers won't help in the north east for example