タイムラインのレンダリング

可能な使用シナリオ

Aspose.Cells for Python via .NETは、オフィス2013、オフィス2016、オフィス2019、およびオフィス365を使用せずにタイムラインの形状をレンダリングすることをサポートしています。ワークシートを画像に変換したり、ワークブックをPDFやHTML形式に保存すると、タイムラインが適切にレンダリングされます。

Aspose.Cells for Python Excel Libraryを使用したタイムラインのレンダリング方法

次のサンプルコードは、既存のタイムラインを含むsample Excel fileを読み込みます。タイムラインの名前に応じてシェイプオブジェクトを取得し、Shape.to_image()メソッドを使用して画像にレンダリングします。次の画像は、レンダリングされたタイムラインを示すoutput imageです。タイムラインが適切にレンダリングされ、サンプルExcelファイルと同じように見えることがわかります。

todo:image_alt_text

サンプルコード

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)