/
excelscript.iconsetconditionalformat.yml
175 lines (170 loc) · 6.22 KB
/
excelscript.iconsetconditionalformat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
### YamlMime:TSType
name: ExcelScript.IconSetConditionalFormat
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat:interface'
package: ExcelScript!
fullName: ExcelScript.IconSetConditionalFormat
summary: Represents an icon set criteria for conditional formatting.
remarks: |-
#### Examples
```TypeScript
/**
* This script applies icon set conditional formatting to a range.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the range "A1:A5" on the current worksheet.
const sheet = workbook.getActiveWorksheet();
const range = sheet.getRange("A1:A5");
// Create icon set conditional formatting on the range.
const conditionalFormatting = range.addConditionalFormat(ExcelScript.ConditionalFormatType.iconSet);
const iconSetFormat: ExcelScript.IconSetConditionalFormat = conditionalFormatting.getIconSet();
// Use the "3 Traffic Lights (Unrimmed)" set.
iconSetFormat.setStyle(ExcelScript.IconSet.threeTrafficLights1);
// Set the criteria to use a different icon for the bottom, middle, and top thirds of the values in the range.
iconSetFormat.setCriteria([
{
formula:'=0',operator:ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
type:ExcelScript.ConditionalFormatIconRuleType.percent
},
{
formula:'=33',operator:ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
type:ExcelScript.ConditionalFormatIconRuleType.percent},
{
formula:'=67',operator:ExcelScript.ConditionalIconCriterionOperator.greaterThanOrEqual,
type:ExcelScript.ConditionalFormatIconRuleType.percent
}]);
}
```
isPreview: false
isDeprecated: false
type: interface
methods:
- name: getCriteria()
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#getCriteria:member(1)'
package: ExcelScript!
fullName: getCriteria()
summary: >-
An array of criteria and icon sets for the rules and potential custom icons for conditional icons. Note that for
the first criterion only the custom icon can be modified, while type, formula, and operator will be ignored when
set.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getCriteria(): ConditionalIconCriterion[];'
return:
type: '<xref uid="ExcelScript!ExcelScript.ConditionalIconCriterion:interface" />[]'
description: ''
- name: getReverseIconOrder()
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#getReverseIconOrder:member(1)'
package: ExcelScript!
fullName: getReverseIconOrder()
summary: >-
If `true`<!-- -->, reverses the icon orders for the icon set. Note that this cannot be set if custom icons are
used.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getReverseIconOrder(): boolean;'
return:
type: boolean
description: ''
- name: getShowIconOnly()
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#getShowIconOnly:member(1)'
package: ExcelScript!
fullName: getShowIconOnly()
summary: 'If `true`<!-- -->, hides the values and only shows icons.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getShowIconOnly(): boolean;'
return:
type: boolean
description: ''
- name: getStyle()
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#getStyle:member(1)'
package: ExcelScript!
fullName: getStyle()
summary: 'If set, displays the icon set option for the conditional format.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getStyle(): IconSet;'
return:
type: '<xref uid="ExcelScript!ExcelScript.IconSet:enum" />'
description: ''
- name: setCriteria(criteria)
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#setCriteria:member(1)'
package: ExcelScript!
fullName: setCriteria(criteria)
summary: >-
An array of criteria and icon sets for the rules and potential custom icons for conditional icons. Note that for
the first criterion only the custom icon can be modified, while type, formula, and operator will be ignored when
set.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'setCriteria(criteria: ConditionalIconCriterion[]): void;'
parameters:
- id: criteria
description: ''
type: '<xref uid="ExcelScript!ExcelScript.ConditionalIconCriterion:interface" />[]'
return:
type: void
description: ''
- name: setReverseIconOrder(reverseIconOrder)
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#setReverseIconOrder:member(1)'
package: ExcelScript!
fullName: setReverseIconOrder(reverseIconOrder)
summary: >-
If `true`<!-- -->, reverses the icon orders for the icon set. Note that this cannot be set if custom icons are
used.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'setReverseIconOrder(reverseIconOrder: boolean): void;'
parameters:
- id: reverseIconOrder
description: ''
type: boolean
return:
type: void
description: ''
- name: setShowIconOnly(showIconOnly)
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#setShowIconOnly:member(1)'
package: ExcelScript!
fullName: setShowIconOnly(showIconOnly)
summary: 'If `true`<!-- -->, hides the values and only shows icons.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'setShowIconOnly(showIconOnly: boolean): void;'
parameters:
- id: showIconOnly
description: ''
type: boolean
return:
type: void
description: ''
- name: setStyle(style)
uid: 'ExcelScript!ExcelScript.IconSetConditionalFormat#setStyle:member(1)'
package: ExcelScript!
fullName: setStyle(style)
summary: 'If set, displays the icon set option for the conditional format.'
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'setStyle(style: IconSet): void;'
parameters:
- id: style
description: ''
type: '<xref uid="ExcelScript!ExcelScript.IconSet:enum" />'
return:
type: void
description: ''