Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Providing Data
    [Expand]Providing Data
    [Collapse]Data Representation
      Filtering Data
      Sorting Data
      Calculating Summaries
      Using The Top-N Feature
      Work Time and Workday Configuration
      Empty Points Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Additional Resources
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[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 chart data at the chart control level (as opposed to the filtering at the data source level).

Note

When dealing with large data sources, filtering data at the chart control level may not be as efficient as filtering at the data source level. We recommend filtering and sorting your data source at the data level before it is visualized if End-Users should not change filtering and sorting parameters.

You can use the FilterControl or Filtering UI Context filter criteria builders to filter chart data or a chart's series data. Refer to the Criteria Language Syntax guide to learn more about filter criteria.

In this guide, the Filtering UI Context is used to demonstrate how to filter chart’s data.

The topic contains the following sections:

Expanded Design-Time Filtering UI Context Initialization

As an example, the form contains a Chart Control, Accordion Control and Filtering UI Context. To filter a template-generated series, click the DevExpress.Utils.Filtering.FilteringUIContext's smart tag and set its Client property to the Chart Control.

Important

An individual series' data source cannot be specified as the Context's Client at design time.

Then, you should initialize filters. Call the FilteringUIContext.RetrieveFilters() method in the Form.Load event handler.

Now, the Chart Control uses the Filtering UI to manage its series' SeriesBase.FilterCriteria.

The next step is filtering UI customization. Refer to the Filtering Attributes guide for more information.

Expanded Run-Time Filtering UI Context Initialization

The Filtering UI requires runtime initialization if it should filter an individual series. The following code demonstrates Chart filtering using a custom filter model. Note that in this case, you should use the FilteringUIContext.SetFilterCriteriaBinding method instead of the Client property to bind the Context to the SeriesBase.FilterCriteria property.

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T566197.

Expanded See Also

How would you rate this topic?​​​​​​​