Forum Discussion

Rkile's avatar
Rkile
Cloud Apps
10-13-2022
Solved

Window Autosizing

Hello,

I am curious if there is functionality for Sisense to auto-fit PivotTables/Tables with Aggregation dependent on the user's window size.  If dashboards are built out on larger screens, how can we scale those table widgets to appear similar on a smaller window without the user needing to scroll to see all columns?

 

Thanks

  • Hello Rkile ,

    In Table With Aggregation, there is an option to set automatic width

    But I think this option is not available in Pivot.

    Try below widget script in Pivot2 to make column with automatic fit.

    
    //Percentage of each column. Sum should be equal to 1
    var columnWidth = {
    	0: 0.3,
    	1: 0.3,
    	2: 0.4
    }
    
    widget.on('processresult', function(widget, args) {
    	widgetWidth = element.closest('pivot2').width() - 25
    		args.result.metadata.forEach(function(e, index) {
    
    				if (typeof(columnWidth[index]) !== "undefined") {
    					if (!('format' in e)) {
    						e['format'] = {
    							'width': columnWidth[index] * widgetWidth
    						};
    					} else {
    						e['format']['width'] = columnWidth[index] * widgetWidth;
    					}
    				}
    		})
    })
    

    Always here to help,
    Harry from QBeeQ
    [email protected]
    www.qbeeq.pl

     

1 Reply

Replies have been turned off for this discussion
  • Harry's avatar
    Harry
    Cloud Apps

    Hello Rkile ,

    In Table With Aggregation, there is an option to set automatic width

    But I think this option is not available in Pivot.

    Try below widget script in Pivot2 to make column with automatic fit.

    
    //Percentage of each column. Sum should be equal to 1
    var columnWidth = {
    	0: 0.3,
    	1: 0.3,
    	2: 0.4
    }
    
    widget.on('processresult', function(widget, args) {
    	widgetWidth = element.closest('pivot2').width() - 25
    		args.result.metadata.forEach(function(e, index) {
    
    				if (typeof(columnWidth[index]) !== "undefined") {
    					if (!('format' in e)) {
    						e['format'] = {
    							'width': columnWidth[index] * widgetWidth
    						};
    					} else {
    						e['format']['width'] = columnWidth[index] * widgetWidth;
    					}
    				}
    		})
    })
    

    Always here to help,
    Harry from QBeeQ
    [email protected]
    www.qbeeq.pl