Class ExcelChartDrawings
Collection of drawings inside a chart
Inherited Members
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Syntax
public class ExcelChartDrawings : IEnumerable<ExcelDrawing>, IEnumerable, IDisposable
Properties
Count
Number of items in the collection
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
DrawingXml
A reference to the drawing xml document
Declaration
public XmlDocument DrawingXml { get; }
Property Value
| Type | Description |
|---|---|
| XmlDocument |
this[int]
Returns the drawing at the specified position.
Declaration
public ExcelDrawing this[int PositionID] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | PositionID | The position of the drawing. 0-base |
Property Value
| Type | Description |
|---|---|
| ExcelDrawing | The drawing |
this[string]
Returns the drawing matching the specified name
Declaration
public ExcelDrawing this[string Name] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the drawing |
Property Value
| Type | Description |
|---|---|
| ExcelDrawing | The drawing |
Methods
AddPicture(string, FileInfo)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, FileInfo ImageFile)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| FileInfo | ImageFile | The image file. |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddPicture(string, FileInfo, Uri)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri HyperLink)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| FileInfo | ImageFile | The image file. |
| Uri | HyperLink | A hyperlink for the shape |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddPicture(string, Stream)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, Stream ImageStream)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| Stream | ImageStream | The stream containing image file. |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddPicture(string, Stream, Uri)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, Stream ImageStream, Uri HyperLink)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| Stream | ImageStream | The stream containing image file. |
| Uri | HyperLink | A hyperlink for the shape |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddPicture(string, string)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, string ImagePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| string | ImagePath | The path to the image file. |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddPicture(string, string, ExcelHyperLink)
Adds a picture to the chart
Declaration
public ExcelPicture AddPicture(string Name, string ImagePath, ExcelHyperLink HyperLink)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| string | ImagePath | The path to the image file. |
| ExcelHyperLink | HyperLink | A hyperlink for the shape |
Returns
| Type | Description |
|---|---|
| ExcelPicture | The shape |
AddShape(string, eShapeStyle)
Adds a shape to the chart
Declaration
public ExcelShape AddShape(string Name, eShapeStyle Style)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the shape |
| eShapeStyle | Style | The type of shape |
Returns
| Type | Description |
|---|---|
| ExcelShape | The shape |
Dispose()
Disposes the drawings collection and all drawings in it.
Declaration
public void Dispose()
GetEnumerator()
Returns an Enumerator for the drawings in the chart
Declaration
public IEnumerator<ExcelDrawing> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<ExcelDrawing> |
Remove(ExcelDrawing)
Removes a drawing.
Declaration
public void Remove(ExcelDrawing Drawing)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelDrawing | Drawing | The drawing |
Remove(int)
Removes a drawing.
Declaration
public void Remove(int Index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | Index | The index of the drawing |
Remove(string)
Removes a drawing.
Declaration
public void Remove(string Name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | Name | The name of the drawing |