Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Reporting
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Collapse]Creating Charts
     [Expand]2D Chart Types
     [Expand]3D Chart Types
     [Expand]Providing Data
     [Collapse]Data Representation
       Filtering Data
       Sorting Data
       Calculating Summaries
       Using The Top-N Feature
       Data Aggregation
       Workday and Holiday Exclusion
       Empty Points Representation
     [Expand]Appearance Customization
     [Expand]Miscellaneous
    [Expand]Chart Elements
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Filtering Data

This document describes how to filter a chart's data at the level of the chart control (as opposed to the filtering at the data source's level).

You can apply a filtering criterion to a chart's underlying data, so that only the data satisfying this criterion will be shown in the chart. For this, the SeriesBase.DataFilters property is provided, which allows you to perform complex data filtering, based on as many criteria as required.

Note

Note that when dealing with large data sources, filtering their data at the chart control level may not be as efficient as filtering at the data source level. So, if you need to sort data from a large data source, it's recommended to do this using SQL, at the level of your data source. To learn more on this, refer to MSDN.

After you bing your chart to a data source, and define the SeriesBase.ArgumentDataMember and SeriesBase.ValueDataMembers properties of a series, you can define a data column to be used as a filtering criteria, a logical condition, and a value upon which this condition should be applied to that data field.

For example, we'll use the chart created in the 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.

Now, let's only show data for 4 points.

To limit the number of data points in the series, click the ellipsis button for the SeriesBase.DataFilters property.

In the invoked Data Filter Collection Editor, click Add, and for the created filtering criterion, set its DataFilter.ColumnName to CategoryID and DataFilter.Value to 4. And leave the DataFilter.Condition property set to its default value (Equal).

To apply the changes and quit the dialog, click Close. The result is shown in the following image.

To learn how a filtering expression can be applied to a chart's data at runtime, refer to How to: Filter Data.

With the date-time scale type, it's possible to exclude holidays and weekends from an axis scale. To learn more on this, refer to Data Aggregation.

Expanded See Also

Is this topic helpful?​​​​​​​