通过直接编码添加折线图到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);

 

posted @ 2017-01-19 17:06  ChuckLu  阅读(489)  评论(0编辑  收藏  举报