I have a d3 pie chart with color function:
var color = d3.scale.ordinal() .range(['#0075B4', '#70B5DC']);
If there are only two values ββ/ pieces, this works. But if there are more, I want to choose colors between two data.
![d3 pie chart](https://fooobar.com//img/48cd8d05a51bd767317434b7534beae5.png)
Above, with three pieces of cake, a piece labeled βCost 3β will have a color that is between #0075B4
and #70B5DC
.
Is this possible with d3? Here is the jsfiddle of what I have so far: http://jsfiddle.net/9ruzntrr/1/
source share