top of page

For any support or more customized script, contact us -  binextlevel@gmail.com

Disable/Deselect One or More Items in Legend By Default

In Sisense, all legends are enabled by default. Below script can be used to disable one more items in legend when load/refresh the widget (disabling legend means, item will be in gray color and data of disabled item will not displayed in widget. User can enable it by click on it.)




Steps:


  1. Create a Bar/Column/Area/Pie/Line chart and enable Legend

  2. Add below script to widget

  3. Update the variable 'disableLegend' with list of items in legend need to be disabled

  4. Save the script and refresh widget


widget.on('processresult', function(se, ev){
	
	let disableLegend = ['Midwest', 'South']
	
	$.each(ev.result.series, function(index, value){
		
		if(disableLegend.includes(value.name))
			value.visible = false

	})
})

29 views0 comments

Recent Posts

See All
bottom of page