Adds a new chart to the collection. The data source range of the chart is specified as the dataSourceRange parameter.
The chart series are automatically generated from the the data source. The location and the size of the chart
inside the worksheet are specified by the left column, top row, right column and bottom row parameters.
| C# | Visual Basic | Visual C++ |
public ExcelChart AddChart( ExcelChartType chartType, ExcelRange dataSourceRange, bool seriesByRows, int leftColumnIndex, int topRowIndex, int rightColumnIndex, int bottomRowIndex )
Public Function AddChart ( _ chartType As ExcelChartType, _ dataSourceRange As ExcelRange, _ seriesByRows As Boolean, _ leftColumnIndex As Integer, _ topRowIndex As Integer, _ rightColumnIndex As Integer, _ bottomRowIndex As Integer _ ) As ExcelChart
public: ExcelChart^ AddChart( ExcelChartType chartType, ExcelRange^ dataSourceRange, bool seriesByRows, int leftColumnIndex, int topRowIndex, int rightColumnIndex, int bottomRowIndex )
- chartType (ExcelChartType)
- The chart type
- dataSourceRange (ExcelRange)
- The data source range of the chart
- seriesByRows (Boolean)
- When this parameter is true the chart series will be created from range rows, otherwise the chart series will be created from range columns.
- leftColumnIndex (Int32)
- The one based left column index of the chart area in the worksheet. The left column is included in the chart area.
- topRowIndex (Int32)
- The one based top row index of the chart area in the worksheet. The top row is included in the chart area.
- rightColumnIndex (Int32)
- The one based right column index of the chart area in the worksheet. The right column is not included in the chart area.
- bottomRowIndex (Int32)
- The one based bottom row index of the chart area in the worksheet. The bottom row is not included in the chart area.
The newly created chart