how can I add labels to g.raphael pie chart

214 views Asked by At

I want to add labels to a g.raphael pie chart to display with each segment. I can't find any code to do this and haven't been able to figure it out on my own - can anyone help?

1

There are 1 answers

0
RodrigoDela On

I would suggest that you go with the example code from raphael: http://raphaeljs.com/pie.html

The label is added in this line:

 txt = paper.text(cx + (r + delta + 55) * Math.cos(-popangle * rad),
 cy + (r + delta + 25) * Math.sin(-popangle * rad), 
 labels[j]).attr({fill: bcolor, stroke: "none", opacity: 0, "font-size": 20});