How to bind a data source to a WinForms Chart using the chart wizard?
This article explains how to bind a data source to Syncfusion WinForms ChartControl using the Chart Wizard in a .NET Framework Windows Forms application. The Chart Wizard allows you to configure and customize charts easily during design time.
Follow the steps below to bind a data source to the chart using the Chart Wizard at design time.
Step 1: Add ChartControl to the Form
- Open your WinForms project in Visual Studio.
- From the Toolbox → Syncfusion Windows Forms, drag and drop ChartControl onto the form.
- Select the chart → click the Smart Tag (►) → choose Chart Wizard.
Step 2: Add a BindingSource
- From the Toolbox → drag BindingSource onto the Form.
- Leave it as bindingSource1.
This BindingSource will be used as the chart’s DataSource inside the Wizard.
Step 3: Create a DataSet for Design‑Time Schema
To allow the Chart Wizard to display X Value and Y Value fields, a DataSet must be created with the required column schema.
- Go to: Project → Add New Item → DataSet
- Name it: DataSet1.xsd
- Open DataSet1.xsd in Designer.
- Right click → Add → DataTable
- Right click DataTable → Click Add → Select Column (example) by:
- Month (string)
- Sales (int)
This DataSet is only used at design‑time so the Chart Wizard can detect your field names.
Step 4: Bind DataSet to BindingSource
- Now, right click bindingSource1 and click Properties
- In the Properties Window:
- DataSource → Form1 List Instances → dataSet1
- DataMember → DataTable1
Now the BindingSource exposes the schema (Month, Sales), which the Chart Wizard can use.
Step 5: Open the Chart Wizard and Select the Data Source
- Select chartControl1
- Open Chart Wizard
- Go to Series tab and click Data Source tab
- In Data Source dropdown → choose bindingSource1
The DataGrid inside the Wizard will now show the columns as Month | Sales.
Step 6: Map X and Y Value Members
- In the Wizard → go to Series → Series Data tab.
- Select the series (Example: default0).
- Set:
- X Value → Month
- Y Value → Sales
- Select the required Chart Type (Line, Column, etc.)
Step 7: Add data points
- In the Wizard → switch to the Add points to series tab under Series.
- Choose the series (ex: Default0) from the Add Points dropdown.
- Click Edit points…
This opens the ChartPoint Collection Editor.
In the ChartPoint Collection Editor:
Click Add to insert a new data point.
Select the newly added point from the Members list.
Enter the values:
- X → type the X value
- YValues → set the required Y value
- Click OK to close the editor after adding all points.
- Back in the Wizard, click Apply.
- Finally click Finish to complete the configuration.
By completing the above steps, the chart will now be populated with the configured series and display the mapped fields at both design time and run time , as shown in the following image.
Output at design time
Output at Run time
For more details refer to the WinForms Chart documentation page.
Conclusion
I hope you enjoyed learning about how to bind a data source to a WinForms Chart using the Chart Wizard.
You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!