Han*_*Han 7 c# excel-2007 epplus
我想在EPPlus中的一个图表上绘制2个不同类型的系列(即列和线)(COM帮助导出Excel文件).任何人都知道如何做到这一点.提前致谢.
最后,我找到了答案.链接参考:http://epplus.codeplex.com/wikipage? title = FAQ
如何在图表中添加具有不同图表类型的系列?
这是你怎么做的......
ExcelChart chart = worksheet.Drawings.AddChart("chtLine", eChartType.LineMarkers);
var serie1= chart.Series.Add(Worksheet.Cells["B1:B4"],Worksheet.Cells["A1:A4"]);
//Now for the second chart type we use the chart.PlotArea.ChartTypes collection...
var chartType2 = chart.PlotArea.ChartTypes.Add(eChartType.ColumnClustered);
var serie2 = chartType2.Series.Add(Worksheet.Cells["C1:C4"],Worksheet.Cells["A1:A4"]);
Run Code Online (Sandbox Code Playgroud)