Page tree
Skip to end of metadata
Go to start of metadata

Description

The SeriesCollection class contains the set of data series in a given chart.

C#
vb.net

Remarks

To return a SeriesCollection object, use Chart.SeriesCollection.

A SeriesCollection is made up all of the series in a chart. These series may be of the same type or a different type from the chart itself; a chart may contain series of multiple ChartTypes on different axes. However, not all series configurations are valid.

Surface, bubble, and 3D series may not be combined on a chart with series of a different ChartCategory. For example, a Bubble chart may contain both 2D and 3D Bubble series, but may not contain any Line series. Similarly, a 3D Area chart may contain 3D area series, but may not contain any other series types. Additionally, these chart types may not have any series on the Secondary axis.

Pie, Doughnut, Bar, and Radar charts can be combined with series of other chart categories, but only if the other series is on a different axis. For example, a bar series on the primary axis can be in the same chart as a column series on the secondary axis, but it cannot be in the same chart as a column series on the primary axis.

If you attempt to create a series that would violate these constraints, or change a series configuration such that these constraints would no longer be followed, then an ArgumentException will be thrown.

A last consideration is that for all series types except for Bubble and Pie series, series within the same ChartCategory cannot coexist on the same axis. If you add a series to an axis that already has series of the same ChartCategory but different ChartType, the existing series will be converted to the new ChartType. For example, if you have a StandardLine series on the primary axis, and you create a new StackedLine series on the primary axis, both series will now be StackedLine series. If you had added it to the secondary axis, however, then you would have one StandardLine series on the primary axis, and one StackedLine series on the secondary axis.

Properties

Name

Description

CategoryData

Sets or Returns a formula referencing a range of cells (e.g. "A1:A5"). The values in these cells are used for the labels on the primary category (x) axis of the chart. For scatter and bubble charts, this property will return an empty string. To get the values used on the horizontal axis for a scatter or bubble series, use Series.ScatterValues instead.

Count

Returns the number of data series in the collection.

SecondaryCategoryData

Sets or Returns a formula referencing a range of cells (e.g. "A1:A5"). The values in these cells are used for the labels on the secondary category (x) axis of the chart.

Indexers

Name

Description

Item(Int32)

Returns the Series at the specified index.

Methods

Name

Description

CreateSeries(Area)

Creates a new Series that is automatically added to the SeriesCollection. The series will be plotted on the primary axis, and its type will be the chart's ChartType.

CreateSeries(Area, ChartType, AxisType)

Creates a new Series that is automatically added to the SeriesCollection.

CreateSeries(Range)

Creates a new Series that is automatically added to the SeriesCollection. The series will be plotted on the primary axis, and its type will be the chart's ChartType.

CreateSeries(Range, ChartType, AxisType)

Creates a new Series that is automatically added to the SeriesCollection.

CreateSeries(String)

Creates a new Series that is automatically added to the SeriesCollection. The series will be plotted on the primary axis, and its type will be the chart's ChartType.

CreateSeries(String, ChartType, AxisType)

Creates a new Series that is automatically added to the SeriesCollection.

GetEnumerator()

Returns an IEnumerator for the SeriesCollection of a Chart

Remove(Int32)

Removes the specified Series from the collection.

Remove(Series)

Removes the specified Series from the collection.
  • No labels