// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addShape(AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.getFill().presetGradient(GradientStyle.Vertical, 3, PresetGradientType.Silver); shape.getFill().setRotateWithObject(false); // Save to an excel file workbook.save("ConfigShapeWithGradientFill.xlsx");