Create Timeline in Excel using C#

We are pleased to announce the release of Aspose.Cells for .NET v22.4. Please check the document on how to install Aspose for .NET APIs directly from NuGet repository. In this release, the long-awaited feature about Timelines is supported. We have also supported to add Microsoft Excel Formula Watch Window for the users. Moreover, we included some important fixes and other enhancements for the users. Please check the release notes in order to get an idea about what is new and what has been enhanced or fixed with this revision of Aspose.Cells for .NET.

Instead of adjusting filters to show dates, you can use a PivotTable Timeline——a dynamic filter option that lets you easily filter by date/time, and zoom in on the period you want with a slider control. Microsoft Excel allows you to create timeline by selecting a pivot table and then clicking the Insert > Timeline. Aspose.Cells also allows you to create timeline using the Worksheet.Timelines.Add() method.

Create, manipulate and render Timelines

Timelines are a strong way to filter pivot table data. You can insert timelines into MS Excel to quickly and easily filter pivot tables. Aspose.Cells now supports to create, manipulate and render Timelines in the spreadsheet.

Create Timelines into a Pivot Table
Please see the following sample code. It loads the sample Excel file that contains the pivot table. It then creates the timeline based on the first base pivot field.

Create Timeline into a Pivot Table using C#

Create Timeline into a Pivot Table using C#

Please see the following article for more detail on this topic for your reference.

Rendering Timelines

Aspose.Cells also supports rendering of timeline shape. When you convert your worksheet into image or save your workbook to PDF or HTML formats, you will see, timelines are rendered properly.

Render Timeline to Image
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.

Render Timeline to Image using C#

Render Timeline to Image using C#

Please see the following articles for more detail for your reference.

Aspose.Cells for .NET Resources

The resources, you may need to accomplish your tasks:

See Also