Class ExcelDrawings¶
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Collection for Drawing objects.
Inheritance¶
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
Property Value¶
DrawingXml¶
A reference to the drawing xml document
Property Value¶
XmlDocument
this[int]¶
Returns the drawing at the specified position.
Property Value¶
this[string]¶
Returns the drawing matching the specified name
Property Value¶
Methods¶
AddAreaChart(string, eAreaChartType)¶
Add a new area chart to the worksheet.
Parameters¶
Name string
ChartType eAreaChartType
Type of linechart
Returns¶
The chart
AddAreaChart(string, eAreaChartType, ExcelPivotTable)¶
Adds a new area chart to the worksheet.
public ExcelAreaChart AddAreaChart(string Name, eAreaChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eAreaChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddBarChart(string, eBarChartType)¶
Adds a new barchart to the worksheet.
Parameters¶
Name string
ChartType eBarChartType
Type of linechart
Returns¶
The chart
AddBarChart(string, eBarChartType, ExcelPivotTable)¶
Adds a new column- or bar- chart to the worksheet.
public ExcelBarChart AddBarChart(string Name, eBarChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eBarChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddBoxWhiskerChart(string)¶
Adds a new box & whisker chart to the worksheet.
Parameters¶
Name string
Returns¶
The chart
AddBubbleChart(string, eBubbleChartType)¶
Adds a new bubble chart to the worksheet.
Parameters¶
Name string
ChartType eBubbleChartType
Type of chart
Returns¶
The chart
AddBubbleChart(string, eBubbleChartType, ExcelPivotTable)¶
Adds a new bubble chart to the worksheet.
public ExcelBubbleChart AddBubbleChart(string Name, eBubbleChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eBubbleChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddButtonControl(string)¶
Adds a button form control to the worksheet
Parameters¶
Name string
The name of the button
Returns¶
The button form control
AddChart(string, eChartType, ExcelPivotTable, eEditAs)¶
Adds a new chart to the worksheet. Stock charts cannot be added by this method. See AddStockChart(string, eStockChartType, ExcelRangeBase, bool)
public ExcelChart AddChart(string Name, eChartType ChartType, ExcelPivotTable PivotTableSource, eEditAs DrawingType = eEditAs.TwoCell)
Parameters¶
Name string
ChartType eChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
DrawingType eEditAs
The top element drawingtype. Default is OneCellAnchor for Pictures and TwoCellAnchor from Charts and Shapes
Returns¶
The chart
AddChart(string, eChartType)¶
Adds a new chart to the worksheet. Do not support Stock charts .
Parameters¶
Name string
ChartType eChartType
Type of chart
Returns¶
The chart
AddChartFromTemplate(FileInfo, string)¶
Adds a new chart using an crtx template
Parameters¶
crtxFile FileInfo
The crtx file
name string
The name of the chart
Returns¶
The new chart
AddChartFromTemplate(FileInfo, string, ExcelPivotTable)¶
Adds a new chart using an crtx template
public ExcelChart AddChartFromTemplate(FileInfo crtxFile, string name, ExcelPivotTable pivotTableSource)
Parameters¶
crtxFile FileInfo
The crtx file
name string
The name of the chart
pivotTableSource ExcelPivotTable
Pivot table source, if the chart is a pivottable
Returns¶
The new chart
AddChartFromTemplate(Stream, string)¶
Adds a new chart using an crtx template
Parameters¶
crtxStream Stream
The crtx file as a stream
name string
The name of the chart
Returns¶
The new chart
AddChartFromTemplate(Stream, string, ExcelPivotTable)¶
Adds a new chart using an crtx template
public ExcelChart AddChartFromTemplate(Stream crtxStream, string name, ExcelPivotTable pivotTableSource)
Parameters¶
crtxStream Stream
The crtx file as a stream
name string
The name of the chart
pivotTableSource ExcelPivotTable
Pivot table source, if the chart is a pivottable
Returns¶
The new chart
AddCheckBoxControl(string)¶
Adds a checkbox form control to the worksheet
Parameters¶
Name string
The name of the checkbox control
Returns¶
The checkbox form control
AddControl(string, eControlType)¶
Adds a form control to the worksheet
Parameters¶
Name string
The name
ControlType eControlType
The type of control
Returns¶
Exceptions¶
Chart sheets cannot have controls
Drawing names must be unique
AddDoughnutChart(string, eDoughnutChartType, ExcelPivotTable)¶
Adds a new doughnut chart to the worksheet.
public ExcelDoughnutChart AddDoughnutChart(string Name, eDoughnutChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eDoughnutChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddDoughnutChart(string, eDoughnutChartType)¶
Adds a new doughnut chart to the worksheet.
Parameters¶
Name string
ChartType eDoughnutChartType
Type of chart
Returns¶
The chart
AddDropDownControl(string)¶
Adds a drop-down form control to the worksheet
Parameters¶
Name string
The name of the drop-down control
Returns¶
The drop-down form control
AddExtendedChart(string, eChartExType)¶
Adds a new chart to the worksheet.
Parameters¶
Name string
ChartType eChartExType
Type of chart
Returns¶
The chart
AddExtendedChart(string, eChartExType, ExcelPivotTable)¶
Adds a new extended chart to the worksheet. Extended charts are
public ExcelChartEx AddExtendedChart(string Name, eChartExType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eChartExType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddFunnelChart(string)¶
Adds a funnel chart to the worksheet.
Parameters¶
Name string
Returns¶
The chart
AddGroupBoxControl(string)¶
Adds a group box form control to the worksheet
Parameters¶
Name string
The name of the group box control
Returns¶
The group box form control
AddHistogramChart(string, bool)¶
Adds a new Histogram or Pareto chart to the worksheet.
Parameters¶
Name string
AddParetoLine bool
If true a pareto line is added to the chart. The ChartType will also be Pareto.
Returns¶
The chart
AddLabelControl(string)¶
Adds a label form control to the worksheet
Parameters¶
Name string
The name of the label control
Returns¶
The label form control
AddLineChart(string, eLineChartType)¶
Add a new linechart to the worksheet.
Parameters¶
Name string
ChartType eLineChartType
Type of linechart
Returns¶
The chart
AddLineChart(string, eLineChartType, ExcelPivotTable)¶
Adds a new linechart to the worksheet.
public ExcelLineChart AddLineChart(string Name, eLineChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eLineChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddListBoxControl(string)¶
Adds a list box form control to the worksheet
Parameters¶
Name string
The name of the list box control
Returns¶
The list box form control
AddOfPieChart(string, eOfPieChartType)¶
Adds a new line chart to the worksheet.
Parameters¶
Name string
ChartType eOfPieChartType
Type of chart
Returns¶
The chart
AddOfPieChart(string, eOfPieChartType, ExcelPivotTable)¶
Add a new pie of pie or bar of pie chart to the worksheet.
public ExcelOfPieChart AddOfPieChart(string Name, eOfPieChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eOfPieChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddPicture(string, string, PictureLocation)¶
Adds a picture to the worksheet
public ExcelPicture AddPicture(string Name, string ImagePath, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
The name of the drawing object
ImagePath string
The path to the image file
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPicture(string, string, ExcelHyperLink, PictureLocation)¶
Adds a picture to the worksheet
public ExcelPicture AddPicture(string Name, string ImagePath, ExcelHyperLink Hyperlink, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
The name of the drawing object
ImagePath string
The path to the image file
Hyperlink ExcelHyperLink
Picture Hyperlink
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPicture(string, FileInfo, PictureLocation)¶
Adds a picture to the worksheet
public ExcelPicture AddPicture(string Name, FileInfo ImageFile, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImageFile FileInfo
The image file
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPicture(string, FileInfo, Uri, PictureLocation)¶
Adds a picture to the worksheet
public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri Hyperlink, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImageFile FileInfo
The image file
Hyperlink Uri
Picture Hyperlink
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPicture(string, Stream)¶
Adds a picture to the worksheet using a stream. EPPlus will identify the type of image automatically.
Parameters¶
Name string
PictureStream Stream
An stream image.
Returns¶
A picture object
AddPicture(string, Stream, Uri)¶
Adds a picture to the worksheet from a stream. EPPlus will identify the type of image automatically.
Parameters¶
Name string
PictureStream Stream
An stream image.
Hyperlink Uri
The Picture Hyperlink
Returns¶
A picture object
AddPicture(string, Stream, ePictureType?)¶
Adds a picture to the worksheet
[Obsolete("This overload is deprecated, please use AddPicture(string, Stream) instead.")]
public ExcelPicture AddPicture(string Name, Stream PictureStream, ePictureType? PictureType)
Parameters¶
Name string
PictureStream Stream
An stream image.
PictureType ePictureType?
The type of image. A null value means that EPPlus will identify the type of image automatically.
Returns¶
A picture object
AddPicture(string, Stream, ePictureType?, Uri)¶
Adds a picture to the worksheet
[Obsolete("This overload is deprecated, please use AddPicture(string, Stream, Uri) instead.")]
public ExcelPicture AddPicture(string Name, Stream pictureStream, ePictureType? pictureType, Uri Hyperlink)
Parameters¶
Name string
pictureStream Stream
An stream image.
pictureType ePictureType?
The type of image. A null value means that EPPlus will identify the type of image automatically.
Hyperlink Uri
Picture Hyperlink
Returns¶
A picture object
AddPictureAsync(string, FileInfo, PictureLocation)¶
Adds a picture to the worksheet
public Task<ExcelPicture> AddPictureAsync(string Name, FileInfo ImageFile, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImageFile FileInfo
The image file
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPictureAsync(string, FileInfo, Uri, PictureLocation)¶
Adds a picture to the worksheet
public Task<ExcelPicture> AddPictureAsync(string Name, FileInfo ImageFile, Uri Hyperlink, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImageFile FileInfo
The image file
Hyperlink Uri
Picture Hyperlink
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPictureAsync(string, string, PictureLocation)¶
Adds a picture to the worksheet
public Task<ExcelPicture> AddPictureAsync(string Name, string ImagePath, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImagePath string
The path to the image file
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPictureAsync(string, string, Uri, PictureLocation)¶
Adds a picture to the worksheet
public Task<ExcelPicture> AddPictureAsync(string Name, string ImagePath, Uri Hyperlink, PictureLocation Location = PictureLocation.Embed)
Parameters¶
Name string
ImagePath string
The path to the image file
Hyperlink Uri
Picture Hyperlink
Location PictureLocation
Location to access the image from
Returns¶
A picture object
AddPictureAsync(string, Stream)¶
Adds a picture to the worksheet from a stream. EPPlus will identify the type of image automatically.
Parameters¶
Name string
PictureStream Stream
An stream image.
Returns¶
A picture object
AddPictureAsync(string, Stream, Uri)¶
Adds a picture to the worksheet from a stream. EPPlus will identify the type of image automatically.
Parameters¶
Name string
PictureStream Stream
An stream image.
Hyperlink Uri
The Picture Hyperlink
Returns¶
A picture object
AddPictureAsync(string, Stream, ePictureType?)¶
Adds a picture to the worksheet
[Obsolete("This overload is deprecated, please use AddPictureAsync(string, Stream) instead.")]
public Task<ExcelPicture> AddPictureAsync(string Name, Stream PictureStream, ePictureType? PictureType)
Parameters¶
Name string
PictureStream Stream
An stream image.
PictureType ePictureType?
The type of image. A null value means that EPPlus will identify the type of image automatically.
Returns¶
A picture object
AddPictureAsync(string, Stream, ePictureType?, Uri)¶
Adds a picture to the worksheet
[Obsolete("This overload is deprecated, please use AddPictureAsync(string, Stream, Uri) instead.")]
public Task<ExcelPicture> AddPictureAsync(string Name, Stream pictureStream, ePictureType? pictureType, Uri Hyperlink)
Parameters¶
Name string
pictureStream Stream
An stream image.
pictureType ePictureType?
The type of image. A null value means that EPPlus will identify the type of image automatically.
Hyperlink Uri
The Picture Hyperlink
Returns¶
A picture object
AddPieChart(string, ePieChartType)¶
Adds a new pie chart to the worksheet.
Parameters¶
Name string
ChartType ePieChartType
Type of chart
Returns¶
The chart
AddPieChart(string, ePieChartType, ExcelPivotTable)¶
Adds a new pie chart to the worksheet.
public ExcelPieChart AddPieChart(string Name, ePieChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType ePieChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddRadarChart(string, eRadarChartType, ExcelPivotTable)¶
Adds a new radar chart to the worksheet.
public ExcelRadarChart AddRadarChart(string Name, eRadarChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eRadarChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddRadarChart(string, eRadarChartType)¶
Adds a new radar chart to the worksheet.
Parameters¶
Name string
ChartType eRadarChartType
Type of chart
Returns¶
The chart
AddRadioButtonControl(string)¶
Adds a radio button form control to the worksheet
Parameters¶
Name string
The name of the radio button control
Returns¶
The radio button form control
AddRegionMapChart(string)¶
Adds a region map chart to the worksheet. Note that EPPlus rely on the spreadsheet application to create the geocache data
Parameters¶
Name string
Returns¶
The chart
AddScatterChart(string, eScatterChartType, ExcelPivotTable)¶
Adds a new scatter chart to the worksheet.
public ExcelScatterChart AddScatterChart(string Name, eScatterChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eScatterChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddScatterChart(string, eScatterChartType)¶
Adds a new scatter chart to the worksheet.
Parameters¶
Name string
ChartType eScatterChartType
Type of chart
Returns¶
The chart
AddScrollBarControl(string)¶
Adds a scroll bar control to the worksheet
Parameters¶
Name string
The name of the scroll bar control
Returns¶
The scroll bar form control
AddShape(string, eShapeStyle)¶
Adds a new shape to the worksheet
Parameters¶
Name string
Name
Style eShapeStyle
Shape style
Returns¶
The shape object
AddShape(string, ExcelShape)¶
Adds a new shape to the worksheet
Parameters¶
Name string
Name
Source ExcelShape
Source shape
Returns¶
The shape object
AddSpinButtonControl(string)¶
Adds a spin button control to the worksheet
Parameters¶
Name string
The name of the spin button control
Returns¶
The spin button form control
AddStockChart(string, eStockChartType, ExcelRangeBase, bool)¶
Adds a new stock chart to the worksheet.
Requires a range with four, five or six columns or rows depending on the stock chart type.
The first column/row is the category series.
The following columns/rows in the range depend on the stock chart type (HLC, OHLC, VHLC, VOHLC).
You can control if the range should be read by column or by row via the readSeriesByColumn parameter.
public ExcelStockChart AddStockChart(string Name, eStockChartType ChartType, ExcelRangeBase Range, bool readSeriesByColumn = true)
Parameters¶
Name string
ChartType eStockChartType
The Stock chart type
Range ExcelRangeBase
The range containing all the series. Must match the stock chart type's expected ranges
readSeriesByColumn bool
If true the series will be read by column (left to right), if false they will be read by row (top-down)
Returns¶
The chart
AddStockChart(string, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase, ExcelRangeBase)¶
Adds a new stock chart to the worksheet. The stock chart type will depend on if the parameters OpenSerie and/or VolumeSerie is supplied
public ExcelStockChart AddStockChart(string Name, ExcelRangeBase CategorySerie, ExcelRangeBase HighSerie, ExcelRangeBase LowSerie, ExcelRangeBase CloseSerie, ExcelRangeBase OpenSerie = null, ExcelRangeBase VolumeSerie = null)
Parameters¶
Name string
CategorySerie ExcelRangeBase
The category serie. A serie containng dates
HighSerie ExcelRangeBase
The high price serie
LowSerie ExcelRangeBase
The low price serie
CloseSerie ExcelRangeBase
The close price serie containing
OpenSerie ExcelRangeBase
The opening price serie. Supplying this serie will create a StockOHLC or StockVOHLC chart
VolumeSerie ExcelRangeBase
The volume represented as a column chart. Supplying this serie will create a StockVHLC or StockVOHLC chart
Returns¶
The chart
AddStockChart(string, string, string, string, string, string, string)¶
Adds a new stock chart to the worksheet. The stock chart type will depend on if the parameters OpenSerie and/or VolumeSerie is supplied
public ExcelStockChart AddStockChart(string Name, string CategorySerie, string HighSerie, string LowSerie, string CloseSerie, string OpenSerie = null, string VolumeSerie = null)
Parameters¶
Name string
CategorySerie string
The category serie. A serie containing dates
HighSerie string
The high price serie
LowSerie string
The low price serie
CloseSerie string
The close price serie containing
OpenSerie string
The opening price serie. Supplying this serie will create a StockOHLC or StockVOHLC chart
VolumeSerie string
The volume represented as a column chart. Supplying this serie will create a StockVHLC or StockVOHLC chart
Returns¶
The chart
AddSunburstChart(string)¶
Adds a new sunburst chart to the worksheet.
Parameters¶
Name string
Returns¶
The chart
AddSurfaceChart(string, eSurfaceChartType, ExcelPivotTable)¶
Adds a new surface chart to the worksheet.
public ExcelSurfaceChart AddSurfaceChart(string Name, eSurfaceChartType ChartType, ExcelPivotTable PivotTableSource)
Parameters¶
Name string
ChartType eSurfaceChartType
Type of chart
PivotTableSource ExcelPivotTable
The pivottable source for a pivotchart
Returns¶
The chart
AddSurfaceChart(string, eSurfaceChartType)¶
Adds a new surface chart to the worksheet.
Parameters¶
Name string
ChartType eSurfaceChartType
Type of chart
Returns¶
The chart
AddTableSlicer(ExcelTableColumn)¶
Adds a slicer to a table column
Parameters¶
TableColumn ExcelTableColumn
The table column
Returns¶
The slicer drawing
AddTextbox(string, string)¶
Add a textbox to the worksheet
Parameters¶
Name string
text string
Returns¶
AddTreemapChart(string)¶
Adds a new treemap chart to the worksheet.
Parameters¶
Name string
Returns¶
The chart
AddWaterfallChart(string)¶
Adds a waterfall chart to the worksheet.
Parameters¶
Name string
Returns¶
The chart
Clear()¶
Removes all drawings from the collection
Dispose()¶
Disposes the object
Remove(int)¶
Removes a drawing.
Parameters¶
Index int
The index of the drawing
Remove(ExcelDrawing)¶
Removes a drawing.
Parameters¶
Drawing ExcelDrawing
The drawing
Remove(string)¶
Removes a drawing.
Parameters¶
Name string
The name of the drawing