当我使用epplus在Excel中创建图表时遇到同样的问题,我尝试获取类似的内容:
这是我的代码:
ExcelWorksheet hoja = package.Workbook.Worksheets.Add("Grafico");
ExcelLineChart pieChart = hoja.Drawings.AddChart("crtExtensionsSize", eChartType.LineMarkers) as ExcelLineChart;
pieChart.SetPosition(1, 0, 1, 0);
pieChart.SetSize(800, 600);
pieChart.Series.Add("'hoja2'!$B$2:$B$" + listClienteVentas.Count + 1, "'hoja2'!P2:Q"+ listClienteVentas.Count+1);
pieChart.Title.Text = "Comparativa ventas";
pieChart.DataLabel.ShowCategory = true;
pieChart.Legend.Remove();
package.Save();
我做错了什么?