windowsforms-119224-controls-and-libraries-chart-control-provide-data-display-data-from-winforms-controls-in-chart.md
Tip
Use the DevExpress BI Dashboard to build cross-platform data visualization UIs with Charts, Grids, Maps, Pivot Grids, Range Selectors, and other visualization components. BI Dashboard ships as part of the DevExpress Universal Subscription.
Get Started with the DevExpress Dashboard
The ChartControl can display data from the following controls:
Select the Chart Control.
Open the Smart Tag menu and click Data Source Wizard :
In the Wizard, select the Data Control Rows technology and the source control. Click Next :
Select the type of rows to visualize (for example, a GridView):
Map the following chart members to data fields:
Click Finish and run the project. The following screenshot shows the ChartControl that visualizes grid data:
Note
The Data Source Wizard automatically adds a ControlRowSource component and binds it to the ChartControl.DataSource property. The ControlRowSource component is not available in the Toolbox.
ControlRowSource object to the ChartControl.DataSource property.SeriesDataMember, ArgumentDataMember, and ValueDataMembers properties to data fields.// Bind the chart to visible rows in the grid.
chartControl.DataSource = new DevExpress.Data.Controls.ControlRowSource() {
Control = mainView,
ControlRows = DevExpress.Data.Controls.ControlRows.Visible
};
// Group series by 'State'.
chartControl.SeriesDataMember = "State";
// Set argument and value bindings.
chartControl.SeriesTemplate.ArgumentDataMember = "Category";
chartControl.SeriesTemplate.ValueDataMembers.AddRange("Revenue");
' Bind the chart to visible rows in the grid.
chartControl.DataSource = New DevExpress.Data.Controls.ControlRowSource() With {
.Control = mainView,
.ControlRows = DevExpress.Data.Controls.ControlRows.Visible
}
' Group series by 'State'.
chartControl.SeriesDataMember = "State"
' Set argument and value bindings.
chartControl.SeriesTemplate.ArgumentDataMember = "Category"
chartControl.SeriesTemplate.ValueDataMembers.AddRange(New String() {"Revenue"})