SpreadJS Documentation
IconCriterion Constructor
If set to true, use the greater than or equal to operator to calculate the value.
The type of scale value.
The scale value.
Represents an icon criteria with the specified parameters.
Syntax
var instance = new GcSpread.Sheets.IconCriterion(isGreaterThanOrEqualTo, iconValueType, iconValue);
function IconCriterion( 
   isGreaterThanOrEqualTo : boolean,
   iconValueType : IconValueType,
   iconValue : object
) : IconCriterion;

Parameters

isGreaterThanOrEqualTo
If set to true, use the greater than or equal to operator to calculate the value.
iconValueType
The type of scale value.
iconValue
The scale value.
Example
This example creates an icon rule.
activeSheet.setValue(0,0,1,3);
activeSheet.setValue(1,0,15,3);
activeSheet.setValue(2,0,25,3);
activeSheet.setValue(3,0,-1,3);

var cfs = activeSheet.getConditionalFormats();
var iconSetRule = new GcSpread.Sheets.IconSetRule();
iconSetRule.ranges =[new GcSpread.Sheets.Range(0,0,4,1)];
iconSetRule.iconSetType(GcSpread.Sheets.IconSetType.FourTrafficLights);
var iconCriteria = iconSetRule.iconCriteria();
iconCriteria[0] = new GcSpread.Sheets.IconCriterion(true, GcSpread.Sheets.IconValueType.Number, 1);
iconCriteria[1] = new GcSpread.Sheets.IconCriterion(true, GcSpread.Sheets.IconValueType.Number, 10);
iconCriteria[2] = new GcSpread.Sheets.IconCriterion(true, GcSpread.Sheets.IconValueType.Number, 20);
iconSetRule.reverseIconOrder(false);
iconSetRule.showIconOnly(false);
cfs.addRule(iconSetRule);
See Also

Reference

IconCriterion type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.