Excel.DataBarConditionalFormat class

Excel の条件付きデータ バーの種類を表します。

Extends

注釈

[ API セット: ExcelApi 1.6 ]

プロパティ

axisColor

軸の線の色を表す HTML 色コード(例: "FFA500")、または名前付き HTML カラー (例: "オレンジ") として #RRGGBB。 軸が存在しない場合、または設定されていない場合、値は "" (空の文字列) です。

axisFormat

Excel データ バーの軸の決定方法を表します。

barDirection

データ バー グラフィックの基になる方向を指定します。

context

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

lowerBoundRule

データ バーの下限 (および該当する場合はその計算方法) を構成するルール。 オブジェクトは ConditionalDataBarRule JSON オブジェクトとして設定する必要があります (の代わりに x.lowerBoundRule.formula = ...を使用x.lowerBoundRule = {...}します)。

negativeFormat

Excel データ バーの軸の左側にあるすべての値を表します。

positiveFormat

Excel データ バーの軸の右側にあるすべての値を表します。

showDataBarOnly

の場合 true、データ バーが適用されているセルの値が非表示になります。

upperBoundRule

データ バーの上限値 (および該当する場合はその計算方法) を構成するルール。 オブジェクトは ConditionalDataBarRule JSON オブジェクトとして設定する必要があります (の代わりに x.upperBoundRule.formula = ...を使用x.upperBoundRule = {...}します)。

メソッド

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.DataBarConditionalFormat オブジェクトは API オブジェクトですが、メソッドは、元の toJSON オブジェクトから読み込まれた子プロパティの浅いコピーを含むプレーンな JavaScript オブジェクト (として Excel.Interfaces.DataBarConditionalFormatData型指定) を返します。

プロパティの詳細

axisColor

軸の線の色を表す HTML 色コード(例: "FFA500")、または名前付き HTML カラー (例: "オレンジ") として #RRGGBB。 軸が存在しない場合、または設定されていない場合、値は "" (空の文字列) です。

axisColor: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.6 ]

axisFormat

Excel データ バーの軸の決定方法を表します。

axisFormat: Excel.ConditionalDataBarAxisFormat | "Automatic" | "None" | "CellMidPoint";

プロパティ値

Excel.ConditionalDataBarAxisFormat | "Automatic" | "None" | "CellMidPoint"

注釈

[ API セット: ExcelApi 1.6 ]

barDirection

データ バー グラフィックの基になる方向を指定します。

barDirection: Excel.ConditionalDataBarDirection | "Context" | "LeftToRight" | "RightToLeft";

プロパティ値

Excel.ConditionalDataBarDirection | "Context" | "LeftToRight" | "RightToLeft"

注釈

[ API セット: ExcelApi 1.6 ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/14-conditional-formatting/conditional-formatting-basic.yaml

await Excel.run(async (context) => {
    const sheet = context.workbook.worksheets.getItem("Sample");
    const range = sheet.getRange("B8:E13");
    const conditionalFormat = range.conditionalFormats
        .add(Excel.ConditionalFormatType.dataBar);
    conditionalFormat.dataBar.barDirection = Excel.ConditionalDataBarDirection.leftToRight;

    await context.sync();
});

context

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

context: RequestContext;

プロパティ値

lowerBoundRule

データ バーの下限 (および該当する場合はその計算方法) を構成するルール。 オブジェクトは ConditionalDataBarRule JSON オブジェクトとして設定する必要があります (の代わりに x.lowerBoundRule.formula = ...を使用x.lowerBoundRule = {...}します)。

lowerBoundRule: Excel.ConditionalDataBarRule;

プロパティ値

注釈

[ API セット: ExcelApi 1.6 ]

negativeFormat

Excel データ バーの軸の左側にあるすべての値を表します。

readonly negativeFormat: Excel.ConditionalDataBarNegativeFormat;

プロパティ値

注釈

[ API セット: ExcelApi 1.6 ]

positiveFormat

Excel データ バーの軸の右側にあるすべての値を表します。

readonly positiveFormat: Excel.ConditionalDataBarPositiveFormat;

プロパティ値

注釈

[ API セット: ExcelApi 1.6 ]

showDataBarOnly

の場合 true、データ バーが適用されているセルの値が非表示になります。

showDataBarOnly: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.6 ]

upperBoundRule

データ バーの上限値 (および該当する場合はその計算方法) を構成するルール。 オブジェクトは ConditionalDataBarRule JSON オブジェクトとして設定する必要があります (の代わりに x.upperBoundRule.formula = ...を使用x.upperBoundRule = {...}します)。

upperBoundRule: Excel.ConditionalDataBarRule;

プロパティ値

注釈

[ API セット: ExcelApi 1.6 ]

メソッドの詳細

load(options)

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

load(options?: Excel.Interfaces.DataBarConditionalFormatLoadOptions): Excel.DataBarConditionalFormat;

パラメーター

options
Excel.Interfaces.DataBarConditionalFormatLoadOptions

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

戻り値

load(propertyNames)

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

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

パラメーター

propertyNames

string | string[]

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

戻り値

load(propertyNamesAndPaths)

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

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

パラメーター

propertyNamesAndPaths

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

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

戻り値

set(properties, options)

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

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

パラメーター

properties
Excel.Interfaces.DataBarConditionalFormatUpdateData

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

options
OfficeExtension.UpdateOptions

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

戻り値

void

set(properties)

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

set(properties: Excel.DataBarConditionalFormat): void;

パラメーター

戻り値

void

toJSON()

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

toJSON(): Excel.Interfaces.DataBarConditionalFormatData;

戻り値