在devexpress图表控件中设置图表类型属性c#

时间:2016-07-31 14:38:41

标签: c# charts highcharts devexpress devexpress-windows-ui

我在程序的仪表板中创建了一个图表,如您所见:

enter image description here

我在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,但问题是我设置图表以显示此类型的演示文稿

enter image description here

但它不起作用

1 个答案:

答案 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" });