在 devexpress 图表控件 c# 中设置图表类型 属性
set chart type property in devexpress chart control c#
如您所见,我在程序的仪表板中创建了一个图表:
我在 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" });
计数为数字,但问题是我将图表设置为显示此类演示文稿
但是没用
最终代码
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" });
如您所见,我在程序的仪表板中创建了一个图表:
我在 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" });
计数为数字,但问题是我将图表设置为显示此类演示文稿
但是没用
最终代码
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" });