We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I filter particular set of data points in the chart series?

Platform: WinForms |
Control: Chart |
Published Date: April 30, 2011 |
Last Revised Date: June 25, 2019


Data is filtered on a series-by-series basis, and when a series data points are filtered they can be either removed from the series Points collection or marked as empty.

We can filter a particular set of data points using the Grouping Engine and data changes are reflected in chart.

Using the group engine we can set the main data source for the whole engine. The TableDescriptor will pick up the ItemProperties from the SourceList and table will be intialized at run-time with records from the list. Using RecordFilterDescriptor class we can filter the chart point values by comparing it against a given constant value. The filtered points added with series.


// Generating Series

ChartSeries series =this.chartControl1 .Model.NewSeries ("Filter Series",ChartSeriesType.Column );



for(int i=0;i<10;i++)




list.Add(new Data(i, a[i]));



// Bind it to the model

Engine group=new Engine();

group.SetSourceList (list);

ExpressionFieldDescriptor exp = new ExpressionFieldDescriptor();

exp.Expression = "[Y] > "+this.textBox1.Text.ToString();

RecordFilterDescriptor rfd = new RecordFilterDescriptor(exp.Expression);

group.TableDescriptor.RecordFilters.Add (rfd);

System.Diagnostics.Trace.WriteLine("Filtered Record Count:" + group.Table.FilteredRecords.Count);

System.Diagnostics.Trace.WriteLine("Values greater than 30:");

// Filtering Data


int j = 0;

foreach(Record rec in group.Table.FilteredRecords)


string b=rec.GetData().ToString();





this.label2.Text = "Number of Filtered points: "+group.Table.FilteredRecords.Count.ToString();


' Generating Series

Dim series As ChartSeries =Me.chartControl1.Model.NewSeries ("Filter Series",ChartSeriesType.Column)



For i As Integer = 0 To 9



list.Add(New Data(i, a(i)))

Next i


' Bind it to the model

Dim group As Engine = New Engine()

group.SetSourceList (list)

Dim exp As ExpressionFieldDescriptor = New ExpressionFieldDescriptor()

exp.Expression = "[Y] > " & Me.textBox1.Text.ToString()

Dim rfd As RecordFilterDescriptor = New RecordFilterDescriptor(exp.Expression)

group.TableDescriptor.RecordFilters.Add (rfd)

System.Diagnostics.Trace.WriteLine("Filtered Record Count:" & group.Table.FilteredRecords.Count)

System.Diagnostics.Trace.WriteLine("Values greater than 30:")

' Filtering Data


Dim j As Integer = 0

For Each rec As Record In group.Table.FilteredRecords

Dim b As String=rec.GetData().ToString()



j += 1

Next rec

Me.label2.Text = "Number of Filtered points: " & group.Table.FilteredRecords.Count.ToString()

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile