渲染时间轴
Contents
[
Hide
]
可能的使用场景
Aspose.Cells for Node.js via C++支持无需使用Office 2013、Office 2016、Office 2019和Office 365即可渲染时间线形状。如果将工作表转换为图片或将工作簿保存为PDF或HTML格式,您会看到时间线被正确渲染。
呈现时间轴
以下示例代码加载包含现有时间轴的sample Excel file,根据时间轴名称获取形状对象,然后通过Shape.ToImage()方法将其呈现为图片。以下图片是output image,显示了已呈现的时间轴。正如你所见,时间轴已正确呈现,并且看起来与示例Excel文件中的相同。
示例代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AsposeCells = require("aspose.cells.node"); | |
// Load sample Excel file containing pivot table. | |
var wb = new AsposeCells.Workbook("input.xlsx"); | |
// Access second worksheet. | |
var sheet = wb.getWorksheets().get(1); | |
// Add timeline relating to pivot table | |
var timeline = sheet.getTimelines().get(0); | |
var options = new AsposeCells.ImageOrPrintOptions(); | |
options.setImageType(AsposeCells.ImageType.Png); | |
// Get timeline shape object by timeline's name | |
var timeLineShape = sheet.getShapes().get(timeline.getName()); | |
timeLineShape.toImage("out.png", options); |