Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Excel.ConditionalColorScaleCriteria interface
- Package:
- excel
Represents the criteria of the color scale.
Remarks
Used by
Examples
// 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();
});
Properties
| maximum | The maximum point of the color scale criterion. |
| midpoint | The midpoint of the color scale criterion, if the color scale is a 3-color scale. |
| minimum | The minimum point of the color scale criterion. |
Property Details
maximum
The maximum point of the color scale criterion.
maximum: Excel.ConditionalColorScaleCriterion;
Property Value
Remarks
midpoint
The midpoint of the color scale criterion, if the color scale is a 3-color scale.
midpoint?: Excel.ConditionalColorScaleCriterion;
Property Value
Remarks
minimum
The minimum point of the color scale criterion.
minimum: Excel.ConditionalColorScaleCriterion;
Property Value
Remarks
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
