Dundas Chart for ASP.NET
Filter(DateRangeType,String,Series,Series) Method
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl 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.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 &lt;= 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

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

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.