// Create a new workbook Workbook workbook = new Workbook(); // Open an excel file InputStream fileStream = this.getResourceStream("xlsx/WebsiteFlowChart.xlsx"); workbook.open(fileStream); IWorksheet worksheet = workbook.getWorksheets().get(0); //Get "Idea" IShape idea = worksheet.getShapes().get("Idea"); idea.getFill().twoColorGradient(GradientStyle.FromCenter, 1); idea.getFill().getGradientStops().get(0).setPosition(0.33); idea.getFill().getGradientStops().get(0).getColor().setRGB(Color.FromArgb(0, 112, 192)); idea.getFill().getGradientStops().get(1).setPosition(1); idea.getFill().getGradientStops().get(1).getColor().setRGB(Color.GetWhite()); //Set gradient path type as "Path" idea.getFill().setGradientPathType(PathShapeType.Path); //Get "Functionality" IShape functionality = worksheet.getShapes().get("Functionality"); functionality.getFill().twoColorGradient(GradientStyle.FromCenter, 1); functionality.getFill().getGradientStops().get(0).setPosition(0.33); functionality.getFill().getGradientStops().get(0).getColor().setRGB(Color.FromArgb(0, 112, 192)); functionality.getFill().getGradientStops().get(1).setPosition(1); functionality.getFill().getGradientStops().get(1).getColor().setRGB(Color.GetWhite()); //Set gradient path type as "Path" functionality.getFill().setGradientPathType(PathShapeType.Path); // Save to an excel file workbook.save("ConfigGradientFillWithPathShape.xlsx");