// Create a png file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("ExportChartToImage.png"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Create a new workbook Workbook workbook = new Workbook(); InputStream fileStream = getResourceStream("xlsx/Template_SalesTracker_report.xlsx"); // Open a xlsx file contains a chart workbook.open(fileStream); IWorksheet worksheet = workbook.getWorksheets().get(0); // Export the chart to image worksheet.getShapes().get("ProductIncomeChart").toImage(outputStream, ImageType.PNG); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }