Excel.ChartDataTableFormat class

グラフ データ テーブルの形式を表します。

Extends

注釈

[ API セット: ExcelApi 1.14 ]

プロパティ

border

色、線のスタイル、太さを含むグラフ データ テーブルの罫線の形式を表します。

context

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

fill

背景の書式設定情報を含む、オブジェクトの塗りつぶしの書式を表します。

font

現在のオブジェクトのフォント属性 (フォント名、フォント サイズ、色など) を表します。

メソッド

load(options)

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

load(propertyNames)

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

load(propertyNamesAndPaths)

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

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

toJSON()

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

プロパティの詳細

border

色、線のスタイル、太さを含むグラフ データ テーブルの罫線の形式を表します。

readonly border: Excel.ChartBorder;

プロパティ値

注釈

[ API セット: ExcelApi 1.14 ]

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

// This function adjusts the display and format of a chart data table that already exists on the worksheet.
await Excel.run(async (context) => {
  // Retrieve the chart named "SalesChart" from the "Sample" worksheet.
  const chart = context.workbook.worksheets.getItem("Sample").charts.getItem("SalesChart");

  // Get the chart data table object and load its properties.
  const chartDataTable = chart.getDataTableOrNullObject();
  chartDataTable.load();

  // Set the display properties of the chart data table.
  chartDataTable.showLegendKey = true;
  chartDataTable.showHorizontalBorder = false;
  chartDataTable.showVerticalBorder = true;
  chartDataTable.showOutlineBorder = true;

  // Retrieve the chart data table format object and set font and border properties. 
  const chartDataTableFormat = chartDataTable.format;
  chartDataTableFormat.font.color = "#B76E79";
  chartDataTableFormat.font.name = "Comic Sans";
  chartDataTableFormat.border.color = "blue";
  await context.sync();
});

context

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

context: RequestContext;

プロパティ値

fill

背景の書式設定情報を含む、オブジェクトの塗りつぶしの書式を表します。

readonly fill: Excel.ChartFill;

プロパティ値

注釈

[ API セット: ExcelApi 1.14 ]

font

現在のオブジェクトのフォント属性 (フォント名、フォント サイズ、色など) を表します。

readonly font: Excel.ChartFont;

プロパティ値

注釈

[ API セット: ExcelApi 1.14 ]

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

// This function adjusts the display and format of a chart data table that already exists on the worksheet.
await Excel.run(async (context) => {
  // Retrieve the chart named "SalesChart" from the "Sample" worksheet.
  const chart = context.workbook.worksheets.getItem("Sample").charts.getItem("SalesChart");

  // Get the chart data table object and load its properties.
  const chartDataTable = chart.getDataTableOrNullObject();
  chartDataTable.load();

  // Set the display properties of the chart data table.
  chartDataTable.showLegendKey = true;
  chartDataTable.showHorizontalBorder = false;
  chartDataTable.showVerticalBorder = true;
  chartDataTable.showOutlineBorder = true;

  // Retrieve the chart data table format object and set font and border properties. 
  const chartDataTableFormat = chartDataTable.format;
  chartDataTableFormat.font.color = "#B76E79";
  chartDataTableFormat.font.name = "Comic Sans";
  chartDataTableFormat.border.color = "blue";
  await context.sync();
});

メソッドの詳細

load(options)

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

load(options?: Excel.Interfaces.ChartDataTableFormatLoadOptions): Excel.ChartDataTableFormat;

パラメーター

options
Excel.Interfaces.ChartDataTableFormatLoadOptions

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

戻り値

load(propertyNames)

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

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

パラメーター

propertyNames

string | string[]

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

戻り値

load(propertyNamesAndPaths)

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

load(propertyNamesAndPaths?: {
            select?: string;
            expand?: string;
        }): Excel.ChartDataTableFormat;

パラメーター

propertyNamesAndPaths

{ select?: string; expand?: string; }

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

戻り値

set(properties, options)

オブジェクトの複数のプロパティを同時に設定します。 適切なプロパティを持つプレーン オブジェクトまたは同じ型の別の API オブジェクトを渡すことができます。

set(properties: Interfaces.ChartDataTableFormatUpdateData, options?: OfficeExtension.UpdateOptions): void;

パラメーター

properties
Excel.Interfaces.ChartDataTableFormatUpdateData

メソッドが呼び出されるオブジェクトのプロパティに等形的に構造化されたプロパティを持つ JavaScript オブジェクト。

options
OfficeExtension.UpdateOptions

properties オブジェクトが読み取り専用プロパティを設定しようとした場合にエラーを抑制するオプションを提供します。

戻り値

void

set(properties)

既存の読み込まれたオブジェクトに基づいて、オブジェクトに複数のプロパティを同時に設定します。

set(properties: Excel.ChartDataTableFormat): void;

パラメーター

戻り値

void

toJSON()

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

toJSON(): Excel.Interfaces.ChartDataTableFormatData;

戻り値