Excel.ConditionalColorScaleCriterion interface
種類、値、および色を含むカラー スケールの条件を表します。
注釈
使用元
例
// 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("B2:M5");
const conditionalFormat = range.conditionalFormats
.add(Excel.ConditionalFormatType.colorScale);
const criteria = {
minimum: { formula: null, type: Excel.ConditionalFormatColorCriterionType.lowestValue, color: "blue" },
midpoint: { formula: "50", type: Excel.ConditionalFormatColorCriterionType.percent, color: "yellow" },
maximum: { formula: null, type: Excel.ConditionalFormatColorCriterionType.highestValue, color: "red" }
};
conditionalFormat.colorScale.criteria = criteria;
await context.sync();
});
プロパティ
| color | カラー スケール色の HTML カラー コード表現 (例: #FF0000 は赤を表します)。 |
| formula | 数値、数式、または |
| type | 条件の条件付き数式の基準となるもの。 |
プロパティの詳細
color
カラー スケール色の HTML カラー コード表現 (例: #FF0000 は赤を表します)。
color?: string;
プロパティ値
string
注釈
formula
type
条件の条件付き数式の基準となるもの。
type: Excel.ConditionalFormatColorCriterionType | "Invalid" | "LowestValue" | "HighestValue" | "Number" | "Percent" | "Formula" | "Percentile";
プロパティ値
Excel.ConditionalFormatColorCriterionType | "Invalid" | "LowestValue" | "HighestValue" | "Number" | "Percent" | "Formula" | "Percentile"