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 to bind data table in the SfChart?

Platform: UWP |
Control: SfChart |
Published Date: January 27, 2016 |
Last Revised Date: June 27, 2019 |
.NET Framework: 4.5.1 |
Product Version:


The DataTable type can be bound to the ItemsSource property in ChartSeries.


The following code example illustrates how to bind the data tables in ChartSeries.


<Grid x:Name="grid">
            <chart:ColumnSeries ItemsSource="{Binding Data}" XBindingPath="ProductName" YBindingPath="UnitsInStock"></chart:ColumnSeries>


public class DataViewModel 
        DataSet dataset = new DataSet();
        public DataViewModel()
        public void AddData()
            //Sets Database connection.
            string connectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}", @"..\..\Model\DataBase_File.mdb");
            OleDbConnection Connection = new OleDbConnection(connectionString);
            OleDbCommand command = new OleDbCommand("Select Top 10 * from [Products]", Connection);
            OleDbDataAdapter DataAdapter = new OleDbDataAdapter(command);
            DataAdapter.Fill(dataset, "Product");
            //Sets the DataTable to Data property.
            this.Data = dataset.Tables["Product"];
        public DataTable _data;
        public DataTable Data
                return _data;
                _data = value;


Chart rendered by getting data from DataTable in WPF

Figure 1: ColumnSeries renders based on data table fields.

2X faster development

The ultimate UWP 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