您好,
参考以下代码:
- sheet.setValue(0,0,0);
- sheet.setValue(1,0,0);
- sheet.setValue(2,0,3);
- sheet.setValue(3,0,-1);
- 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.threeArrowsColored);
- var icons = iconSetRule.icons();
- icons[0] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored, iconIndex: 0 };
- icons[1] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored, iconIndex: 1 };
- icons[2] = {iconSetType: GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeArrowsColored, iconIndex: 2 };
- var iconCriteria = iconSetRule.iconCriteria();
- iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 0);
- iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(false, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 0);
- sheet.conditionalFormats.addRule(iconSetRule);
复制代码
|