Back to Devexpress

ChartSheetExtensions Class

officefileapi-devexpress-dot-spreadsheet-082613c4.md

latest2.9 KB
Original Source

ChartSheetExtensions Class

Defines extension methods for the ChartSheet interface.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these methods in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public static class ChartSheetExtensions
vb
Public Module ChartSheetExtensions

Remarks

To enable chart sheet extensions, add a reference to the DevExpress.Docs.v25.2.dll assembly and explicitly import the DevExpress.Spreadsheet namespace into the code with the using directive ( Imports in Visual Basic).

You can call extension methods in the same way as instance methods of the ChartSheet object.

The example below shows how to use the CreateThumbnail extension method to save a chart sheet as an image.

csharp
using DevExpress.Spreadsheet;
// ...

// Create a new Workbook object.
using (Workbook workbook = new Workbook())
{
    // Load a workbook from a file.
    workbook.LoadDocument("VariableCosts.xlsx", DocumentFormat.Xlsx);

    // Access an active chart sheet.
    ChartSheet chartSheet = workbook.ChartSheets.ActiveChartSheet;

    // Save the chart sheet as an image.
    chartSheet.CreateThumbnail(920, 670).NativeImage.Save("Chart_sheet_Thumbnail.png");
}
vb
Imports DevExpress.Spreadsheet
' ...

' Create a new Workbook object.
Using workbook As New Workbook()
    ' Load a workbook from a file.
    workbook.LoadDocument("VariableCosts.xlsx", DocumentFormat.Xlsx)

    ' Access an active chart sheet.
    Dim chartSheet As ChartSheet = workbook.ChartSheets.ActiveChartSheet

    ' Save the chart sheet as an image.
    chartSheet.CreateThumbnail(920, 670).NativeImage.Save("Chart_sheet_Thumbnail.png")
End Using

Inheritance

Object ChartSheetExtensions

See Also

ChartSheetExtensions Members

DevExpress.Spreadsheet Namespace