DataFilter Class
In This Article
Defines filter conditions for a particular series.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.dll
NuGet Package: DevExpress.Charts
#Declaration
public class DataFilter :
ChartElement,
IDataFilter,
IObjectValueTypeProvider
#Related API Members
The following members return DataFilter objects:
#Remarks
A collection of DataFilter objects should be set to the SeriesBase.DataFilters
property. This property is now obsolete.
If you use the DataFilters property, replace it with the FilterString or FilterCriteria property.
// To convert the following data filter definitions, use the FilterCriteria property below...
chartControl1.Series[0].DataFilters.Add(new DataFilter("Company", "System.String", DataFilterCondition.Equal, "DevAV North"));
chartControl1.Series[0].DataFilters.Add(new DataFilter("SaleDate", "System.DateTime", DataFilterCondition.Equal, new DateTime(2018, 12, 31)));
chartControl1.Series[0].DataFiltersConjunctionMode = ConjunctionTypes.And;
chartControl1.Series[0].FilterCriteria = new BinaryOperator("Company", "DevAV North", BinaryOperatorType.Equal) &
new BinaryOperator("SaleDate", new DateTime(2018, 12, 31), BinaryOperatorType.Equal);
// or the FilterString property:
chartControl1.Series[0].FilterString = "Company='DevAV North' And SaleDate=#2018-12-31#";
If you specify the DataFilters property in design mode, it will be automatically converted to the SeriesBase.FilterString property when you upgrade your project to the latest version.
See the following help topic for more information: Filter Series Data.
#Inheritance
Object
ChartElement
DataFilter
See Also