Excel.Icon interface
Representa um ícone de célula.
Comentários
Conjunto de APIs: ExcelApi 1.2
Usada por
- Excel.Filter: applyIconFilter
- Excel.FilterCriteria: ícone
- Excel.CincoSetasCinzaDefinir: cinzaSeta para baixo,cinzaSeta para baixoInclinarSeta, cinzaSeta lateral, cinzaSeta para cima, cinzaSeta inclinada para cima
- Excel.FiveArrowsSeta: verdeSeta para cima, vermelhoSeta para baixo,amareloSeta inclinadapara baixo, Seta lateral, seta amarela para cimaInclineSeta
- Excel.FiveBoxesSet: fourFilledBoxes, noFilledBoxes, oneFilledBox, threeFilledBoxes, twoFilledBoxes
- Excel.FiveQuartersSet: pretoCírculo, círculoComUmBrancoQuarto, círculoComTrêsBrancoQuartos, círculoComDoisBrancoQuartos, brancoCírculoTodosBrancoQuartos
- Excel.FiveRatingSet: fourBars, noBars, oneBar, threeBars, twoBars
- Excel.FourArrowsGraySet: graySeta para baixo, cinzaSeta inclinada para baixo, seta para cima, seta para cima
- Excel.FourArrowsSet: greenUpArrow, redDownArrow, yellowDownInclineArrow, yellowUpInclineArrow
- Excel.FourRatingSet: fourBars, oneBar, threeBars, twoBars
- Excel.FourRedToBlackSet: blackCircle, grayCircle, pinkCircle, redCircle
- Excel.FourTrafficLightsSet: blackCircleWithBorder, greenCircle, redCircleWithBorder, yellowCircle
- Excel.SortField: ícone
- Excel.ThreeArrowsGraySet: grayDownArrow, graySideArrow, grayUpArrow
- Excel.ThreeArrowsSet: greenUpArrow, redDownArrow, yellowSideArrow
- Excel.ThreeFlagsSet: greenFlag, redFlag, yellowFlag
- Excel.ThreeSignsSet: verdeCírculo, vermelhoDiamante, amareloTriângulo
- Excel.ThreeStarsSet: goldStar, halfGoldStar, silverStar
- Excel.ThreeSymbols2Set: greenCheck, redCross, yellowExclamation
- Excel.ThreeSymbolsSet: greenCheckSymbol, redCrossSymbol, yellowExclamationSymbol
- Excel.ThreeTrafficLights1Set: greenCircle, redCircleWithBorder, yellowCircle
- Excel.ThreeTrafficLights2Set: verdeTrafficLight, vermelhoTrafficLight, amareloTrafficLight
- Excel.ThreeTrianglesSet: greenUpTriangle, redDownTriangle, yellowDash
Exemplos
// 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.iconSet);
const iconSetCF = conditionalFormat.iconSet;
iconSetCF.style = Excel.IconSet.threeTriangles;
/*
The iconSetCF.criteria array is automatically prepopulated with
criterion elements whose properties have been given default settings.
You can't write to each property of a criterion directly. Instead,
replace the whole criteria object.
With a "three*" icon set style, such as "threeTriangles", the third
element in the criteria array (criteria[2]) defines the "top" icon;
e.g., a green triangle. The second (criteria[1]) defines the "middle"
icon. The first (criteria[0]) defines the "low" icon, but it
can often be left empty as the following object shows, because every
cell that does not match the other two criteria always gets the low
icon.
*/
const lowIcon: Excel.Icon = {
set: Excel.IconSet.threeFlags,
index: 0
};
iconSetCF.criteria = [
{
customIcon: lowIcon
} as Excel.ConditionalIconCriterion,
{
type: Excel.ConditionalFormatIconRuleType.number,
operator: Excel.ConditionalIconCriterionOperator.greaterThanOrEqual,
formula: "=700"
},
{
type: Excel.ConditionalFormatIconRuleType.number,
operator: Excel.ConditionalIconCriterionOperator.greaterThanOrEqual,
formula: "=1000",
}
];
await context.sync();
});
Propriedades
| index | Especifica o índice do ícone no conjunto fornecido. |
| set | Especifica o conjunto do qual o ícone faz parte. |
Detalhes da propriedade
index
Especifica o índice do ícone no conjunto fornecido.
index: number;
Valor da propriedade
number
Comentários
set
Especifica o conjunto do qual o ícone faz parte.
set: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes";
Valor da propriedade
Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"