Workbook workbook = new Workbook(FileFormatType.Xlsx);
Worksheet sheet = workbook.Worksheets[0];
Cells cells = workbook.Worksheets[0].Cells;
cells[“A1”].PutValue(“Region”);
cells[“A2”].PutValue(“France”);
cells[“A3”].PutValue(“Germany”);
cells[“A4”].PutValue(“England”);
cells[“A5”].PutValue(“Sweden”);
cells[“A6”].PutValue(“Italy”);
cells[“A7”].PutValue(“Spain”);
cells[“A8”].PutValue(“Portugal”);
cells[“B1”].PutValue(“Sale”);
cells[“B2”].PutValue(70000);
cells[“B3”].PutValue(55000);
cells[“B4”].PutValue(30000);
cells[“B5”].PutValue(40000);
cells[“B6”].PutValue(35000);
cells[“B7”].PutValue(32000);
cells[“B8”].PutValue(10000);
int chartIndex = sheet.Charts.Add(ChartType.Column, 11, 0, 34, 8);
Chart chart = sheet.Charts[chartIndex];
chart.NSeries.Add(“B2:B8”, true);
chart.NSeries.CategoryData = “A2:A8”;
chart.NSeries.IsColorVaried = true;
const string path = “D:\test.pdf”;
workbook.Save(path);