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.
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 |
---|---|
|
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.
Visual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WebControl<CRLF> ...<CRLF><CRLF>Dim currentDate As DateTime<CRLF>Dim randomValues As New Random()<CRLF>Dim i As Int32<CRLF><CRLF>' Display filtered points as empty points instead of removing them from the source data series<CRLF>Chart1.DataManipulator.FilterSetEmptyPoints = True<CRLF><CRLF>' Initialize variables<CRLF>currentDate = DateTime.Now.Date<CRLF><CRLF>' add randomly-sized data points to Series1<CRLF>For i = 0 To 20<CRLF> Chart1.Series("Series1").Points.AddXY(currentDate.AddDays(i), randomValues.Next(0, 100))<CRLF>Next<CRLF><CRLF>' Filter out Saturdays and Sundays<CRLF>Chart1.DataManipulator.Filter(DateRangeType.DayOfWeek, "0 |
C# | Copy Code |
---|---|
using Dundas.Charting.WebControl;<CRLF> ...<CRLF><CRLF>System.DateTime currentDate = DateTime.MinValue;<CRLF>Random randomValues = new Random();<CRLF>Int32 i = 0;<CRLF><CRLF>// Display filtered points as empty points instead of removing them from the source data series<CRLF>Chart1.DataManipulator.FilterSetEmptyPoints = true;<CRLF><CRLF>// Initialize variables<CRLF>currentDate = DateTime.Now.Date;<CRLF><CRLF>// add randomly-sized data points to Series1<CRLF>for (i = 0; i <= 20; i++)<CRLF>{<CRLF> Chart1.Series["Series1"].Points.AddXY(currentDate.AddDays(i), randomValues.Next(0, 100));<CRLF>}<CRLF><CRLF>// Filter out Saturdays and Sundays<CRLF>Chart1.DataManipulator.Filter(DateRangeType.DayOfWeek, "0 |
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.
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