EPPLUS图表错误

时间:2016-09-30 17:16:59

标签: c# excel excel-2010 epplus

当我使用epplus在Excel中创建图表时遇到同样的问题,我尝试获取类似的内容: enter image description here

和数据的来源: enter image description here

这是我的代码:

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();

但这是结果: enter image description here

这是数据的来源:enter image description here

我做错了什么?

0 个答案:

没有答案