Create excel graph with epplus

前端 未结 1 1638
执念已碎
执念已碎 2021-01-05 19:13

here is what I have. I have an excel sheet with two column. Column 1 had descriptions for legend, like Category1 Category 2 etc. Column 2 has numbers with total count like 6

1条回答
  •  日久生厌
    2021-01-05 19:34

    Nevermind, I fiddled around a little bit and found the answer

    Here is the working code

    ExcelChart chart = chartSheet.Drawings.AddChart("FindingsChart",
    OfficeOpenXml.Drawing.Chart.eChartType.ColumnClustered);
    chart.Title.Text = "Category Chart";
    chart.SetPosition(1, 0, 3, 0);
    chart.SetSize(800, 300);
    var ser1 = (ExcelChartSerie)(chart.Series.Add(workSheet.Cells["B4:B6"],
    workSheet.Cells["A4:A6"]));
    ser1.Header = "Category";
    

    0 讨论(0)
提交回复
热议问题