Define Widget Navigator Scroll Position
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;
});
Updated 03-02-2023
intapiuser
Admin
Joined December 15, 2022