1

I am creating some geometrical figures on my web pages, for which I am using RaphaelJS. Currently, I have some animated circles.

I want to add pie shapes to my web page as well, and the trickier thing about which I don't known how to go about is adding content inside those pie shapes. How do I add the pie on my web page, inside which I can place content such as text, images etc. (or for that matter other html elements as well)

Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
user1240679
  • 6,829
  • 17
  • 60
  • 89

1 Answers1

1

Using RaphaelJS, you can create text like this:

paper.text(50, 50, "Blueberry\nPie!");

You are going to want to pass the x,y position as a variable that is relative to your pie slice. Here is some example code for pie charts: raphaeljs.com/pie.html.

Also, I found this tutorial that looks pretty good: http://net.tutsplus.com/tutorials/javascript-ajax/an-introduction-to-the-raphael-js-library/

Lokapujya
  • 26
  • 3