DevExpress SpreadsheetControl 代码创建Chart图表

            spreadsheetControl1.BeginUpdate();
            Worksheet worksheet = spreadsheetControl1.ActiveWorksheet;
            Chart chart = worksheet.Charts.Add(ChartType.Line);
            chart = spreadsheetControl1.SelectedShape as Chart;
            ChartData argumentChartData = new ChartData();
            argumentChartData.RangeValue = WorkSheets[0]["A3:A393"];
            ChartData valueChartData = new ChartData();
            valueChartData.RangeValue = WorkSheets[0]["H3:H393"];
            Series series = _currentChart.Series.Add("title", argumentChartData, valueChartData);
            series.Outline.Width = 2;

            series.AxisGroup = AxisGroup.Secondary;

            spreadsheetControl1.EndUpdate();
注意:此处加次要坐标轴,但图形类型中ChartType.Line开头的次要坐标轴为纵轴,scatter开头的为横轴


你可能感兴趣的:(DevExpress SpreadsheetControl 代码创建Chart图表)