nnnick/Chart.js — pull request #35 by Regaddi (2013-03-20 08:18:03+00:00)
Title: Added basic labels to Pie chart

Hi!
I implemented some basic labelling to the pie chart, as I missed some labels on it.
The text is rotated with the angle of the pie segment and aligns to the outer edge with a little padding of 10px. It is rendered readable, so no upside down text!

You can style the labels like the following inside the pieData:

var pieData = [
{
value : 30,
color : "#F38630",
label : 'Sleep',
labelColor : 'white',
labelFontSize : '16'
},
...
];

You can choose just any valid css color, like HEX-Codes, RGBs or named colors.

Important to mention: I implemented this as an optional feature, so if you don't need labels, just leave them off. You can also label a segment, while not labelling another and vice versa.

![Screenshot from 2013-03-20 09:13:01](https://f.cloud.github.com/assets/1336590/279699/217ea190-9136-11e2-80b2-2417c9a24e70.png)