RangeFilterState Class
A state of the Range Filter dashboard item.
Declaration
export class RangeFilterState
Remarks
The code below shows how to specify a predefined period (6 months) to a Range Filter when you set a dashboard state:
public btnClick() {
var state: DashboardState = {
// ...
Items: {
"range": {
RangeFilterState: {
PeriodName: "6 Months"
}
}
}
}
this.dashboardControl.setDashboardState(state);
}
The code below shows how to apply a custom period (from January, 2017 to June, 2018) to a Range Filter when you set a dashboard state:
public btnClick() {
var state: DashboardState = {
// ...
Items: {
"range": {
RangeFilterState: {
Selection: {
Minimum: new Date(2017, 0, 1),
Maximum: new Date(2018, 5, 1)
}
}
}
}
}
this.dashboardControl.setDashboardState(state);
}
Use the DashboardControl.setDashboardState method to apply a dashboard state to the loaded dashboard.
Properties
PeriodName Property
Specifies the name of the available predefined periods.
Declaration
PeriodName?: string
Property Value
Type | Description |
---|---|
string | A string that specifies the name of the available predefined periods. |
Remarks
You can use the ViewerApiExtension.getAvailablePredefinedRanges method to get names of the predefined ranges available for the specified Range Filter / Date Filter.
Selection Property
Specifies the selected range in the Range Filter dashboard item.
Declaration
Selection?: RangeFilterSelection
Property Value
Type | Description |
---|---|
RangeFilterSelection | A RangeFilterSelection object that specifies the selected range in the Range Filter dashboard item. |