knownasilya/d3.chart.pie — pull request #3 by tafsiri (2014-11-04 22:15:11+00:00)
Title: Allow the color palette to be customized.

The colors setter takes a function that will either be passed the index of the data or the data element and its index based on the arity of that function.

Second PR with changes that were useful to me. This makes it so you can set a color function like so (or any custom function)

````javascript
(function() {
var data = [
{ label: 'one', value: 2 },
{ label: 'two', value: 5 },
{ label: 'three', value: 1.5 },
{ label: 'other', value: 1 }
],
pie = d3.select('#pie')
.append('svg')
.attr('width', 450)
.attr('height', 300)
.chart('Pie', {
width: 450,
height: 300,
radius: 100,
donutHole: {
radius: 80,
color: 'white'
},
labelTemplate: '{label}: {value}',
legend: false
})
.colors(function(d, i){
var col = d3.scale.ordinal()
.domain(['one', 'two', 'three', 'four'])
.range(['crimson', 'coral', 'goldenrod', 'orange']);
return col(d.label);
});

pie.draw(data);
}());
````