我在程序的仪表板中创建了一个图表,如您所见:
我在load_form
中使用此代码初始化数据 chartControlMIVBaseDateTime.DataSource = _materialIssueVoucherRepository.ViewImivBasedOnDates().ToList();
// Generate a data table and bind the chart to it.
// Specify data members to bind the chart's series template.
chartControlMIVBaseDateTime.SeriesDataMember = "Count";
chartControlMIVBaseDateTime.SeriesTemplate.ArgumentDataMember = "DateTime";
chartControlMIVBaseDateTime.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "Count" });
数字中的Count,但问题是我设置图表以显示此类型的演示文稿
但它不起作用
答案 0 :(得分:0)
最终代码
Series series = new Series("Series1", ViewType.Spline);
chartControlMIVBaseDateTime.Series.Add(series);
// Generate a data table and bind the series to it.
series.DataSource = _materialIssueVoucherRepository.ViewImivBasedOnDates().ToList();
// Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.DateTime;
series.ArgumentDataMember = "DateTime";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Count" });