# GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule

## Content

# Class: NormalConditionRule

[Sheets](../modules/GC.Spread.Sheets).[ConditionalFormatting](../modules/GC.Spread.Sheets.ConditionalFormatting).NormalConditionRule

## Hierarchy

- [`ConditionRuleBase`](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase)

  ↳ **`NormalConditionRule`**

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#constructor)

### Methods

- [condition](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#condition)
- [contains](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#contains)
- [createCondition](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#createcondition)
- [evaluate](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#evaluate)
- [formula](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#formula)
- [getExpected](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#getexpected)
- [intersects](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#intersects)
- [isScaleRule](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#isscalerule)
- [operator](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#operator)
- [priority](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#priority)
- [ranges](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#ranges)
- [rank](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#rank)
- [reset](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#reset)
- [ruleType](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#ruletype)
- [stopIfTrue](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#stopiftrue)
- [style](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#style)
- [text](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#text)
- [type](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#type)
- [value1](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#value1)
- [value2](GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule#value2)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new NormalConditionRule**(`ruleType`, `ranges`, `style`, `operator`, `value1`, `value2`, `text`, `formula`, `type`, `rank`)

Represents a normal conditional rule.

**`example`**
```javascript
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
//button
$("#button1").click(function () {
     cell.reset();
     activeSheet.suspendPaint();
     activeSheet.resumePaint();
});
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `ruleType` | [`RuleType`](../enums/GC.Spread.Sheets.ConditionalFormatting.RuleType) | The type of condition formatting rule. |
| `ranges` | [`Range`](GC.Spread.Sheets.Range)[] | The cell ranges where the rule is applied whose item type is GC.Spread.Sheets.Range. |
| `style` | [`Style`](GC.Spread.Sheets.Style) | The style that is applied to the cell when the condition is met. |
| `operator` | [`LogicalOperators`](../enums/GC.Spread.Sheets.ConditionalFormatting.LogicalOperators) \| [`ComparisonOperators`](../enums/GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators) \| [`TextComparisonOperators`](../enums/GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators) | The comparison operator. |
| `value1` | `Object` | The first value. |
| `value2` | `Object` | The second value. |
| `text` | `string` | The text for comparison. |
| `formula` | `string` | The condition formula. |
| `type` | [`AverageConditionType`](../enums/GC.Spread.Sheets.ConditionalFormatting.AverageConditionType) \| [`DateOccurringType`](../enums/GC.Spread.Sheets.ConditionalFormatting.DateOccurringType) \| [`Top10ConditionType`](../enums/GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType) | The average condition type. |
| `rank` | `number` | The number of top or bottom items to apply the style to. |

#### Overrides

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[constructor](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#constructor)

## Methods

### <a id="condition" name="condition"></a> condition

▸ **condition**(`value?`): `any`

Gets or sets the base condition of the rule.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`Condition`](GC.Spread.Sheets.ConditionalFormatting.Condition) | The base condition of the rule. |

#### Returns

`any`

If no value is set, returns the base condition of the rule; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[condition](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#condition)

___

### <a id="contains" name="contains"></a> contains

▸ **contains**(`row`, `column`): `boolean`

Determines whether the range of cells contains the cell at the specified row and column.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `row` | `number` | The row index. |
| `column` | `number` | The column index. |

#### Returns

`boolean`

`true` if the range of cells contains the cell at the specified row and column; otherwise, `false`.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[contains](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#contains)

___

### <a id="createcondition" name="createcondition"></a> createCondition

▸ **createCondition**(): [`Condition`](GC.Spread.Sheets.ConditionalFormatting.Condition)

Creates a condition for the rule.

#### Returns

[`Condition`](GC.Spread.Sheets.ConditionalFormatting.Condition)

The condition.

#### Overrides

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[createCondition](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#createcondition)

___

### <a id="evaluate" name="evaluate"></a> evaluate

▸ **evaluate**(`evaluator`, `baseRow`, `baseColumn`, `actual`): [`Style`](GC.Spread.Sheets.Style)

Returns the cell style of the rule if the cell satisfies the condition.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `evaluator` | `Object` | The object that can evaluate a condition. |
| `baseRow` | `number` | The row index. |
| `baseColumn` | `number` | The column index. |
| `actual` | `Object` | The actual value. |

#### Returns

[`Style`](GC.Spread.Sheets.Style)

The cell style of the rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[evaluate](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#evaluate)

___

### <a id="formula" name="formula"></a> formula

▸ **formula**(`formulaOrBaseRow?`, `baseColumn?`): `any`

Gets or sets the condition formula.

**`example`**
```javascript
//This example uses the formula method.
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule);
rule.formula("=A1=B1+C1");
rule.ranges([new GC.Spread.Sheets.Range(0, 0, 2, 1)]);
rule.style(style);
activeSheet.conditionalFormats.addRule(rule);
activeSheet.setValue(0, 0, 2,3);
activeSheet.setValue(0, 1, 1,3);
activeSheet.setValue(0, 2,1,3);
activeSheet.setValue(1, 0, 1,3);
var formulaOfTheTopLeftCell = rule.formula();
var formulaOfA1 = rule.formula(0, 0);
var formulaOfA2 = rule.formula(1, 0);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `formulaOrBaseRow?` | `string` \| `number` | The condition formula or the base row. |
| `baseColumn?` | `number` | The base column. |

#### Returns

`any`

If no value is set or baseRow and baseColumn is set, returns the condition formula; otherwise, returns the number condition rule.

___

### <a id="getexpected" name="getexpected"></a> getExpected

▸ **getExpected**(): [`Style`](GC.Spread.Sheets.Style)

Gets the style of the base rule.

**`example`**
```javascript
 //This example uses the getExpected method.
 activeSheet.suspendPaint();
 var style = new GC.Spread.Sheets.Style();
 style.backColor = "green";
 var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)];
 activeSheet.conditionalFormats.addUniqueRule(style, ranges);
 var data = [50, 50, 11, 5, 3, 6, 7, 8, 7, 11];
 var condition = activeSheet.conditionalFormats.getRules()[0];
 for (var i = 0; i < 10;i++){
     activeSheet.setValue(i, 0, data[i]);
 }
 activeSheet.resumePaint();
 console.log(condition.getExpected());
```

#### Returns

[`Style`](GC.Spread.Sheets.Style)

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[getExpected](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#getexpected)

___

### <a id="intersects" name="intersects"></a> intersects

▸ **intersects**(`row`, `column`, `rowCount`, `columnCount`): `boolean`

Specifies whether the range for this rule intersects another range.

**`example`**
```javascript
 //This example uses the intersects method.
 activeSheet.suspendPaint();
 var style = new GC.Spread.Sheets.Style();
 style.backColor = "green";
 var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)];
 activeSheet.conditionalFormats.addUniqueRule(style, ranges);
 var data = [50, 50, 11, 5, 3, 6, 7, 8, 7, 11];
 var condition = activeSheet.conditionalFormats.getRules()[0];
 for (var i = 0; i < 10; i++) {
     activeSheet.setValue(i, 0, data[i]);
 }
 activeSheet.resumePaint();
 activeSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function(e, info) {
     var selection = info.newSelections[0];
     var result = condition.intersects(selection.row, selection.col, selection.rowCount, selection.colCount);
     if (result) {
         alert("current selection is intersects with condition formatting range");
     } else {
         alert("current selection is not intersects with condition formatting range");
     }
 });
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `row` | `number` | The row index. |
| `column` | `number` | The column index. |
| `rowCount` | `number` | The number of rows. |
| `columnCount` | `number` | The number of columns. |

#### Returns

`boolean`

`true` if the range for this rule intersects another range; otherwise, `false`.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[intersects](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#intersects)

___

### <a id="isscalerule" name="isscalerule"></a> isScaleRule

▸ **isScaleRule**(): `boolean`

Specifies whether this rule is a scale rule.

#### Returns

`boolean`

`true` if this rule is a scale rule; otherwise, `false`.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[isScaleRule](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#isscalerule)

___

### <a id="operator" name="operator"></a> operator

▸ **operator**(`value?`): `any`

Gets or sets the comparison operator.

**`example`**
```javascript
//This example creates multiple rules.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`ComparisonOperators`](../enums/GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators) | The comparison operator. |

#### Returns

`any`

If no value is set, returns the comparison operator; otherwise, returns the number condition rule.

___

### <a id="priority" name="priority"></a> priority

▸ **priority**(`value?`): `any`

Gets or sets the priority of the rule.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | `number` | The priority of the rule. |

#### Returns

`any`

If no value is set, returns the priority of the rule; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[priority](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#priority)

___

### <a id="ranges" name="ranges"></a> ranges

▸ **ranges**(`value?`): `any`

Gets or sets the condition rule ranges.

**`example`**
```javascript
var style = new GC.Spread.Sheets.Style();
style.backColor = "green";
var ranges = [new GC.Spread.Sheets.Range(0, 0, 10, 1)];
activeSheet.conditionalFormats.addUniqueRule(style, ranges);
activeSheet.setValue(0, 0, 50);
activeSheet.setValue(1, 0, 50);
activeSheet.setValue(2, 0, 11);
activeSheet.setValue(3, 0, 5);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`Range`](GC.Spread.Sheets.Range)[] | The condition rule ranges. |

#### Returns

`any`

If no value is set, returns the condition rule ranges; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[ranges](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#ranges)

___

### <a id="rank" name="rank"></a> rank

▸ **rank**(`value?`): `any`

Gets or sets the number of top or bottom items to apply the style to.

**`example`**
```javascript
//This example creates multiple rules.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | `number` | The number of top or bottom items to apply the style to. |

#### Returns

`any`

If no value is set, returns the number of top or bottom items to apply the style to; otherwise, returns the number condition rule.

___

### <a id="reset" name="reset"></a> reset

▸ **reset**(): `void`

Resets the rule.

**`example`**
```javascript
activeSheet.setValue(0,0, 1,3);
activeSheet.setValue(1,0, 50,3);
activeSheet.setValue(2,0, 100,3);
activeSheet.setValue(3,0, 2,3);
activeSheet.setValue(4,0, 60,3);
activeSheet.setValue(5,0, 90,3);
activeSheet.setValue(6,0, 3,3);
activeSheet.setValue(7,0, 40,3);
activeSheet.setValue(8,0, 70,3);
activeSheet.setValue(9,0, 5,3);
activeSheet.setValue(10,0, 35,3);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.borderLeft =new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
style.borderTop = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
style.borderRight = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
style.borderBottom = new GC.Spread.Sheets.LineBorder("blue",GC.Spread.Sheets.LineStyle.medium);
var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.averageRule);
rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 3)]);
rule.style(style);
rule.type(GC.Spread.Sheets.ConditionalFormatting.AverageConditionType.above);
activeSheet.conditionalFormats.addRule(rule);
rule.reset();
```

#### Returns

`void`

#### Overrides

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[reset](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#reset)

___

### <a id="ruletype" name="ruletype"></a> ruleType

▸ **ruleType**(`value?`): `any`

Gets or sets the condition rule type.

**`example`**
```javascript
//This example uses the ruleType method.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`RuleType`](../enums/GC.Spread.Sheets.ConditionalFormatting.RuleType) | The condition rule type. |

#### Returns

`any`

If no value is set, returns the condition rule type; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[ruleType](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#ruletype)

___

### <a id="stopiftrue" name="stopiftrue"></a> stopIfTrue

▸ **stopIfTrue**(`value?`): `any`

Gets or sets whether rules with lower priority are applied before this rule.

**`example`**
```javascript
//This example applies multiple rules.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | `boolean` | Whether rules with lower priority are applied before this rule. |

#### Returns

`any`

If no value is set, returns whether the rules with lower priority are not applied before this rule; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[stopIfTrue](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#stopiftrue)

___

### <a id="style" name="style"></a> style

▸ **style**(`value?`): `any`

Gets or sets the style for the rule.

**`example`**
```javascript
//This example applies multiple rules.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`Style`](GC.Spread.Sheets.Style) | The style for the rule. |

#### Returns

`any`

If no value is set, returns the style for the rule; otherwise, returns the condition rule.

#### Inherited from

[ConditionRuleBase](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase).[style](GC.Spread.Sheets.ConditionalFormatting.ConditionRuleBase#style)

___

### <a id="text" name="text"></a> text

▸ **text**(`value?`): `any`

Gets or sets the text for comparison.

**`example`**
```javascript
//This example creates a rule.
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.specificTextRule);
rule.style(style);
rule.text("test");
rule.operator(GC.Spread.Sheets.ConditionalFormatting.TextComparisonOperators.contains);
rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
activeSheet.conditionalFormats.addRule(rule);
activeSheet.setValue(0, 0, "testing");
activeSheet.setValue(1, 0, "test");
activeSheet.setValue(2, 0, "a");
activeSheet.setValue(3, 0, "t");
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | `string` | The text for comparison. |

#### Returns

`any`

If no value is set, returns the text for comparison; otherwise, returns the number condition rule.

___

### <a id="type" name="type"></a> type

▸ **type**(`value?`): `any`

Gets or sets the average condition type.

**`example`**
```javascript
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1(5);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`AverageConditionType`](../enums/GC.Spread.Sheets.ConditionalFormatting.AverageConditionType) | The average condition type. |

#### Returns

`any`

If no value is set, returns the average condition type; otherwise, returns the number condition rule.

___

### <a id="value1" name="value1"></a> value1

▸ **value1**(`valueOrBaseRow?`, `baseColumn?`): `any`

Gets or sets the first value.

**`example`**
```javascript
//This example creates multiple rules.
activeSheet.setArray(0,0,[[1,10],[2,9], [3,8],[4,7],[5,6],[6,5],[7,4],[8,3],[9,2],[10,1]]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
cell.value1("=B1");
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
var style1 = new GC.Spread.Sheets.Style();
style1.foreColor = "red";
var top = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
top.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
top.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
top.rank(3);
top.style(style1);
top.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
top.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(top);
var formulaOfTheTopLeftCell = cell.value1();
var formulaOfA5 = cell.value1(4, 0);
var formulaOfA10 = cell.value1(9, 0);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `valueOrBaseRow?` | `any` | The first value or the base row. |
| `baseColumn?` | `number` | The base column. |

#### Returns

`any`

If no value is set or baseRow and baseColumn is set, returns the first value; otherwise, returns the number condition rule.

___

### <a id="value2" name="value2"></a> value2

▸ **value2**(`valueOrBaseRow?`, `baseColumn?`): `any`

Gets or sets the first value.

**`example`**
```javascript
//This example uses the value2 method.
activeSheet.setArray(0,0,[1,2,3,4,5,6,7,8,9,10]);
var cell = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
cell.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
cell.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.between);
cell.value1(5);
cell.value2(7);
cell.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
var style = new GC.Spread.Sheets.Style();
style.backColor = "red";
style.foreColor = "black";
cell.style(style);
activeSheet.conditionalFormats.addRule(cell);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `valueOrBaseRow?` | `any` | The first value or the base row. |
| `baseColumn?` | `number` | The base column. |

#### Returns

`any`

If no value is set or baseRow and baseColumn is set, returns the first value; otherwise, returns the number condition rule.
