IconSet Klasse
IconSet Klasse
Beschreiben Sie die bedingte Formatierungsregel IconSet. Diese bedingte Formatierungsregel wendet Symbole auf Zellen an nach ihren Werten.
Der Typ IconSet macht die folgenden Member verfügbar:
Eigenschaften
Eigentum | Beschreibung |
---|---|
cf_icons | Holen Sie sich die ConditionalFormattingIcon aus der Kollektion |
cfvos | Rufen Sie die CFValueObjects-Instanz ab. |
type | Rufen Sie den anzuzeigenden Symbolsatztyp ab oder legen Sie ihn fest. Durch Festlegen des Typs wird automatisch überprüft, ob die aktuelle Cfvos-Anzahl vorhanden ist im Einklang mit dem neuen Typ. Bei Nichteinhaltung werden alte Cfvos bereinigt und Standard-Cfvos werden hinzugefügt. |
is_custom | Gibt an, ob der Symbolsatz benutzerdefiniert ist. Der Standardwert ist falsch. |
show_value | Rufen Sie das Flag ab, das angibt, ob die Werte der Zellen angezeigt werden sollen, auf die dieser Symbolsatz angewendet wird, oder legen Sie es fest. Der Standardwert ist wahr. |
reverse | Rufen Sie das Flag ab, das angibt, ob die Standardreihenfolge der Symbole in diesem Symbolsatz umgekehrt werden soll, oder legen Sie es fest. Der Standardwert ist falsch. |
Beispiel
from aspose.cells import CellArea, FormatConditionType, IconSetType, Workbook
# Instantiating a Workbook object
workbook = Workbook()
sheet = workbook.worksheets[0]
# Adds an empty conditional formatting
index = sheet.conditional_formattings.add()
fcs = sheet.conditional_formattings[index]
# Sets the conditional format range.
ca = CellArea()
ca.start_row = 0
ca.end_row = 2
ca.start_column = 0
ca.end_column = 0
fcs.add_area(ca)
# Adds condition.
idx = fcs.add_condition(FormatConditionType.ICON_SET)
fcs.add_area(ca)
cond = fcs[idx]
# Get Icon Set
iconSet = cond.icon_set
# Set Icon Type
iconSet.type = IconSetType.ARROWS3
# Put Cell Values
cell1 = sheet.cells.get("A1")
cell1.put_value(10)
cell2 = sheet.cells.get("A2")
cell2.put_value(120)
cell3 = sheet.cells.get("A3")
cell3.put_value(260)
# Saving the Excel file
workbook.save("book1.xlsx")
Siehe auch
- Modul
aspose.cells
- Klasse
ConditionalFormattingIcon