// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getActiveSheet(); Object[][] data = new Object[][] { { null , "2017", "2018", "2019", "2020", "2021", "2022", "2023" }, { "Mobile Phones",0.9,0.13,0.15,0.18,0.17,0.18,0.04 }, { "Tablets", 0.05, 0.08, 0.12, 0.13, 0.15, 0.17, 0.54 }, { "Household items",0.43,0.35,0.23,0.13,0.13,0.15,0.16 }, { "Vehicles",0.51,0.55,0.45,0.55,0.08,0.45,0.46 }, { "Groceries",0.51,0.55,0.25,0.77,0.05,0.45,0.56 }, { "Personal care",0.35,0.2,1,0.23,0.33,0.5,1 }, }; worksheet.getRange("A1:H7").setValue(data); // set style worksheet.getRange("A1:H7").getStyle().setHorizontalAlignment(HorizontalAlignment.Center); worksheet.getRange("A1:A7").setColumnWidth(18); // create chart IShape shape = worksheet.getShapes().addChart(ChartType.Line, 10, 150, 400, 200); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:H7"), RowCol.Columns, true, true); shape.getChart().getChartTitle().setText("Product Sales"); // set line curve smoothing setting for (ISeries item : shape.getChart().getSeriesCollection()) { item.setSmooth(true); } // Save to a pdf file workbook.save("SmoothLineChartPdf.pdf");