问题
I tried to bind chart to generatedSequence of type List<float>. How to update chart control after binding?
I tried this but with no luck:
chart1.DataSource = new BindingList<float>(chartSequence);
chart1.DataBind();
chart1.Update();
回答1:
Don't forget set DataSource property of Series in chart property.
Set XValueMember and YValueMembers from code:
chart1.Series.First().XValueMember = "X";
chart1.Series.First().YValueMembers = "Y";
Tutorial: Creating a Basic Chart
来源:https://stackoverflow.com/questions/14347454/how-to-bind-data-to-chart-in-winforms-and-refresh-chart