Working with the Shadow Effect of Shape or Chart

Possible Usage Scenarios

Aspose.Cells provides the Shape.ShadowEffect property to work with the shadow effect of shape or chart. It contains the following sub-properties which you can set to achieve different results as per your requirements.

The following screenshot shows the Microsoft Excel interface to set the Shadow Effect of Shape.

todo:image_alt_text

Working with the Shadow Effect of Shape or Chart

The following sample code loads the source excel file and accesses the first shape in the first worksheet and sets the sub-properties of Shape.ShadowEffect property and then saves the workbook in the output excel file.

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// The path to the documents directory.
String dataDir = Utils.getSharedDataDir(WorkingWithShadowEffect.class) + "articles/";
// Loads the workbook which contains hidden external links
Workbook wb = new Workbook(dataDir + "WorkingWithShadowEffect_in.xlsx");
// Access first worksheet
Worksheet ws = wb.getWorksheets().get(0);
// Access first shape
Shape sh = ws.getShapes().get(0);
// Set the shadow effect of the shape
// Set its Angle, Blur, Distance and Transparency properties
ShadowEffect se = sh.getShadowEffect();
se.setAngle(150);
se.setBlur(4);
se.setDistance(45);
se.setTransparency(0.3);
// Save the workbook in xlsx format
wb.save(dataDir + "WorkingWithShadowEffect_out.xlsx");