Working with the Reflection Effect of Shape or Chart with Node.js via C++

Possible Usage Scenarios

Aspose.Cells for Node.js via C++ provides the Shape.getReflection() property along with the ReflectionEffect class to work with the reflection effect of shape or chart. The ReflectionEffect class contains the following properties which can be set to achieve different results as per application requirements.

Working with the Reflection Effect of Shape or Chart

The following sample code loads the source excel file and accesses the first shape in the default worksheet. It sets different properties of the Shape.getReflection() class and then saves the workbook in the output excel file.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");

// Load your source excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "sample.xlsx"));

// Access first worksheet
const worksheet = workbook.getWorksheets().get(0);

// Access first shape
const shape = worksheet.getShapes().get(0);

// Set the reflection effect of the shape, set its Blur, Size, Transparency and Distance properties
const reflectionEffect = shape.getReflection();
reflectionEffect.setBlur(30);
reflectionEffect.setSize(90);
reflectionEffect.setTransparency(0);
reflectionEffect.setDistance(80);

// Save the workbook in xlsx format
workbook.save(path.join(dataDir, "output_out.xlsx"));