// Create a png file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("ConvertChartToImage.png"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape chart = worksheet.getShapes().addChart(ChartType.Area, 20, 20, 360, 230); worksheet.getRange("A20:C32") .setValue(new Object[][] { { null, "Blue Series", "Orange Series" }, { "Jan", 0, 59.1883603948205 }, { "Feb", 44.6420211591501, 52.2280901938606 }, { "Mar", 45.2174930051225, 49.8093056416248 }, { "Apr", 62, 37.3065749226828 }, { "May", 53, 34.4312192530766 }, { "Jun", 31.8933622049831, 69.7834561753736 }, { "Jul", 41.7930895085093, 63.9418103906982 }, { "Aug", 73, 57.4049534494926 }, { "Sep", 49.8773891668518, 33 }, { "Oct", 50, 74 }, { "Nov", 54.7658428630216, 22.9587876597096 }, { "Dec", 32, 54 } }); chart.getChart().getSeriesCollection().add(worksheet.getRange("A20:C32"), RowCol.Columns); chart.getChart().getChartTitle().setText("Area Chart"); // Save the chart as image to a stream. chart.toImage(outputStream, ImageType.PNG); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }