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


pointCount
The number of data points that the filtering operation will not remove (or mark as empty).
Number of top/bottom points to return.
inputSeries
Series object that is filtered.
Input series.
outputSeries
Series object that stores the remaining data points. If it does not exist an exception will be thrown.
Output series.
usingValue
The data point value that is examined (e.g. "X", "Y", "Y2", etc.).
Defines which value of the point use in comparison (X, Y, Y2, ...).

Enterprise Edition Only Feature. Filters all data points in a series except for a specified number of points with the largest values.


Keeps only N top/bottom points of the series.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub FilterTopN( _
   ByVal pointCount As Integer, _
   ByVal inputSeries As Series, _
   ByVal outputSeries As Series, _
   ByVal usingValue As String _
) 
Visual Basic (Usage) Copy Code
Dim instance As DataManipulator
Dim pointCount As Integer
Dim inputSeries As Series
Dim outputSeries As Series
Dim usingValue As String
 
instance.FilterTopN(pointCount, inputSeries, outputSeries, usingValue)
C#  
public void FilterTopN( 
   int pointCount,
   Series inputSeries,
   Series outputSeries,
   string usingValue
)

Parameters

pointCount
The number of data points that the filtering operation will not remove (or mark as empty).
Number of top/bottom points to return.
inputSeries
Series object that is filtered.
Input series.
outputSeries
Series object that stores the remaining data points. If it does not exist an exception will be thrown.
Output series.
usingValue
The data point value that is examined (e.g. "X", "Y", "Y2", etc.).
Defines which value of the point use in comparison (X, Y, Y2, ...).

Example

The following sample code filters Series1, and only 10 data points that have the largest second Y-values are stored in Series2, which is the only displayed series. We will assume we are dealing with a bubble chart, that uses Y2 for its bubble sizes.
Visual Basic Copy Code
Imports Dundas.Charting.WinControl
....

    ' Filter out all points except the 10 data points with the largest Y2 values
    Chart1.DataManipulator.FilterTopN (10, Chart1.Series("Series1"), Chart1.Series("Series2"), "Y2")

    ' Do not display Series1
    Chart1.Series("Series1").ChartArea = ""

...
C# Copy Code
using Dundas.Charting.WinControl
....

   
// Filter out all points except the 10 data points with the largest Y2 values
   
Chart1.DataManipulator.FilterTopN (10, Chart1.Series["Series1"], Chart1.Series["Series2"], "Y2");
   
   
// Do not display Series1
   
Chart1.Series("Series1").ChartArea = "";
   
...

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.