渲染时间轴
Contents
[
Hide
]
可能的使用场景
Aspose.Cells for Python via .NET支持在不使用Office 2013、Office 2016、Office 2019和Office 365的情况下呈现时间轴形状。如果您将工作表转换为图像,或者将工作簿保存为PDF或HTML格式,您将看到时间轴被正确呈现。
如何使用Aspose.Cells for Python Excel库呈现时间轴
以下示例代码加载包含现有时间轴的 示例Excel文件。根据时间轴的名称获取形状对象,然后通过Shape.to_image()方法将其呈现为图像。流动的图像是输出图像,显示了呈现的时间轴。正如您所看到的,时间轴已经被正确呈现,并且看起来与示例Excel文件中的时间轴相同。
示例代码
This file contains 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
from aspose.cells import Workbook | |
from aspose.cells.drawing import ImageType | |
from aspose.cells.rendering import ImageOrPrintOptions | |
# Load sample Excel file containing timeline. | |
wb = Workbook("input.xlsx") | |
# Access second worksheet. | |
sheet = wb.worksheets[1] | |
# Access the first Timeline inside the worksheet. | |
timeline = sheet.timelines[0] | |
options = ImageOrPrintOptions() | |
options.image_type = ImageType.PNG | |
# Get timeline shape object | |
timeLineShape = sheet.shapes[0] | |
timeLineShape.to_image("out.png", options) |