Check documentation for the latest version of dhtmlxSuite gradient DHTMLX Docs

gradient

The color gradient.

Value type: "light" (default value), "3D", function

Gradient can be set by fixed value:

  • "3D"
var chart =  new dhtmlXChart({
    ...
    gradient:"3d",
    color: "#00FF22"
   ...
})
  • "Light"
var chart =  new dhtmlXChart({
    ...
    gradient:"light",
    color: "#00FF22"
   ...
})

or by function:

var chart =  new dhtmlXChart({
    ...
    gradient:function(gradient){
        gradient.addColorStop(0.0,"#FF0000");
        gradient.addColorStop(0.8,"#FFFF00");
        gradient.addColorStop(1.0,"#00FF22");
    },
 
    ...
})

or

chart.define("gradient",function(gradient){
    gradient.addColorStop(0.0,"#FF0000");
    gradient.addColorStop(0.8,"#FFFF00");
    gradient.addColorStop(1.0,"#00FF22");
});
Back to top