Below script will add gradient color to pie chart.
Steps:
Create pie chart
Add below widget script and update the variable 'color1' with any color you need to add as gradient. Primary color is the color you selected in Sisense panel.
Save the script and refresh widget
widget.on('processresult', function(se,ev){
var color1 = 'rgba(230, 230, 230, 0.4)'
$.each(ev.result.series[0].data, function(index, value){
value.color = {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, value.color],
[1, color1]
]
}
})
})
Comments