Method AddChartSheet
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
AddChartSheet(string, XlsxChartType, XlsxDocumentSheet, XlsxCellRange, XlsxChartOptions?)
Adds a chart sheet after the last sheet (Phase 211): one chart filling the sheet, made of a range of another sheet as Add(XlsxChartType, XlsxCellRange, string, XlsxChartOptions?) makes one.
public XlsxDocumentSheet AddChartSheet(string name, XlsxChartType type, XlsxDocumentSheet source, XlsxCellRange data, XlsxChartOptions? options = null)
Parameters
namestringThe chart sheet's name, by the rules of AddSheet(string).
typeXlsxChartTypeThe chart's type.
sourceXlsxDocumentSheetThe worksheet the range is on.
dataXlsxCellRangeThe range the chart plots.
optionsXlsxChartOptionsHow the chart is made (its size is the sheet's); null for Excel's defaults.
Returns
- XlsxDocumentSheet
The new chart sheet; its chart is
Charts[0].
Exceptions
- ArgumentNullException
nameorsourceis null.- ArgumentException
The name is not a legal sheet name or another sheet has it; the type is not made here; the range gives no series; the source is another workbook's sheet.
- InvalidOperationException
The source is not a worksheet.