Excel.ChartTrendlineCollection class
グラフの近似曲線のコレクションを表します。
- Extends
注釈
プロパティ
context | オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。 |
items | このコレクション内に読み込まれた子アイテムを取得します。 |
メソッド
add(type) | 近似曲線のコレクションに新しい近似曲線を追加します。 |
add(type |
近似曲線のコレクションに新しい近似曲線を追加します。 |
get |
コレクションに含まれる近似曲線の数を返します。 |
get |
インデックスによって近似曲線オブジェクトを取得します。これは、items 配列の挿入順序です。 |
load(options) | オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
load(property |
オブジェクトの指定されたプロパティを読み込むコマンドを待ち行列に入れます。 プロパティを読み取る前に、 |
toJSON() | API オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript |
プロパティの詳細
context
オブジェクトに関連付けられている要求コンテキスト。 これにより、アドインのプロセスが Office ホスト アプリケーションのプロセスに接続されます。
context: RequestContext;
プロパティ値
items
メソッドの詳細
add(type)
近似曲線のコレクションに新しい近似曲線を追加します。
add(type?: Excel.ChartTrendlineType): Excel.ChartTrendline;
パラメーター
近似曲線の種類を指定します。 既定値は "Linear" です。 詳細は「Excel.ChartTrendline
」をご覧ください。
戻り値
注釈
例
// 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(typeString)
近似曲線のコレクションに新しい近似曲線を追加します。
add(typeString?: "Linear" | "Exponential" | "Logarithmic" | "MovingAverage" | "Polynomial" | "Power"): Excel.ChartTrendline;
パラメーター
- typeString
-
"Linear" | "Exponential" | "Logarithmic" | "MovingAverage" | "Polynomial" | "Power"
近似曲線の種類を指定します。 既定値は "Linear" です。 詳細は「Excel.ChartTrendline
」をご覧ください。
戻り値
注釈
getCount()
コレクションに含まれる近似曲線の数を返します。
getCount(): OfficeExtension.ClientResult<number>;
戻り値
OfficeExtension.ClientResult<number>
注釈
getItem(index)
インデックスによって近似曲線オブジェクトを取得します。これは、items 配列の挿入順序です。
getItem(index: number): Excel.ChartTrendline;
パラメーター
- index
-
number
items 配列内の挿入順序を表します。
戻り値
注釈
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 オブジェクトが に渡されたときにより便利な出力を提供するために、JavaScript toJSON()
メソッドを JSON.stringify()
オーバーライドします。 (JSON.stringify
さらに、渡される オブジェクトの メソッドを呼び出 toJSON
します)。元 Excel.ChartTrendlineCollection
のオブジェクトは API オブジェクトですが、 toJSON
メソッドは、コレクションの項目から読み込まれたプロパティの浅いコピーを含む "items" 配列を含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.ChartTrendlineCollectionData
型指定) を返します。
toJSON(): Excel.Interfaces.ChartTrendlineCollectionData;
戻り値
Office Add-ins
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示