Performs custom filtering on a series' data points. The Series object that is filtered is used to store the modified data.
Filters data points using IDataPointFilter interface.
Visual Basic (Declaration) | |
---|---|
Public Overloads Sub Filter( _ ByVal filterInterface As IDataPointFilter, _ ByVal inputSeries As Series _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public void Filter( IDataPointFilter filterInterface, Series inputSeries ) |
Parameters
- filterInterface
- An object that implements the IDataPointFilter interface.
Filtering interface. - inputSeries
- Series object that is filtered. It is also used to store the modified data.
Input series.
Visual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WebControl<CRLF>...<CRLF><CRLF>' Implement the IDataPointFilter interface for our web form<CRLF>Public Class WebForm1<CRLF> Inherits System.Web.UI.Page<CRLF> Implements IDataPointFilter<CRLF> ...<CRLF> <CRLF> ' Declare function that contains the custom filtering logic (used by the Filter function)<CRLF> Public Function FilterDataPoint(ByVal point As DataPoint, ByVal series As Series, ByVal pointIndex As Integer) As Boolean _<CRLF> Implements IDataPointFilter.FilterDataPoint<CRLF> <CRLF> ' If Y2 (second Y value) is greater than 100 filter out this data point, otherwise keep it<CRLF> If point.YValues(1) > 100 Then<CRLF> FilterDataPoint = True<CRLF> Else<CRLF> FilterDataPoint = False<CRLF> End If<CRLF> <CRLF> End Function<CRLF> ...<CRLF> <CRLF> ' Perform filtering before data is displayed by chart<CRLF> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<CRLF> <CRLF> Chart1.DataManipulator.Filter(Me, Chart1.Series("Series1"))<CRLF> <CRLF> End Sub<CRLF> ... |
C# | Copy Code |
---|---|
using Dundas.Charting.WebControl;<CRLF> ...<CRLF> <CRLF>public partial class _Default : System.Web.UI.Page, IDataPointFilter<CRLF>{<CRLF><CRLF> protected void Page_Load(object sender, System.EventArgs e)<CRLF> {<CRLF> Chart1.DataManipulator.Filter(this, Chart1.Series["Series1"]);<CRLF> }<CRLF> <CRLF> // Declare function that contains the custom filtering logic (used by the Filter function)<CRLF> public bool FilterDataPoint(DataPoint point, Series series, int pointIndex)<CRLF> {<CRLF> bool tempFilterDataPoint = false;<CRLF><CRLF> // If Y2 (second Y value) is greater than 100 filter out this data point, otherwise keep it<CRLF> if (point.YValues[1] > 100)<CRLF> {<CRLF> tempFilterDataPoint = true;<CRLF> }<CRLF> else<CRLF> {<CRLF> tempFilterDataPoint = false;<CRLF> }<CRLF><CRLF> return tempFilterDataPoint;<CRLF> }<CRLF><CRLF>} |
To utilize this method use a new or existing class (e.g. the WebForm class) that implements the IDataPointFilter interface and then override the FilterDataPoint method to provide custom filtering logic.
Note that filtering can be based on any attribute(s) of the data points (e.g. their first, second and third Y-values, etc.).
Filters are always applied to an entire series.
To filter data and preserve the original series use another definition of this function that uses an output series parameter.
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).
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