跳到主要内容

SetReverseOrder

指定图标集规则中的图标顺序是否反转。

语法

expression.SetReverseOrder(reverse);

expression - 表示 ApiIconSetCondition 类的变量。

参数

名称必需/可选数据类型默认值描述
reverse必需boolean为 true 时反转图标顺序,否则为 false。

返回值

boolean

示例

此示例演示如何反转图标顺序显示。

// How to change the display order of icons in icon set formatting.

// Reverse the order in which icons are displayed.

let worksheet = Api.GetActiveSheet();

worksheet.GetRange("A1").SetValue("Ratings");
worksheet.GetRange("A2").SetValue(5);
worksheet.GetRange("A3").SetValue(3);
worksheet.GetRange("A4").SetValue(1);

let range = worksheet.GetRange("A2:A4");
let formatConditions = range.GetFormatConditions();
let iconCondition = formatConditions.AddIconSetCondition();

worksheet.GetRange("B1").SetValue("Before: Normal icon order");
iconCondition.SetReverseOrder(true);
worksheet.GetRange("B2").SetValue("After: Reversed icon order");