Chart
Overview
Chart is a class in Aspose.Cells FOSS for .NET.
Charts provide visual representation of data and can be created programmatically or loaded from existing XLSX files. Note that modern chartex types (Waterfall, Treemap, Sunburst, etc.) must be loaded from existing files; they cannot be created using the method. var workbook = new Workbook(); var worksheet = workbook.Worksheets[0]; // Add sample data worksheet.Cells[“A1”].PutValue(“Month”); worksheet.Cells[“B1”].PutValue(“Sales”); worksheet.Cells[“A2”].PutValue(“Jan”); worksheet.Cells[“B2”].PutValue(1000); worksheet.Cells[“A3”].PutValue(“Feb”); worksheet.Cells[“B3”].PutValue(1200); // Add a bar chart int chartIndex = worksheet.Charts.Add( ChartType.Column, “Sheet1!$B$1:$B$3”, 5, 1, 10, 3); // Access and configure the chart var chart = worksheet.Charts[chartIndex]; Console.WriteLine($“Chart: {chart.Name}”);
Properties: ChartType, ExtentCx, ExtentCy, LowerRightColumn, LowerRightRow, Name, and 2 more.
Description
Chart is a class in the Aspose.Cells FOSS library for .NET that exposes 0 methods and 8 properties for programmatic use.
The class also provides the Name property (gets the chart display name), the ChartType property (gets the chart type), the UpperLeftRow property (gets the zero-based upper-left row of the chart anchor).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Name | string | Read | Gets the chart display name. |
ChartType | ChartType | Read | Gets the chart type. |
UpperLeftRow | int | Read | Gets the zero-based upper-left row of the chart anchor. |
UpperLeftColumn | int | Read | Gets the zero-based upper-left column of the chart anchor. |
LowerRightRow | int | Read | Gets the zero-based lower-right row of the chart anchor. |
LowerRightColumn | int | Read | Gets the zero-based lower-right column of the chart anchor. |
ExtentCx | long | Read | Gets the width extent in EMU. |
ExtentCy | long | Read | Gets the height extent in EMU. |