TX Sheet Control

Chart Class

Class
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Api.dll
Install
dotnet add package TXTextControl.TXSheetControl.Server .NET 10 and later.
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll
Inherits
  1. DocumentObject
  2. Chart

Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.

Syntax

public class Chart

Members

Properties

PropertyDescription
Id

Methods

MethodDescription
GetDataAsyncPerforms an operation on this document without activating another worksheet.
GetSnapshotAsyncPerforms an operation on this document without activating another worksheet.
GetTitleAsyncPerforms an operation on this document without activating another worksheet.
MoveToAsyncPerforms an operation on this document without activating another worksheet.
RemoveAsyncPerforms an operation on this document without activating another worksheet.
ResizeAsyncPerforms an operation on this document without activating another worksheet.
UpdateAsyncPerforms an operation on this document without activating another worksheet.

Examples

Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateChartReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A1:B5").SetValuesAsync(new object?[][]
    {
        ["Region", "Revenue"], ["North", 42000], ["South", 38500], ["East", 31200], ["West", 44900]
    });

    var chart = await sheet.Charts.AddAsync(new { type = "column", title = "Revenue by region", dataRange = "A1:B5", anchor = new { cell = "D2" } });
    return await control.SaveAsync(StreamType.PDF);
}

See Also