Filter Series Data
- 2 minutes to read
This document describes how to filter chart data at the chart control level.
Note
If you use large data sources, we recommend that you filter and sort your data source at the data source level before it is visualized if users should not change filtering and sorting parameters.
After you bind your chart to a data source, and define the SeriesBase.ArgumentDataMember and SeriesBase.ValueDataMembers properties of a series, define the data column to be used as the filter criteria, the logical condition, and the value upon which this condition should be applied to the data field.
As an example, we’ll use the chart created in Lesson 3 - Bind Chart Series to Data, with the series view type set to the Bar. The initial, unfiltered chart is shown in the following image.
To limit the number of data points in the series, click the ellipsis button for the SeriesBase.FilterCriteria property.
- Use the plus button to add a new condition in the Filter UI Editor.
- Select CategoryID in the list of data fields.
- Set the criteria operator to Equals.
- Set the operand value to 4.
- Click Apply.
To apply the changes and quit the dialog, click Apply. The result is shown in the following image.
To learn how to apply a filter expression to chart data at runtime, refer to the following help topic: How to: Filter Data.
If you use the date-time scale type, you can exclude holidays and weekends from an axis scale. To learn more, refer to the following help topic: Workday and Holiday Exclusion.