Class ExcelDrawings
Collection for Drawing objects.
Inheritance
Implements
Inherited Members
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Syntax
public class ExcelDrawings : IEnumerable<ExcelDrawing>, IEnumerable, IDisposable, IPictureRelationDocument
Properties
Count
Number of items in the collection
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
DrawingXml
A reference to the drawing xml document
Declaration
public XmlDocument DrawingXml { get; }
Property Value
Type | Description |
---|---|
System.Xml.XmlDocument |
Item[Int32]
Returns the drawing at the specified position.
Declaration
public ExcelDrawing this[int PositionID] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | PositionID | The position of the drawing. 0-base |
Property Value
Type | Description |
---|---|
ExcelDrawing |
Item[String]
Returns the drawing matching the specified name
Declaration
public ExcelDrawing this[string Name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the worksheet |
Property Value
Type | Description |
---|---|
ExcelDrawing |
Methods
AddAreaChart(String, eAreaChartType)
Add a new area chart to the worksheet.
Declaration
public ExcelAreaChart AddAreaChart(string Name, eAreaChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eAreaChartType | ChartType | Type of linechart |
Returns
Type | Description |
---|---|
ExcelAreaChart | The chart |
AddAreaChart(String, eAreaChartType, ExcelPivotTable)
Adds a new area chart to the worksheet.
Declaration
public ExcelAreaChart AddAreaChart(string Name, eAreaChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eAreaChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelAreaChart | The chart |
AddBarChart(String, eBarChartType)
Adds a new barchart to the worksheet.
Declaration
public ExcelBarChart AddBarChart(string Name, eBarChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eBarChartType | ChartType | Type of linechart |
Returns
Type | Description |
---|---|
ExcelBarChart | The chart |
AddBarChart(String, eLineChartType, ExcelPivotTable)
Adds a new column- or bar- chart to the worksheet.
Declaration
public ExcelBarChart AddBarChart(string Name, eLineChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eLineChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelBarChart | The chart |
AddBubbleChart(String, eBubbleChartType)
Adds a new bubble chart to the worksheet.
Declaration
public ExcelBubbleChart AddBubbleChart(string Name, eBubbleChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eBubbleChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelBubbleChart | The chart |
AddBubbleChart(String, eBubbleChartType, ExcelPivotTable)
Adds a new bubble chart to the worksheet.
Declaration
public ExcelBubbleChart AddBubbleChart(string Name, eBubbleChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eBubbleChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelBubbleChart | The chart |
AddChart(String, eChartType)
Adds a new chart to the worksheet. Do not support Stock charts .
Declaration
public ExcelChart AddChart(string Name, eChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelChart | The chart |
AddChart(String, eChartType, ExcelPivotTable, eEditAs)
Adds a new chart to the worksheet. Do not support stock charts.
Declaration
public ExcelChart AddChart(string Name, eChartType ChartType, ExcelPivotTable PivotTableSource, eEditAs DrawingType = eEditAs.TwoCell)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
eEditAs | DrawingType | The top element drawingtype. Default is OneCellAnchor for Pictures and TwoCellAnchor from Charts and Shapes |
Returns
Type | Description |
---|---|
ExcelChart | The chart |
AddChartFromTemplate(FileInfo, String)
Adds a new chart using an crtx template
Declaration
public ExcelChart AddChartFromTemplate(FileInfo crtxFile, string name)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | crtxFile | The crtx file |
System.String | name | The name of the chart |
Returns
Type | Description |
---|---|
ExcelChart | The new chart |
AddChartFromTemplate(FileInfo, String, ExcelPivotTable)
Adds a new chart using an crtx template
Declaration
public ExcelChart AddChartFromTemplate(FileInfo crtxFile, string name, ExcelPivotTable pivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | crtxFile | The crtx file |
System.String | name | The name of the chart |
ExcelPivotTable | pivotTableSource | Pivot table source, if the chart is a pivottable |
Returns
Type | Description |
---|---|
ExcelChart | The new chart |
AddChartFromTemplate(Stream, String)
Adds a new chart using an crtx template
Declaration
public ExcelChart AddChartFromTemplate(Stream crtxStream, string name)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | crtxStream | The crtx file as a stream |
System.String | name | The name of the chart |
Returns
Type | Description |
---|---|
ExcelChart | The new chart |
AddChartFromTemplate(Stream, String, ExcelPivotTable)
Adds a new chart using an crtx template
Declaration
public ExcelChart AddChartFromTemplate(Stream crtxStream, string name, ExcelPivotTable pivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | crtxStream | The crtx file as a stream |
System.String | name | The name of the chart |
ExcelPivotTable | pivotTableSource | Pivot table source, if the chart is a pivottable |
Returns
Type | Description |
---|---|
ExcelChart | The new chart |
AddDoughnutChart(String, eDoughnutChartType)
Adds a new doughnut chart to the worksheet.
Declaration
public ExcelDoughnutChart AddDoughnutChart(string Name, eDoughnutChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eDoughnutChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelDoughnutChart | The chart |
AddDoughnutChart(String, eDoughnutChartType, ExcelPivotTable)
Adds a new doughnut chart to the worksheet.
Declaration
public ExcelDoughnutChart AddDoughnutChart(string Name, eDoughnutChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eDoughnutChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelDoughnutChart | The chart |
AddLineChart(String, eLineChartType)
Add a new linechart to the worksheet.
Declaration
public ExcelLineChart AddLineChart(string Name, eLineChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eLineChartType | ChartType | Type of linechart |
Returns
Type | Description |
---|---|
ExcelLineChart | The chart |
AddLineChart(String, eLineChartType, ExcelPivotTable)
Adds a new linechart to the worksheet.
Declaration
public ExcelLineChart AddLineChart(string Name, eLineChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eLineChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelLineChart | The chart |
AddOfPieChart(String, eOfPieChartType)
Adds a new line chart to the worksheet.
Declaration
public ExcelOfPieChart AddOfPieChart(string Name, eOfPieChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eOfPieChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelOfPieChart | The chart |
AddOfPieChart(String, eOfPieChartType, ExcelPivotTable)
Add a new pie of pie or bar of pie chart to the worksheet.
Declaration
public ExcelOfPieChart AddOfPieChart(string Name, eOfPieChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eOfPieChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelOfPieChart | The chart |
AddPicture(String, Image)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, Image image)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.Drawing.Image | image | An image. Allways saved in then JPeg format |
Returns
Type | Description |
---|---|
ExcelPicture |
AddPicture(String, Image, Uri)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, Image Image, Uri Hyperlink)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.Drawing.Image | Image | An image. Allways saved in then JPeg format |
System.Uri | Hyperlink | Picture Hyperlink |
Returns
Type | Description |
---|---|
ExcelPicture | A picture object |
AddPicture(String, FileInfo)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, FileInfo ImageFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.FileInfo | ImageFile | The image file |
Returns
Type | Description |
---|---|
ExcelPicture | A picture object |
AddPicture(String, FileInfo, Uri)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri Hyperlink)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.FileInfo | ImageFile | The image file |
System.Uri | Hyperlink | Picture Hyperlink |
Returns
Type | Description |
---|---|
ExcelPicture | A picture object |
AddPicture(String, Stream, ePictureType)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, Stream PictureStream, ePictureType PictureType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.Stream | PictureStream | An stream image. |
ePictureType | PictureType | The type of image |
Returns
Type | Description |
---|---|
ExcelPicture | A picture object |
AddPicture(String, Stream, ePictureType, Uri)
Adds a picture to the worksheet
Declaration
public ExcelPicture AddPicture(string Name, Stream pictureStream, ePictureType pictureType, Uri Hyperlink)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.Stream | pictureStream | An stream image. |
ePictureType | pictureType | The type of image |
System.Uri | Hyperlink | Picture Hyperlink |
Returns
Type | Description |
---|---|
ExcelPicture | A picture object |
AddPictureAsync(String, FileInfo)
Adds a picture to the worksheet
Declaration
public Task<ExcelPicture> AddPictureAsync(string Name, FileInfo ImageFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.FileInfo | ImageFile | The image file |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ExcelPicture> | A picture object |
AddPictureAsync(String, FileInfo, Uri)
Adds a picture to the worksheet
Declaration
public Task<ExcelPicture> AddPictureAsync(string Name, FileInfo ImageFile, Uri Hyperlink)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.FileInfo | ImageFile | The image file |
System.Uri | Hyperlink | Picture Hyperlink |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ExcelPicture> | A picture object |
AddPictureAsync(String, Stream, ePictureType)
Adds a picture to the worksheet
Declaration
public Task<ExcelPicture> AddPictureAsync(string Name, Stream PictureStream, ePictureType PictureType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.Stream | PictureStream | An stream image. |
ePictureType | PictureType | The type of image |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ExcelPicture> | A picture object |
AddPictureAsync(String, Stream, ePictureType, Uri)
Adds a picture to the worksheet
Declaration
public Task<ExcelPicture> AddPictureAsync(string Name, Stream pictureStream, ePictureType pictureType, Uri Hyperlink)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
System.IO.Stream | pictureStream | An stream image. |
ePictureType | pictureType | The type of image |
System.Uri | Hyperlink | Picture Hyperlink |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ExcelPicture> | A picture object |
AddPieChart(String, ePieChartType)
Adds a new pie chart to the worksheet.
Declaration
public ExcelPieChart AddPieChart(string Name, ePieChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
ePieChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelPieChart | The chart |
AddPieChart(String, ePieChartType, ExcelPivotTable)
Adds a new pie chart to the worksheet.
Declaration
public ExcelPieChart AddPieChart(string Name, ePieChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
ePieChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelPieChart | The chart |
AddRadarChart(String, eRadarChartType)
Adds a new radar chart to the worksheet.
Declaration
public ExcelRadarChart AddRadarChart(string Name, eRadarChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eRadarChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelRadarChart | The chart |
AddRadarChart(String, eRadarChartType, ExcelPivotTable)
Adds a new radar chart to the worksheet.
Declaration
public ExcelRadarChart AddRadarChart(string Name, eRadarChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eRadarChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelRadarChart | The chart |
AddScatterChart(String, eScatterChartType)
Adds a new scatter chart to the worksheet.
Declaration
public ExcelScatterChart AddScatterChart(string Name, eScatterChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eScatterChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelScatterChart | The chart |
AddScatterChart(String, eScatterChartType, ExcelPivotTable)
Adds a new scatter chart to the worksheet.
Declaration
public ExcelScatterChart AddScatterChart(string Name, eScatterChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eScatterChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelScatterChart | The chart |
AddShape(String, eShapeStyle)
Adds a new shape to the worksheet
Declaration
public ExcelShape AddShape(string Name, eShapeStyle Style)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | Name |
eShapeStyle | Style | Shape style |
Returns
Type | Description |
---|---|
ExcelShape | The shape object |
AddShape(String, ExcelShape)
Adds a new shape to the worksheet
Declaration
public ExcelShape AddShape(string Name, ExcelShape Source)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | Name |
ExcelShape | Source | Source shape |
Returns
Type | Description |
---|---|
ExcelShape | The shape object |
AddSurfaceChart(String, eSurfaceChartType)
Adds a new surface chart to the worksheet.
Declaration
public ExcelSurfaceChart AddSurfaceChart(string Name, eSurfaceChartType ChartType)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eSurfaceChartType | ChartType | Type of chart |
Returns
Type | Description |
---|---|
ExcelSurfaceChart | The chart |
AddSurfaceChart(String, eSurfaceChartType, ExcelPivotTable)
Adds a new surface chart to the worksheet.
Declaration
public ExcelSurfaceChart AddSurfaceChart(string Name, eSurfaceChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | |
eSurfaceChartType | ChartType | Type of chart |
ExcelPivotTable | PivotTableSource | The pivottable source for a pivotchart |
Returns
Type | Description |
---|---|
ExcelSurfaceChart | The chart |
Clear()
Removes all drawings from the collection
Declaration
public void Clear()
Dispose()
Disposes the object
Declaration
public void Dispose()
GetEnumerator()
Get the enumerator
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | The enumerator |
Remove(ExcelDrawing)
Removes a drawing.
Declaration
public void Remove(ExcelDrawing Drawing)
Parameters
Type | Name | Description |
---|---|---|
ExcelDrawing | Drawing | The drawing |
Remove(Int32)
Removes a drawing.
Declaration
public void Remove(int Index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index | The index of the drawing |
Remove(String)
Removes a drawing.
Declaration
public void Remove(string Name)
Parameters
Type | Name | Description |
---|---|---|
System.String | Name | The name of the drawing |
Explicit Interface Implementations
IEnumerable<ExcelDrawing>.GetEnumerator()
Declaration
IEnumerator<ExcelDrawing> IEnumerable<ExcelDrawing>.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ExcelDrawing> |