Skip to content

Class ExcelChartDrawings

Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll

Collection of drawings inside a chart

public class ExcelChartDrawings : IEnumerable<ExcelDrawing>, IEnumerable, IDisposable

Inheritance

object ← ExcelChartDrawings

Implements

IDisposable
IEnumerable
IEnumerable<ExcelDrawing>

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Count

Number of items in the collection

public int Count { get; }

Property Value

int

DrawingXml

A reference to the drawing xml document

public XmlDocument DrawingXml { get; }

Property Value

XmlDocument

this[int]

Returns the drawing at the specified position.

public ExcelDrawing this[int PositionID] { get; }

Property Value

ExcelDrawing

this[string]

Returns the drawing matching the specified name

public ExcelDrawing this[string Name] { get; }

Property Value

ExcelDrawing

Methods

AddPicture(string, string)

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, string ImagePath)

Parameters

Name string

The name of the shape

ImagePath string

The path to the image file.

Returns

ExcelPicture

The shape

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, string ImagePath, ExcelHyperLink HyperLink)

Parameters

Name string

The name of the shape

ImagePath string

The path to the image file.

HyperLink ExcelHyperLink

A hyperlink for the shape

Returns

ExcelPicture

The shape

AddPicture(string, FileInfo)

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, FileInfo ImageFile)

Parameters

Name string

The name of the shape

ImageFile FileInfo

The image file.

Returns

ExcelPicture

The shape

AddPicture(string, FileInfo, Uri)

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri HyperLink)

Parameters

Name string

The name of the shape

ImageFile FileInfo

The image file.

HyperLink Uri

A hyperlink for the shape

Returns

ExcelPicture

The shape

AddPicture(string, Stream)

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, Stream ImageStream)

Parameters

Name string

The name of the shape

ImageStream Stream

The stream containing image file.

Returns

ExcelPicture

The shape

AddPicture(string, Stream, Uri)

Adds a picture to the chart

public ExcelPicture AddPicture(string Name, Stream ImageStream, Uri HyperLink)

Parameters

Name string

The name of the shape

ImageStream Stream

The stream containing image file.

HyperLink Uri

A hyperlink for the shape

Returns

ExcelPicture

The shape

AddShape(string, eShapeStyle)

Adds a shape to the chart

public ExcelShape AddShape(string Name, eShapeStyle Style)

Parameters

Name string

The name of the shape

Style eShapeStyle

The type of shape

Returns

ExcelShape

The shape

Dispose()

Disposes the drawings collection and all drawings in it.

public void Dispose()

GetEnumerator()

Returns an Enumerator for the drawings in the chart

public IEnumerator<ExcelDrawing> GetEnumerator()

Returns

IEnumerator<ExcelDrawing>

Remove(int)

Removes a drawing.

public void Remove(int Index)

Parameters

Index int

The index of the drawing

Remove(ExcelDrawing)

Removes a drawing.

public void Remove(ExcelDrawing Drawing)

Parameters

Drawing ExcelDrawing

The drawing

Remove(string)

Removes a drawing.

public void Remove(string Name)

Parameters

Name string

The name of the drawing