ExcelScript.ChartSeriesBy enum

Specifies whether the series are by rows or by columns. In Excel on desktop, the "auto" option will inspect the source data shape to automatically guess whether the data is by rows or columns. In Excel on the web, "auto" will simply default to "columns".

Remarks

Examples

/**
 * This script creates a clustered-column chart using an existing table.
 */
function main(workbook: ExcelScript.Workbook) {
    // Get the first table on the current worksheet.
    const sheet = workbook.getActiveWorksheet();
    const table = sheet.getTables()[0];

    // Add a clustered-column chart that clusters the data based on the columns in the table.
    const chart = sheet.addChart(
        ExcelScript.ChartType.columnClustered,
        table.getRange(),
        ExcelScript.ChartSeriesBy.columns
    );   
}

Fields

auto

In Excel on desktop, the "auto" option will inspect the source data shape to automatically guess whether the data is by rows or columns. In Excel on the web, "auto" will simply default to "columns".

columns
rows