Agi la
Agi la

Reputation: 137

Pie chart Slice color Change Dynamically in Highcharts

How to change Pie slice color dynamically. I want to change the color of the each slice which is there in the hidden variable assignedvalueZoom. Can some one help?

Upvotes: 1

Views: 3308

Answers (1)

SteveP
SteveP

Reputation: 19103

You can define the color for each point in your data array like this:

for(j=0;j<name.length;j++) { 
    var temp = {
        x:name[j],
        y:value[j],
        color:color[j]
    };
    dataArrayFinal[j] = temp; 
}

This expicitly sets the x, y and color attributes of each data point.

http://jsfiddle.net/xktj3/

Upvotes: 3

Related Questions