Dundas Chart for Windows Forms
Filter(DateRangeType,String,Series,Series) Method
See Also  Example Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > DataManipulator Class > Filter Method : Filter(DateRangeType,String,Series,Series) Method


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.
inputSeries
Series object that is filtered
Input series.
outputSeries
Series object that stores the filtered data. If it does not exist an exception will be thrown.
Output series.

Enterprise Edition Only Feature. Filters a 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.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub Filter( _
   ByVal dateRange As DateRangeType, _
   ByVal rangeElements As String, _
   ByVal inputSeries As Series, _
   ByVal outputSeries As Series _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim dateRange As DateRangeType
Dim rangeElements As String
Dim inputSeries As Series
Dim outputSeries As Series
 
instance.Filter(dateRange, rangeElements, inputSeries, outputSeries)
C#  
public void Filter( 
   DateRangeType dateRange,
   string rangeElements,
   Series inputSeries,
   Series outputSeries
)

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.
inputSeries
Series object that is filtered
Input series.
outputSeries
Series object that stores the filtered data. If it does not exist an exception will be thrown.
Output series.

Example

The following sample adds multiple data points that have unique date/time X-values and randomly set Y-values. Then the series (named "Series1") is filtered so that all Saturdays and Sundays are displayed as empty points. The modified data is stored in Series2.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
...

Dim currentDate As DateTime
Dim randomValues As New Random()
Dim i As Int32

' Display filtered points as empty points instead of removing them from the source data series
Chart1.DataManipulator.FilterSetEmptyPoints = True

' Initialize variables
currentDate = DateTime.Now.Date

' add randomly-sized data points to Series1
For i = 0 To 20
    Chart1.Series("Series1").Points.AddXY(currentDate.AddDays(i), randomValues.Next(0, 100))
Next

' Filter out Saturdays and Sundays
Chart1.DataManipulator.Filter (DateRangeType.DayOfWeek, "0,6", Chart1.Series("Series1"),Chart1.Series("Series2"))

Remarks

This method filters 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).

If the specified output series has not been created and added to the SeriesCollection when this function call is made an exception will be thrown.

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.

Requirements

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

See Also

© 2009 All Rights Reserved.