This sample is to set the fill color by using user-defined JavaScript function.

The JavaScript function returns a hexadecimal color code based on value.
You need to set the value of fillJsFunction to the name of the JavaScript function.
●Layout
<Pie2DSeries yField="Profit" fillJsFunction="fillJsFunc"/>

●Script

Parameters:
seriesId: Series ID 
index: The index of the item in the series.
data: The record of the dataset declared for creating the chart.
values: The value is an array and each element in the array is different depending on the chart type.
	Bar2D(3D)Series      0: X-axis value, 1: Y-axis value
	Column2D(3D)Series   0: X-axis value, 1: Y-axis value
	Area2DSeries         0: X-axis value, 1: Y-axis value
	Bubble3DSeries       0: X-axis value, 1: Y-axis value 2: radius
	Line2DSeries         0: X-axis value, 1: Y-axis value
	Pie2D(3D)Series      0: value, 1: percentage, 2: nameField

function fillJsFunc(seriesId, index, data, values)
{
	if(values[0] > 2000)
		return "0xB2CCFF";
	else if(values[0] > 1000)
		return "0x85ADFF";
	else
		return "0x5C8AE6";	
}