Filters one or more series' data points, either removing or marking as empty the specified data points for the given date/time ranges.
Filters points using the elements indexes.
Visual Basic (Declaration) | |
---|---|
Public Overloads Sub Filter( _ ByVal dateRange As DateRangeType, _ ByVal rangeElements As String, _ ByVal inputSeriesNames As String, _ ByVal outputSeriesNames As String _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void Filter( DateRangeType dateRange, string rangeElements, string inputSeriesNames, string outputSeriesNames ) |
Parameters
- dateRange
- An DateRangeType enumeration value which is a date/time interval (e.g. days of the week, days of the month, etc.). Determines the ranges that will have the given elements filtered.
Element type. - rangeElements
- Determines the elements within the date/time range (specified by the dateRange parameter) that will be filtered. Can be a single value (e.g. "7"), comma-separated values (e.g. "5,6"), a range of values (e.g. 9-11), or any variation thereof (e.g. "5,6,9-11").
Comma separated element indexes. - inputSeriesNames
- The name(s) of the series that will be filtered. For multiple series use a comma-separated list of names, and make sure that the series are aligned. An asterisk (*) may be used to filter all series in the series collection (in which case the outputSeriesName parameter must be empty).
Comma separated input series names. - outputSeriesNames
- The name(s) of the series that store the filtered data. Make sure that the number of output series matches the number of input series, otherwise an exception will be thrown.
Comma separated output series names.
The following sample adds multiple data points that have unique date/time X-values and randomly set Y-values to two series named Series1 and Series2. Then the series are filtered so that all Saturdays and Sundays are removed, and the modified data is stored in two other series named Series3 and Series4.
We do not display the first two series.
Visual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WinControl |
This method filters one or more series' data points specified by the rangeElements parameter within date/time ranges that are determined by the dateRange parameter. For example, if dateRange is "dateRange.DaysOfWeek" and rangeElements is "0,6" then all data points for every Saturday and Sunday are filtered (remember that Sunday is considered day number zero in a week).
Filtering should only be applied to multiple series that are aligned, otherwise an exception will be thrown (for information concerning alignment of data see the Aligning Data topic). Note also that multiple series are filtered using the values from the FIRST specified series. If two series must be filtered independently call the Filter method twice using one series as a parameter.
If a specified output series has not been created and added to the SeriesCollection when this function call is made it will be created and added to the collection automatically, and have default Series properties (e.g. column chart type, etc.). In addition, the ChartArea property of the series is set to "Default", and if a chart area with the name "Default" exists in the ChartAreasCollection it will be used to draw the chart. If there is no chart area with this name the first ChartArea object in the collection will be used to display the series.
Filters are always applied to an entire series.
Filtered points can be either removed from a series (default) or displayed as empty points, depending on the FilterSetEmptyPoints value.
Points can also be marked as filtered if they DO NOT match filtering criteria (determined by the FilterMatchPoints value).
To filter data and only keep a specified number of highest or lowest values use the FilterTopN method instead.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family