top of page

Widget Refresh Button

Updated: Nov 27, 2024

In Sisense, widgets will be refreshed when

- we reload the dashboard

- change any filters

- click on refresh button which can be found in small popup when we click on i-button (in widget title bar).


Here is a script to add refresh button for a widget.


ree

Steps:

  1. Create Bar/Column/Line/Area/Pie chart

  2. Add below script to widget

  3. Save the script and refresh the widget




widget.on('processresult', function(se, ev){
	ev.result.chart.marginTop= 60   
});   

var normalState = {   
                     fill: '#ffffff',   
                     stroke: '#d5d7de',   
                     r: 3,   
                     style: {   
                              color: '#6D6D6D',   
						  	  fontFamily: 'Open Sans',  
                              borderWidth  : 0  
                            }   
                   },   
hoverState = {   
                    fill: '#f4f4f4',   
                    stroke: '#d5d7de',   
                    r: 3,   
                    style: {   
                              color: '#6D6D6D',   
  							  fontFamily: 'Open Sans',  
                              borderWidth  : 0   
                           }   
                  },    
pressedState = {   
                    fill: '#f4f4f4',   
                    stroke: '#d5d7de',   
					r: 3,   
					style: {   
						color: '#6D6D6D',   
						fontFamily: 'Open Sans',  
						borderWidth  : 0   
                               }   
                    },   
disabledState = {   
                        fill: '#ffffff',   
                        stroke: '#d5d7de',   
                        r: 3,   
                        style: {   
                                 color: '#6D6D6D',   
								 fontFamily: 'Open Sans',  
                                 borderWidth  : 0   
                               }   
                    },   
callback = function () {   
                           
                        }   
  
widget.on("domready", function(w){   
	chart = w.chart[0][Object.keys(w.chart[0])[0]].hc  
	  
	chart.renderer.button('↻', 10, 10,
			callback,   
			normalState,   
			hoverState,   
			pressedState,   
			disabledState)   
			.attr({   
			zIndex : 10,   
			height: 14,   
			width: 45,   
			'text-align': 'center'   
		})   
			.on('click', function() {	    
				widget.refresh();   
		})   
		.add();   
	  
	$('.widget-no-result-overlay').css('top', '80px') 
	
});   


Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

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
bottom of page