Rendering Timeline
Contents
[
Hide
]
Possible Usage Scenarios
Aspose.Cells supports the rendering of timeline shape without using office 2013, office 2016, office 2019 and office 365. If you convert your worksheet into an image or you save your workbook to PDF or HTML formats, you will see, timelines are rendered properly.
Rendering Timeline
The following sample code loads the sample Excel file that contains an existing timeline. Get the shape object according to the name of timeline, and then render it into a picture through the Shape.ToImage() method. The flowing image is the output image that shows the rendered timeline. As you can see, timeline has been rendered properly and it looks the same as in the sample Excel file.
Sample Code
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
// Load sample Excel file containing timeline. | |
Workbook wb = new Workbook("input.xlsx"); | |
// Access second worksheet. | |
Worksheet sheet = wb.Worksheets[1]; | |
// Access the first Timeline inside the worksheet. | |
Timeline timeline = sheet.Timelines[0]; | |
ImageOrPrintOptions options = new ImageOrPrintOptions(); | |
options.ImageType = ImageType.Png; | |
// Get timeline shape object by timeline's name | |
Shape timeLineShape = sheet.Shapes[timeline.Name]; | |
timeLineShape.ToImage("out.png", options); |