Hi, i need your help, i have a small multiple pie and i need put individual colors in the each pie depends a value

for example

range 1 to 3 red range 3.01 to 4 yellow range 4.01 to 5 green

1 Pie have 2.5 color red
2 Pie have 3.5 color yellow
3 Pie have 4.2 color green
n Pie ......



i use this function with one pie, but i dont know to configure or adapt with multipie :


function changePie(e){
var cccOptions = this.chartDefinition;
var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);

var analizar = e.resultset;


var valor = analizar[0][2];

if(valor >= 4){
this.chartDefinition.colors = ['#727176', '#288f42'];
}
else
if(valor < 4 && valor >= 3){
this.chartDefinition.colors = ['#727176', '#d0cb22'];
}
else{
this.chartDefinition.colors = ['#727176', '#a82522'];
}



}

Thanks !!!