RangeFilterDashboardItem Class
A Range Filter dashboard item that allows end-users to apply filtering to other dashboard items.
Namespace: DevExpress.DashboardCommon
Assembly: DevExpress.Dashboard.v19.2.Core.dll
Declaration
public class RangeFilterDashboardItem :
SeriesDashboardItem,
IArgumentsDashboardItem,
IDateTimePeriodContext,
ISupportDateTimePeriods
Remarks
The Range Filter allows end-users to apply filtering to other dashboard items. It displays a chart with selection thumbs above that allow you to filter out values displayed along the argument axis.
You can use the Date Filter dashboard item as the Range Filter’s compact counterpart.
The following documentation is available.
Note
The Range Filter dashboard item cannot be bound to the OLAP data source.
Example
Note
The complete sample project How to Bind the Range Filter Dashboard Item to Data at Runtime is available in the DevExpress Examples repository.
using DevExpress.DashboardCommon;
using System;
// ...
private RangeFilterDashboardItem CreateRangeFilter(IDashboardDataSource dataSource)
{
// Create a Range Filter dashboard item and specify its data source.
RangeFilterDashboardItem rangeFilter = new RangeFilterDashboardItem();
rangeFilter.DataSource = dataSource;
// Create a new series of the Area type and add this series to the Series collection to
// display it within the Range Filter.
SimpleSeries salesAmountSeries = new SimpleSeries(SimpleSeriesType.Area);
rangeFilter.Series.Add(salesAmountSeries);
// Specify a measure to provide data used to calculate the Y-coordinate of the data points.
salesAmountSeries.Value = new Measure("Extended Price");
// Specify a dimension to provide Range Filter argument values.
rangeFilter.Argument = new Dimension("OrderDate");
// Specify a group interval for argument values.
rangeFilter.Argument.DateTimeGroupInterval = DateTimeGroupInterval.MonthYear;
// Restrict the displayed data.
rangeFilter.FilterString = "[OrderDate] > #2018-01-01#";
// Add predefined ranges to the context menu.
// You can show the item caption and use the Select Date Time Periods drop-down button to apply predefined ranges.
rangeFilter.DateTimePeriods.AddRange(
DateTimePeriod.CreateLastYear(),
DateTimePeriod.CreateNextMonths("Next 3 Months", 3),
new DateTimePeriod
{ Name = "Year To Date",
Start = new FlowDateTimePeriodLimit(DateTimeInterval.Year, 0),
End = new FlowDateTimePeriodLimit(DateTimeInterval.Day, 1)
},
new DateTimePeriod
{ Name = "Jul-18-2018 - Jan-18-2019",
Start = new FixedDateTimePeriodLimit(new DateTime(2018, 7, 18)),
End = new FixedDateTimePeriodLimit(new DateTime(2019, 1, 18)) }
);
// Specify the period selected when the control is initialized.
rangeFilter.DefaultDateTimePeriodName = "Year To Date";
// The caption is initially hidden. Uncomment the line to show the caption.
//rangeFilter.ShowCaption = true;
return rangeFilter;
}
Inheritance
Object
DashboardItem
DataDashboardItem
SeriesDashboardItem
RangeFilterDashboardItem
See Also