ExcelChartCollection Class
Represents a collection of ExcelCharts in the worksheet or group.
public sealed class ExcelChartCollection : ExcelDrawingCollection<ExcelChart>, IList<ExcelChart>, ICollection<ExcelChart>, IEnumerable<ExcelChart>, IEnumerable
Public NotInheritable Class ExcelChartCollection
Inherits ExcelDrawingCollection(Of ExcelChart)
Implements IList(Of ExcelChart), ICollection(Of ExcelChart), IEnumerable(Of ExcelChart), IEnumerable
- Inheritance:
- System.ObjectExcelChartCollection
Implements
Methods
Add(ChartType, AnchorCell, AnchorCell)
Adds a new chart to the collection which moves and sizes with cells.
public ExcelChart Add(ChartType chartType, AnchorCell positionFrom, AnchorCell positionTo)
Public Function Add(chartType As ChartType, positionFrom As AnchorCell, positionTo As AnchorCell) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
positionFrom
- AnchorCell
The chart's position (top-left corner).
positionTo
- AnchorCell
The chart's end position (bottom-right corner).
Returns
A new chart added to the collection which moves and sizes with cells.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add(ChartType, AnchorCell, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public ExcelChart Add(ChartType chartType, AnchorCell positionFrom, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
positionFrom
- AnchorCell
The chart's position.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which moves but doesn't size with cells.
Remarks
Add(ChartType, ChartGrouping, AnchorCell, AnchorCell)
Adds a new chart to the collection which moves and sizes with cells.
public ExcelChart Add(ChartType chartType, ChartGrouping chartGrouping, AnchorCell positionFrom, AnchorCell positionTo)
Public Function Add(chartType As ChartType, chartGrouping As ChartGrouping, positionFrom As AnchorCell, positionTo As AnchorCell) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFrom
- AnchorCell
The chart's position (top-left corner).
positionTo
- AnchorCell
The chart's end position (bottom-right corner).
Returns
A new chart added to the collection which moves and sizes with cells.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add(ChartType, ChartGrouping, AnchorCell, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public ExcelChart Add(ChartType chartType, ChartGrouping chartGrouping, AnchorCell positionFrom, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, chartGrouping As ChartGrouping, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFrom
- AnchorCell
The chart's position.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which moves but doesn't size with cells.
Remarks
Add(ChartType, ChartGrouping, Double, Double, Double, Double, LengthUnit)
Adds a new chart to the collection which doesn't move nor sizes with cells.
public ExcelChart Add(ChartType chartType, ChartGrouping chartGrouping, double left, double top, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, chartGrouping As ChartGrouping, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
left
- System.Double
The distance of the left edge of the chart from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the chart from the top edge of the worksheet or group.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which doesn't move nor sizes with cells.
Remarks
Position.Mode of a newly added chart will be FreeFloating.
Add(ChartType, ChartGrouping, String, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public ExcelChart Add(ChartType chartType, ChartGrouping chartGrouping, string positionFromCell, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, chartGrouping As ChartGrouping, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFromCell
- System.String
The chart's position (for example, "A1").
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which moves but doesn't size with cells.
Remarks
Add(ChartType, ChartGrouping, String, String)
Adds a new chart to the collection which moves and sizes with cells.
public ExcelChart Add(ChartType chartType, ChartGrouping chartGrouping, string positionFromCell, string positionToCell)
Public Function Add(chartType As ChartType, chartGrouping As ChartGrouping, positionFromCell As String, positionToCell As String) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFromCell
- System.String
The chart's position (top-left corner) (for example, "A1").
positionToCell
- System.String
The chart's end position (bottom-right corner) (for example, "B2").
Returns
A new chart added to the collection which moves and sizes with cells.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add(ChartType, Double, Double, Double, Double, LengthUnit)
Adds a new chart to the collection which doesn't move nor sizes with cells.
public ExcelChart Add(ChartType chartType, double left, double top, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
left
- System.Double
The distance of the left edge of the chart from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the chart from the top edge of the worksheet or group.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which doesn't move nor sizes with cells.
Remarks
Position.Mode of a newly added chart will be FreeFloating.
Add(ChartType, String, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public ExcelChart Add(ChartType chartType, string positionFromCell, double width, double height, LengthUnit unit)
Public Function Add(chartType As ChartType, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
positionFromCell
- System.String
The chart's position (for example, "A1").
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
A new chart added to the collection which moves but doesn't size with cells.
Remarks
Add(ChartType, String, String)
Adds a new chart to the collection which moves and sizes with cells.
public ExcelChart Add(ChartType chartType, string positionFromCell, string positionToCell)
Public Function Add(chartType As ChartType, positionFromCell As String, positionToCell As String) As ExcelChart
Parameters
chartType
- ChartType
Type of the chart.
positionFromCell
- System.String
The chart's position (top-left corner) (for example, "A1").
positionToCell
- System.String
The chart's end position (bottom-right corner) (for example, "B2").
Returns
A new chart added to the collection which moves and sizes with cells.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add<T>(AnchorCell, AnchorCell)
Adds a new chart to the collection which moves and sizes with cells.
public T Add<T>(AnchorCell positionFrom, AnchorCell positionTo)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(positionFrom As AnchorCell, positionTo As AnchorCell) As T
Parameters
positionFrom
- AnchorCell
The chart's position (top-left corner).
positionTo
- AnchorCell
The chart's end position (bottom-right corner).
Returns
- T
A new chart added to the collection which moves and sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add<T>(AnchorCell, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public T Add<T>(AnchorCell positionFrom, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As T
Parameters
positionFrom
- AnchorCell
The chart's position.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which moves but doesn't size with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Add<T>(ChartGrouping, AnchorCell, AnchorCell)
Adds a new chart to the collection which moves and sizes with cells.
public T Add<T>(ChartGrouping chartGrouping, AnchorCell positionFrom, AnchorCell positionTo)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(chartGrouping As ChartGrouping, positionFrom As AnchorCell, positionTo As AnchorCell) As T
Parameters
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFrom
- AnchorCell
The chart's position (top-left corner).
positionTo
- AnchorCell
The chart's end position (bottom-right corner).
Returns
- T
A new chart added to the collection which moves and sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add<T>(ChartGrouping, AnchorCell, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public T Add<T>(ChartGrouping chartGrouping, AnchorCell positionFrom, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(chartGrouping As ChartGrouping, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As T
Parameters
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFrom
- AnchorCell
The chart's position.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which moves but doesn't size with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Add<T>(ChartGrouping, Double, Double, Double, Double, LengthUnit)
Adds a new chart to the collection which doesn't move nor sizes with cells.
public T Add<T>(ChartGrouping chartGrouping, double left, double top, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(chartGrouping As ChartGrouping, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As T
Parameters
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
left
- System.Double
The distance of the left edge of the chart from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the chart from the top edge of the worksheet or group.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which doesn't move nor sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be FreeFloating.
Add<T>(ChartGrouping, String, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public T Add<T>(ChartGrouping chartGrouping, string positionFromCell, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(chartGrouping As ChartGrouping, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As T
Parameters
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFromCell
- System.String
The chart's position (for example, "A1").
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which moves but doesn't size with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Add<T>(ChartGrouping, String, String)
Adds a new chart to the collection which moves and sizes with cells.
public T Add<T>(ChartGrouping chartGrouping, string positionFromCell, string positionToCell)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(chartGrouping As ChartGrouping, positionFromCell As String, positionToCell As String) As T
Parameters
chartGrouping
- ChartGrouping
The chart's series grouping (clustered, stacked or 100% stacked).
positionFromCell
- System.String
The chart's position (top-left corner) (for example, "A1").
positionToCell
- System.String
The chart's end position (bottom-right corner) (for example, "B2").
Returns
- T
A new chart added to the collection which moves and sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Add<T>(Double, Double, Double, Double, LengthUnit)
Adds a new chart to the collection which doesn't move nor sizes with cells.
public T Add<T>(double left, double top, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As T
Parameters
left
- System.Double
The distance of the left edge of the chart from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the chart from the top edge of the worksheet or group.
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which doesn't move nor sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be FreeFloating.
Add<T>(String, Double, Double, LengthUnit)
Adds a new chart to the collection which moves but doesn't size with cells.
public T Add<T>(string positionFromCell, double width, double height, LengthUnit unit)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As T
Parameters
positionFromCell
- System.String
The chart's position (for example, "A1").
width
- System.Double
The chart's width.
height
- System.Double
The chart's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
Returns
- T
A new chart added to the collection which moves but doesn't size with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Add<T>(String, String)
Adds a new chart to the collection which moves and sizes with cells.
public T Add<T>(string positionFromCell, string positionToCell)
where T : ExcelChart
Public Function Add(Of T As ExcelChart)(positionFromCell As String, positionToCell As String) As T
Parameters
positionFromCell
- System.String
The chart's position (top-left corner) (for example, "A1").
positionToCell
- System.String
The chart's end position (bottom-right corner) (for example, "B2").
Returns
- T
A new chart added to the collection which moves and sizes with cells.
Type Parameters
T
The type of the chart deriving from ExcelChart type.
Remarks
Position.Mode of a newly added chart will be MoveAndSize.
Get<T>(Int32)
Gets the chart at the specified index and casts it to the specified chart subtype deriving from ExcelChart.
public T Get<T>(int index)
where T : ExcelChart
Public Function Get(Of T As ExcelChart)(index As Integer) As T
Parameters
index
- System.Int32
The zero-based index of the chart to get.
Returns
- T
The chart at the specified index casted to T
type.
Type Parameters
T
The chart subtype deriving from ExcelChart to cast the chart to.
Remarks
This method serves as a utility method for casting.
Exceptions
- System.ArgumentOutOfRangeException
index
is less than 0 or is equal to or greater than Count.
- System.InvalidCastException
A chart at the specified index cannot be cast to type T
.