top of page

Gradient color in pie chart

Below script will add gradient color to pie chart.




Steps:

  1. Create pie chart

  2. 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.

  3. 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]
			]
		}
	})
})



133 views0 comments

Comentarios

Obtuvo 0 de 5 estrellas.
Aún no hay calificaciones

Agrega una calificación
BI Next Level white logo

BI Next Level is your trusted resource for BI customization, data solutions, and expert insights. Explore practical tips, scripts, and tutorials for tools like Sisense, Python, and SQL. Let’s transform your data into impactful insights together.

Quick Links
Connect with us
Copyright © 2024. All Rights Reserved. Designed, Developed & Maintained  by Intertoons
bottom of page