Prior asking this question, i read similar post such as:
- Create chart from DataGridView
- Get data from DataGridView to Chart
- Creating chart from datagridview C#
- making chart from datagridview
- C# Using data from DataGridView in a Chart
But i am still unable to show my datagridview data to a my chart. I am using xtragrid and Xtracharts controls to achieve my task and in my datagridview, i have some unbound columns.
here is the code i have tried to use
private void ChartData()
{
Series S = new Series();
LineSeriesView view = new LineSeriesView();
S.View = view;
ProdchartControl.DataSource = ProdgridControl.DataSource;
S.ArgumentDataMember = "Prod Date";
S.ValueDataMembersSerializable = "Orange prod";
ProdchartControl.SeriesDataMember = "ProdID";
ProdchartControl.Series.Add(S);
}
your assitance will be welcomed.
Thanks.
ChartControl provides built-in integration with the GridControl component (see Integration with a Data Grid, Vertical Grid, Tree List or List Box via ControlRowSource).
For an example with unbound fields, refer to the How to display data from an unbound column displayed in the grid control ticket.