Back to Devexpress

ChartSheetCollection.Add() Method

officefileapi-devexpress-dot-spreadsheet-dot-chartsheetcollection-e269f776.md

latest4.3 KB
Original Source

ChartSheetCollection.Add() Method

Creates a new chart sheet and appends it to the end of the collection.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
ChartSheet Add()
vb
Function Add As ChartSheet

Returns

TypeDescription
ChartSheet

A ChartSheet object that specifies the new chart sheet.

|

Remarks

The Add method creates a new chart sheet under the default name like ChartN, where N is a number that is greater by 1 than the maximum number used in chart sheet names of the same type. To change the chart sheet name, use the ChartSheet.Name property. Use the ChartSheet.Chart property to access a chart located on the chart sheet and specify its settings (select chart data, change the chart type and adjust its appearance). By default, a chart sheet created by the current Add method overload contains an empty chart of the ChartType.ColumnClustered type.

To insert a new chart sheet to the specified position in the collection, use the ChartSheetCollection.Insert method.

To remove a chart sheet from the collection, use the ChartSheetCollection.Remove or ChartSheetCollection.RemoveAt method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Add() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeExamples/ChartSheetActions.cs#L74

csharp
// Create the first chart sheet.
workbook.ChartSheets.Add();

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/ChartSheetActions.cs#L74

csharp
// Create the first chart sheet.
workbook.ChartSheets.Add();

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/ChartSheetActions.vb#L72

vb
' Create the first chart sheet.
workbook.ChartSheets.Add()

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/ChartSheetActions.vb#L71

vb
' Create the first chart sheet.
workbook.ChartSheets.Add()

See Also

Chart

ChartSheetCollection Interface

ChartSheetCollection Members

DevExpress.Spreadsheet Namespace