cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
In some cases, it may be desirable to define the default location of a widget's navigation scroll bar. Users will still have the ability to expand and move the navigation scroller, but anytime the dashboard is reloaded, the scroller will default to the pre-defined position. 
The following widget script will default the navigation scroller to the maximum position. 
Configure the script via the displayBars variable. This is the number of bars that will be displayed. 
//======================= Configuration =======================
//Number of bars you would like to display, starting from the last bar
var displayBars = 10;
//================================================================

widget.on('processresult',function(widget,args){

     //define the maximum bar count to be the series length, minus 1 because the below is zero indexed. 
     var maxBarCount = (args.result.series[0].data.length - 1);

     args.widget.options.previousScrollerLocation.min = maxBarCount - displayBars + 1;
     args.widget.options.previousScrollerLocation.max = maxBarCount;
});
NAVIGATOR TO MINIMUM POSITION
The following widget script will default the navigation scroller to the maximum position. 
Configure the script via the displayBars variable. This is the number of bars that will be displayed. 
//======================= Configuration =======================
//Number of bars you would like to display, starting from the last bar
var displayBars = 10;
//================================================================

widget.on('processresult',function(widget,args){

     args.widget.options.previousScrollerLocation.min = 0;
     args.widget.options.previousScrollerLocation.max = displayBars - 1;
});
Version history
Last update:
‎03-02-2023 09:20 AM
Updated by:
Contributors
Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

Sisense Privacy Policy