ChartCollection

ChartCollection

Overview

ChartCollection is a class in Aspose.Cells FOSS for .NET.

Represents collection of charts on a worksheet. Charts provide visual data representation and support various chart types including bar, line, pie, etc. Charts are positioned by specifying anchor coordinates and reference worksheet data using formulas. Each chart can be independently configured with different types and styles. var workbook = new Workbook(); var worksheet = workbook.Worksheets[0]; // Prepare data worksheet.Cells[“A1”].PutValue(“Month”); worksheet.Cells[“B1”].PutValue(“Sales”); // … add more data … // Create a bar chart int chartIndex = worksheet.Charts.Add( ChartType.Column, “Sheet1!$B$1:$B$12”, // data range formula 5, 1, 20, 5); // anchor coordinates Console.WriteLine($“Chart {chartIndex} added: {worksheet.Charts[chartIndex].Name}”);

This class provides 1 method for working with ChartCollection objects in .NET programs. Available methods include: Add. All exported members are accessible to any .NET application after installing the Aspose.Cells FOSS for .NET package. Properties: Count.

Description

ChartCollection is a class in the Aspose.Cells FOSS library for .NET that exposes 1 method and 1 property for programmatic use.

The class also provides the Count property (gets the number of charts on the worksheet).

Properties

NameTypeAccessDescription
CountintReadGets the number of charts on the worksheet.

Methods

SignatureDescription
Add(type: ChartType, dataRange: string, upperLeftRow: int, upperLeftColumn: int, lowerRightRow: int, lowerRightColumn: int)The zero-based index of the added chart.

See Also