[]
Gets the IChartGroup object at the specified index in the collection.
Use this property to access an individual chart group from the IChartGroups collection returned by ChartGroups.
IChartGroup this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IChartGroup
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the chart group to retrieve. |
worksheet.Range["A1:C4"].Value = new object[,] {
{"Month", "Sales", "Target"},
{"Jan", 10, 12},
{"Feb", 20, 18},
{"Mar", 15, 16}
};
IChart chart = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 20, 20, 300, 200).Chart;
chart.SeriesCollection.Add(worksheet.Range["B1:C4"]);
chart.SeriesCollection[1].ChartType = ChartType.Line;
IChartGroup chartGroup = chart.ChartGroups[0];