首页 > 代码库 > 通过直接编码添加折线图到ChartControl

通过直接编码添加折线图到ChartControl

https://documentation.devexpress.com/#WindowsForms/CustomDocument2976

 

   ChartControl lineChart = new ChartControl();            Series series1 = new Series("Series 1", ViewType.Line);            series1.Points.Add(new SeriesPoint(1, 2));            series1.Points.Add(new SeriesPoint(2, 12));            series1.Points.Add(new SeriesPoint(3, 14));            series1.Points.Add(new SeriesPoint(4, 17));            lineChart.Series.Add(series1);            //series1.ArgumentScaleType = ScaleType.Numerical;            //((LineSeriesView)series1.View).LineMarkerOptions.Kind = MarkerKind.Triangle;            //((LineSeriesView)series1.View).LineStyle.DashStyle = DashStyle.Dash;            //((XYDiagram)lineChart.Diagram).EnableAxisXZooming = true;            //lineChart.Legend.Visibility = DefaultBoolean.;            //lineChart.Titles.Add(new ChartTitle());            //lineChart.Titles[0].Text = @"A Line Chart";            lineChart.Dock = DockStyle.Fill;            this.Controls.Add(lineChart);

 

通过直接编码添加折线图到ChartControl