score:1

Accepted answer

Add color:['#FFC455', '#00A6CD', '#CE1B1F'], to the chart:

    chart: {
        color:['#FFC455', '#00A6CD', '#CE1B1F'],
        type: 'pieChart',
        height: 500,
        x: function(d){return d.key;},
        y: function(d){return d.y;},
        showLabels: false,
        duration: 500,
        labelThreshold: 0.01,
        labelSunbeamLayout: true,
        legend: {
            margin: {
                top: 5,
                right: 35,
                bottom: 5,
                left: 0
            }
        }
    }

If you want to mimic the background color of the example, change the <body> tag to :

<body ng-controller="MainCtrl" style="background-color: #2F2F2F">

score:0

Change script like below.

See working example here.

http://plnkr.co/edit/0nETt0rPnfbtJUevYBpX?p=preview

<script type="text/javascript">
    var app = angular.module('plunker', ['nvd3']);

app.controller('MainCtrl', function($scope) {

  $scope.color = ['red','blue','green'];

  $scope.options = 
  {
            chart: {
                type: 'pieChart',
                height: 500,
                x: function(d){return d.key;},
                y: function(d){return d.y;},
                showLabels: false,
                duration: 500,
                labelThreshold: 0.01,
                labelSunbeamLayout: true,
                legend: {
                    margin: {
                        top: 5,
                        right: 35,
                        bottom: 5,
                        left: 0
                    }
                },
                color:function(d)
                {
                    console.log(d);
                    return $scope.color[d.y];

                }
            }
        };

        $scope.data = [
            {
                key: "CAT I",
                y: 2
            },
            {
                key: "CAT II",
                y: 3
            },
            {
                key: "CAT III",
                y: 1
            },
        ];
});

</script>

Related Query