[]
        
(Showing Draft Content)

GC.Spread.Sheets.ConditionalFormatting.IconCriterion

类: IconCriterion

Sheets.ConditionalFormatting.IconCriterion

Table of contents

构造方法

构造方法

constructor

new IconCriterion(isGreaterThanOrEqualTo, iconValueType, iconValue)

带有指定参数的图标条件

代码示例

//本示例创建一个图标规则
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,15,3);
activeSheet.setValue(2,0,25,3);
activeSheet.setValue(3,0,-1,3);
//rule
var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule();
iconSetRule.ranges([new GC.Spread.Sheets.Range(0,0,4,1)]);
iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.fourTrafficLights);
var iconCriteria = iconSetRule.iconCriteria();
iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 1);
iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 10);
iconCriteria[2] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 20);
iconSetRule.reverseIconOrder(false);
iconSetRule.showIconOnly(false);
activeSheet.conditionalFormats.addRule(iconSetRule);

参数

属性名 类型 说明
isGreaterThanOrEqualTo boolean 如果设置为true,则使用大于或等于运算符来计算值
iconValueType IconValueType 刻度值的类型
iconValue Object 刻度值