user1260827
user1260827

Reputation: 1520

Raphael: add text to each path

I am using Raphael for working with SVG. And, I want to add text into each path. How can I do this? This is my code on jsfiddle.
Thanks

Upvotes: 3

Views: 3154

Answers (1)

Kevin Nielsen
Kevin Nielsen

Reputation: 4433

When you say add text into each path, do you mean something as simple as placing a label centered over that particular path, like this?

http://jsfiddle.net/kevindivdbyzero/NFAAL/2/

If so, it should be really easy to bind labels as data to each path element, iterate through all the paths on the paper after you've created them, and generate labels programmatically in a single batch. It would even be feasible to structure the label generation to avoid collisions with a little bit of work.

If that's not what you were thinking of, you might want to add a little more detail to your question.

Upvotes: 11

Related Questions