This section offers practical step-by-step guide on how to connect MindFusion.Charting for WinForms to a data source in VisualStudio 2010.
1. Search for the BindingSource component under the Data group in the Toolbox. Drag it onto the form with the chart.
2. In the property grid for the BindingSource select the DataSource property and click on "Add project data source..." Follow the steps of the wizard to choose your data source.
3. In the database connection wizard, in the step where you create a DataSet choose the database tables and fields that you will provide data for the chart.
4. Go to the DataMember property of the BindingSource in the Property Grid and set it to the name of the table that holds the data for the chart. A TableAdapter is automatically generated.
5. In the property grid for the chart control find the DataSource property and set it to the DataSet that you have created in step 3.
6. Set the DataMember property to the name of the table in the DataSet that holds the data.
7. Set the chart properties to the names of the database fields that will provide data. The data bound properties in MindFusion.Charting for WinForms are those einding with "Field" or "Fields" - XDataFields, XLabelsFields, InnerLabelsFields etc. Plural means the property accepts more than one DB field. In such cases use comma to separate the fields.
8. Compile and run the chart. It should display the data retrieved by the database. Note that when data binding is used the control shows sample data for the purpose of design. The chart looks different in runtime when data is retrieved.
Samples that use data binding: Average Data Traffic sample and SQL data binding step in the demo.