通过Node.js使用C++处理Shape或Chart的三维格式
Contents
[
Hide
]
可能的使用场景
Aspose.Cells for Node.js via C++提供Shape.getThreeDFormat() 属性和ThreeDFormat类,用于处理形状或图表的三维格式。 ThreeDFormat类包含多个属性,可根据应用需求设置以实现不同效果。
使用 Aspose.Cells 处理形状或图表的三维格式
以下示例代码加载源Excel文件,访问第一个工作表中的第一个形状,设置Shape.getThreeDFormat()属性的子属性,然后将工作簿保存为输出Excel文件。
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "sample.xlsx");
// Load excel file containing a shape
const wb = new AsposeCells.Workbook(filePath);
// Access first worksheet
const ws = wb.getWorksheets().get(0);
// Access first shape
const sh = ws.getShapes().get(0);
// Apply different three dimensional settings
const n3df = sh.getThreeDFormat();
n3df.setContourWidth(17);
n3df.setExtrusionHeight(32);
// Save the output excel file in xlsx format
wb.save(path.join(dataDir, "output_out.xlsx"));