[]
Adds one or more new series to the ISeriesCollection collection.
This overload automatically determines whether each series is created from rows or columns in the source range.
void Add(IRange source)
Sub Add(source As IRange)
| Type | Name | Description |
|---|---|---|
| IRange | source | The range that provides the source data for the new series. Must not be |
worksheet.Range["A1:C4"].Value = new object[,] {
{"Month", "Sales", "Profit"},
{"Jan", 100, 35},
{"Feb", 120, 40},
{"Mar", 140, 50}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 360, 220).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:C4"]);
Adds one or more new series to the ISeriesCollection collection.
Use rowCol to specify whether each series is created from rows or columns in the source range.
void Add(IRange source, RowCol rowCol)
Sub Add(source As IRange, rowCol As RowCol)
| Type | Name | Description |
|---|---|---|
| IRange | source | The range that provides the source data for the new series. Must not be |
| RowCol | rowCol | Specifies whether the source data is arranged by Rows or Columns. Must not be |
worksheet.Range["A1:C4"].Value = new object[,] {
{"Month", "Sales", "Profit"},
{"Jan", 100, 35},
{"Feb", 120, 40},
{"Mar", 140, 50}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 360, 220).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:C4"], RowCol.Columns);
Adds one or more series to this ISeriesCollection from the specified range.
Use rowCol to indicate whether each series is built from rows or columns in source. Use seriesLabels to indicate whether the first row or column contains series names, and use categoryLabels to indicate whether the first row or column contains category labels.
void Add(IRange source, RowCol rowCol, bool seriesLabels, bool categoryLabels)
Sub Add(source As IRange, rowCol As RowCol, seriesLabels As Boolean, categoryLabels As Boolean)
| Type | Name | Description |
|---|---|---|
| IRange | source | The range that provides the source data for the new series. |
| RowCol | rowCol | Specifies whether the source data is arranged by Rows or Columns. |
| bool | seriesLabels |
true
if the first row or column in source contains series names; otherwise, false.
|
| bool | categoryLabels |
true
if the first row or column in source contains category labels; otherwise, false.
|
worksheet.Range["A1:C4"].Value = new object[,] {
{"Month", "Sales", "Profit"},
{"Jan", 10, 4},
{"Feb", 12, 5},
{"Mar", 15, 6}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 360, 220).Chart;
chart.SeriesCollection.Add(worksheet.Range["A1:C4"], RowCol.Columns, true, true);