Excel.ChartSeriesCollection class

グラフ系列のコレクションを表します。

Extends

注釈

[ API セット: ExcelApi 1.1 ]

プロパティ

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

count

コレクションに含まれるデータ系列の数を返します。

items

このコレクション内に読み込まれた子アイテムを取得します。

メソッド

getItemAt(index)

コレクション内の位置に基づいてデータ系列を取得します。

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元 Excel.ChartSeriesCollection のオブジェクトは API オブジェクトですが、 toJSON メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.ChartSeriesCollectionData型指定) を返します。

プロパティの詳細

context

オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。

context: RequestContext;

プロパティ値

count

コレクションに含まれるデータ系列の数を返します。

readonly count: number;

プロパティ値

number

注釈

[ API セット: ExcelApi 1.1 ]

items

このコレクション内に読み込まれた子アイテムを取得します。

readonly items: Excel.ChartSeries[];

プロパティ値

メソッドの詳細

getItemAt(index)

コレクション内の位置に基づいてデータ系列を取得します。

getItemAt(index: number): Excel.ChartSeries;

パラメーター

index

number

取得するオブジェクトのインデックス値。 0 を起点とする番号になります。

戻り値

注釈

[ API セット: ExcelApi 1.1 ]

// Get the name of the first series in the series collection.
await Excel.run(async (context) => { 
    const seriesCollection = context.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1").series;
    seriesCollection.load('items');
    await context.sync();
    
    console.log(seriesCollection.items[0].name);
});

load(options)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(options?: Excel.Interfaces.ChartSeriesCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartSeriesCollection;

パラメーター

options

Excel.Interfaces.ChartSeriesCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions

読み込むオブジェクトのプロパティのオプションを提供します。

戻り値

load(propertyNames)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNames?: string | string[]): Excel.ChartSeriesCollection;

パラメーター

propertyNames

string | string[]

読み込むプロパティを指定するコンマ区切り文字列または文字列の配列。

戻り値

// Get the number of chart series in the collection.
await Excel.run(async (context) => { 
    const seriesCollection = context.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1").series;
    seriesCollection.load('count');
    await context.sync();

    console.log("series: Count= " + seriesCollection.count);
});

load(propertyNamesAndPaths)

オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、context.sync() を呼び出す必要があります。

load(propertyNamesAndPaths?: OfficeExtension.LoadOption): Excel.ChartSeriesCollection;

パラメーター

propertyNamesAndPaths
OfficeExtension.LoadOption

propertyNamesAndPaths.select は、読み込むプロパティを指定するコンマ区切り文字列で propertyNamesAndPaths.expand 、読み込むナビゲーション プロパティを指定するコンマ区切りの文字列です。

戻り値

toJSON()

API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON() メソッドを JSON.stringify()オーバーライドします。 (JSON.stringifyさらに、渡される オブジェクトの メソッドを呼び出 toJSON します)。元 Excel.ChartSeriesCollection のオブジェクトは API オブジェクトですが、 toJSON メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.ChartSeriesCollectionData型指定) を返します。

toJSON(): Excel.Interfaces.ChartSeriesCollectionData;

戻り値