[]
Sheets.ConditionalFormatting.RuleType
规则类型
代码示例
// this example show how to set a rule type for NormalConditionRule.
activeSheet.setArray(0, 0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
activeSheet.setArray(0, 2, [1, 2, 3, 4, 5, 6, 5, 8, 1, 10]);
var greatThan = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
greatThan.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
greatThan.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
greatThan.value1(4);
greatThan.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
greatThan.style(style);
activeSheet.conditionalFormats.addRule(greatThan);
var unique = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
unique.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.uniqueRule);
unique.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
unique.value1(5);
unique.ranges([new GC.Spread.Sheets.Range(0, 2, 10, 1)]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "gold";
unique.style(style);
activeSheet.conditionalFormats.addRule(unique);
• averageRule = 8
平均规则
• cellValueRule = 1
单元格值规则
• columnStateRule = 15
列状态规则
• conditionRuleBase = 0
条件的基本规则
• dataBarRule = 12
数据条规则
• dateOccurringRule = 4
日期发生的规则
• duplicateRule = 7
重复规则
• formulaRule = 3
公式规则
• iconSetRule = 13
图标集规则
• rowStateRule = 14
行状态规则
• specificTextRule = 2
特定的文本规则
• threeScaleRule = 11
三色刻度规则
• top10Rule = 5
前10条规则
• twoScaleRule = 10
双色刻度规则
• uniqueRule = 6
唯一规则