Dundas Chart for SharePoint Send comments on this topic.
Filtering Data
See Also

Glossary Item Box

Overview

Data is filtered on a series-by-series basis, and when it is filtered, its data points are either removed from the series' Points collection (which is the default behavior), or marked as being empty. The points that get filtered depends on the filtering criteria specified. When you are working with your data, keep in mind that a filtering operation can modify the original series' data, and also that you can use an output series to store modified series data.

 

Note
When filtering multiple series, you must make certain that all of those series are aligned, otherwise an exception will be thrown.

 

For more information, see the topic on Aligning Series.

 

Note
The term "constant" is used in this article to refer to an integer value.

 

Filtering Data

Several properties and methods of the DataManipulator class are used for filtering, these include:

 

The Filter, and FilterTopN methods take these parameters:

If you specify a Series object as an output series, and that series has not been created and added to the SeriesCollection, then when the function call is made an exception will be thrown. However, if the series has not been created and added to the series collection, but it has been specified as a string expression, then it will automatically be created at run-time, and have default series properties (e.g. column chart type, etc.) assigned to it. In addition to this, the ChartArea property of this series will get set to "Default". If a chart area with the name "Default" already exists in the ChartAreasCollection, then it will be used to draw the chart. If there is no chart area name "Default", then the first ChartArea object in the collection will be used to display the series.

Filtering Using Date or Time Ranges

This criteria can be used when the X values of the data points are dates (set by a Series' XValueType property), and is accomplished using the Filter method. Series data is split into ranges where the defined elements of the range are filtered. To define a date range use two parameters:

Filtering All Points Except for the Largest or Smallest Points

Filters all points from a series except for a specified number of points with the largest or smallest point values. This filtering criteria is used with FilterTopN method, and the following parameters can be used to define the criteria:

Filtering by Comparing Point Values to a Constant

Filters data points by comparing one of their values with a constant, this is done using the Filter method. The following parameters are used:

Filtering With User-Defined Criteria

When the filtering criteria is complex and cannot be defined using the methods described above then a user-defined criteria can be specified using the IDataPointFilter interface. This interface exposes the FilterDataPoint method, which determines the data points to be removed. The following are the parameters of the FilterDataPoint method and its return value:

Filtering Multiple Series

The filtering methods of the DataManipulator class allow you to simultaneously filteri multiple aligned series by specifying a comma-separated list of series names. All points in each series will be filtered using the values from the first series. In other words, data points with the same indexes will be removed from all series depending on whether or not a point in the first series is filtered.

 

Some Points to Note

See Also