Excel.ChartTrendlineCollection class

グラフの近似曲線のコレクションを表します。

Extends

プロパティ

context

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

items

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

メソッド

add(type)

近似曲線のコレクションに新しい近似曲線を追加します。

add(type)

近似曲線のコレクションに新しい近似曲線を追加します。

getCount()

コレクションに含まれる近似曲線の数を返します。

getItem(index)

近似曲線オブジェクトを items 配列内の広告掲載順序であるインデックスで取得します。

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

toJSON()

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

プロパティの詳細

context

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

context: RequestContext;

プロパティ値

items

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

readonly items: Excel.ChartTrendline[];

プロパティ値

メソッドの詳細

add(type)

近似曲線のコレクションに新しい近似曲線を追加します。

add(type?: Excel.ChartTrendlineType): Excel.ChartTrendline;

パラメーター

type
Excel.ChartTrendlineType

近似曲線の種類を指定します。 既定値は "Linear" です。 詳細は「Excel.ChartTrendline」をご覧ください。

返品

注釈

API セット: ExcelApi 1.7

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-trendlines.yaml

await Excel.run(async (context) => {
    const sheet = context.workbook.worksheets.getItem("Sample");

    let seriesCollection = sheet.charts.getItemAt(0).series;

     // Add a trendline.  
    seriesCollection.getItemAt(0).trendlines.add("Linear");

    await context.sync();
});

add(type)

近似曲線のコレクションに新しい近似曲線を追加します。

add(type?: "Linear" | "Exponential" | "Logarithmic" | "MovingAverage" | "Polynomial" | "Power"): Excel.ChartTrendline;

パラメーター

type

"Linear" | "Exponential" | "Logarithmic" | "MovingAverage" | "Polynomial" | "Power"

近似曲線の種類を指定します。 既定値は "Linear" です。 詳細は「Excel.ChartTrendline」をご覧ください。

返品

注釈

API セット: ExcelApi 1.7

getCount()

コレクションに含まれる近似曲線の数を返します。

getCount(): OfficeExtension.ClientResult<number>;

返品

注釈

API セット: ExcelApi 1.7

getItem(index)

近似曲線オブジェクトを items 配列内の広告掲載順序であるインデックスで取得します。

getItem(index: number): Excel.ChartTrendline;

パラメーター

index

number

items 配列内の広告掲載オーダーを表します。

返品

注釈

API セット: ExcelApi 1.7

load(options)

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

load(options?: Excel.Interfaces.ChartTrendlineCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartTrendlineCollection;

パラメーター

options

Excel.Interfaces.ChartTrendlineCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions

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

返品

load(propertyNames)

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

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

パラメーター

propertyNames

string | string[]

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

返品

load(propertyNamesAndPaths)

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

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

パラメーター

propertyNamesAndPaths
OfficeExtension.LoadOption

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

返品

toJSON()

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

toJSON(): Excel.Interfaces.ChartTrendlineCollectionData;

返品