DHTMLX Docs & Samples Explorer

Index
dhtmlxchart

## color

Defines the colors of chart items

Value type: string, function

Color can be set by fixed value:

    var barChart =  new dhtmlXChart({
    	color:"#66cc33",
            ...
    })

You may use string template:

    var chart =  new dhtmlXChart({
    	color:"#color#",
            ...
    })

Moreover color can be defined by a function that takes data object as an argument:

    var chart =  new dhtmlXChart({
    	color:function(obj){
    	    if (obj.sales > 5) return "#ff9900";
    	    else return "#66cc00";
    	},
            ...
    })