top of page

Widget Refresh Button

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.


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') 
	
});   


151 views0 comments

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page