Skip to main content
A newer version of this page is available. .

How to: Filter Data

This example demonstrates how to filter series data.

In this example, the project created in the Lesson 3 topic will be extended.

To filter series data, add several DataFilter objects to the Series.DataFilters collection. Then, specify their DataFilter.ColumnName, DataFilter.Condition and DataFilter.Value properties to apply a filter.

The filtered series data is represented in the following image. The chart displays the prices of cars whose price is less than $20000 and engine capacity is greater than 2.3 liters.

DataFiltering

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-filter-series-data-t339646.

<dxc:BarSideBySideSeries2D.DataFilters>
    <dxc:DataFilter x:Name="Filter1" ColumnName="Price" Condition="LessThan" Value="20000"/>
    <dxc:DataFilter x:Name="Filter2" ColumnName="Liter" Condition="GreaterThan" Value="2.3"/>
</dxc:BarSideBySideSeries2D.DataFilters>