ChartDataBindModel model = null;
model = new ChartDataBindModel(table);
model.XName = "Year";
// The columns that contain the Y values.
model.YNames = new string[] { "Population" };
series1.SeriesModel = model;
Screenshot :
We have binded the datatable “People ” containing the values in the dataViewGrid.I have attached the below screenshot which is rendered using the datatable
I have attached the sample for your reference
http://www.syncfusion.com/downloads/support/forum/120553/ze/WindowsForms1529471689
Please let us know if you have any concerns.
Regards,
Deepaa
Deepaa,
Thanks so much for your response! It's really helpful. I'm facing a problem when I call the chart with a button. Since the code you have says "chart.Series.Add(series1);", every time I click the button to update the chart it adds a series on top of the one I just added. It's essentially the same data being added multiple times. Is there an "update" function rather that "add"?
Kevin Shay
model1 = new ChartDataBindModel(table);
model1.XName = "Year";
model1.YNames = new string[] { "Population" };
this.chart.Series[0].SeriesModel = model1;
Screenshot:
Rendered empty chart in datagrid view
On button click, the below chart is displayed
I have attached the sample for your reference
http://www.syncfusion.com/downloads/support/forum/120553/ze/WindowsForm1893745317.
Please let us know if you have any concerns.
Regards,
Deepaa.
ChartDataBindModel model1 = null;
model1 = new ChartDataBindModel(this.dataGridView1.DataSource);
this.chart.Series[0].SeriesModel = model1;
ScreenShot:
Default gridview with datatable
On button Click
We have attached the sample for your reference
http://www.syncfusion.com/downloads/support/forum/120553/ze/dataGridView1670569689
Please let us know if you have any concerns.
Regards,
Deepaa.