不知道你是不是想要的是类似于下面这个图表的样子:
,如果是这样的图表的话,可以参考用控件Spire.XLS来生成的图表,上面的图表效果是用下面的代码做出来的,你参考参考:
Workbook workbook = new Workbook();
workbook.LoadFromFile("test.xlsx");
Worksheet sheet = workbook.Worksheets[0];
Chart chart = sheet.Charts.Add();
chart.SeriesDataFromRange = false;
chart.LeftColumn = 6;
chart.TopRow = 1;
chart.RightColumn = 12;
chart.BottomRow = 13;
var cs1 = (ChartSerie)chart.Series.Add();
cs1.Name = sheet.Range["B1"].Value;
cs1.CategoryLabels = sheet.Range["A2:A5"];
cs1.Values = sheet.Range["B2:B5"];
cs1.SerieType = ExcelChartType.LineMarkers;
var cs2 = (ChartSerie)chart.Series.Add();
cs2.Name = sheet.Range["D1"].Value;
cs2.CategoryLabels = sheet.Range["A2:A5"];
cs2.Values = sheet.Range["D2:D5"];
cs2.SerieType = ExcelChartType.LineMarkers;
chart.SecondaryCategoryAxis.IsMaxCross = true;
cs2.UsePrimaryAxis = false;
chart.ChartTitle = "Report";
workbook.SaveToFile("result.xlsx");
System.Diagnostics.Process.Start("result.xlsx");
应该是两个Series吧