# GC.Spread.Sheets.ConditionalFormatting.SparklineRule

## Content

# Class: SparklineRule

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

## Hierarchy

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

  ↳ **`SparklineRule`**

## Table of contents

### Constructors

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

### Methods

- [condition](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#condition)
- [contains](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#contains)
- [createCondition](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#createcondition)
- [evaluate](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#evaluate)
- [getExpected](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#getexpected)
- [intersects](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#intersects)
- [isScaleRule](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#isscalerule)
- [priority](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#priority)
- [ranges](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#ranges)
- [reset](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#reset)
- [ruleType](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#ruletype)
- [showSparklineOnly](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#showsparklineonly)
- [sparklineOptions](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#sparklineoptions)
- [sparklineType](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#sparklinetype)
- [stopIfTrue](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#stopiftrue)
- [style](GC.Spread.Sheets.ConditionalFormatting.SparklineRule#style)

## Constructors

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

• **new SparklineRule**(`type`, `sparklineOptions?`, `ranges?`)

Represents a sparkline rule that renders sparkline charts in cells based on conditional formatting.

**`example`**
```javascript
// Example 1: Create an HBar sparkline rule using options object
activeSheet.setArray(0, 0, [[0.2], [0.5], [0.75], [1.0], [0.6]]);
var rule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('HBARSPARKLINE', {
    value: '@',
    colorScheme: 'green'
}, [new GC.Spread.Sheets.Range(0, 0, 5, 1)]);
activeSheet.conditionalFormats.addRule(rule);

// Example 2: Create a YEARSPARKLINE rule using positional array arguments
// This generates: =YEARSPARKLINE(2026, A2:B13, , , "#979797", "#f3f3f3")
// Simulate activity peaks across the year with busier summer and fall periods.
activeSheet.setArray(1, 0, [
    [new Date(2026, 0, 5), 2],
    [new Date(2026, 1, 14), 3],
    [new Date(2026, 2, 27), 4],
    [new Date(2026, 3, 10), 6],
    [new Date(2026, 4, 22), 5],
    [new Date(2026, 5, 18), 8],
    [new Date(2026, 6, 9), 7],
    [new Date(2026, 7, 25), 6],
    [new Date(2026, 8, 16), 9],
    [new Date(2026, 9, 28), 10],
    [new Date(2026, 10, 11), 7],
    [new Date(2026, 11, 20), 4]
]);
var rule2 = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('YEARSPARKLINE',
    [2026, 'A2:B13', undefined, undefined, '#979797', '#f3f3f3'],
    [new GC.Spread.Sheets.Range(0, 0, 1, 1)]);
activeSheet.conditionalFormats.addRule(rule2);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `type` | [`SparklineExType`](../modules/GC.Spread.Sheets.Sparklines#sparklineextype) | The sparkline function name (e.g., 'PIESPARKLINE', 'BULLETSPARKLINE', 'HBARSPARKLINE', or a custom sparkline function name). |
| `sparklineOptions?` | [`ISparklineOptions`](../modules/GC.Spread.Sheets.Sparklines#isparklineoptions) \| [`SparklineParameterType`](../modules/GC.Spread.Sheets.Sparklines#sparklineparametertype)[] | The sparkline options. Can be either:   - An options object containing parameters for the sparkline formula (for built-in sparklines with known parameter order).   - An array of positional arguments (for custom sparklines or when explicit argument ordering is needed).   Supports special placeholders: `$CF_RANGE$` (replaced with rule ranges) and `@` (current cell value or index). |
| `ranges?` | [`Range`](GC.Spread.Sheets.Range)[] | The cell ranges where this rule applies. |

#### 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 condition for the rule.

**`example`**
```javascript
var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.formulaRule);
rule.formula("=A1=B1+C1");
var condition = rule.createCondition();
console.log(condition.evaluate(activeSheet));
```

#### Returns

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

The condition.

#### Inherited from

[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`): `any`

Returns the sparkline value of the rule if the cell is within the rule's ranges.

**`example`**
```javascript
var rule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('HBARSPARKLINE', {value: '@'}, [new GC.Spread.Sheets.Range(0, 0, 5, 1)]);
activeSheet.setArray(0, 0, [[0.2], [0.5], [0.75], [1.0], [0.6]]);
activeSheet.conditionalFormats.addRule(rule);
var result = rule.evaluate(activeSheet, 0, 0, 0.5);
console.log(result);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `evaluator` | `Object` | The evaluator (worksheet). |
| `baseRow` | `number` | The row index. |
| `baseColumn` | `number` | The column index. |
| `actual` | `Object` | The actual cell value. |

#### Returns

`any`

The value object if the cell is in range; otherwise, null.

#### Overrides

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

___

### <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="priority" name="priority"></a> priority

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

Gets or sets the priority of the rule.

**`example`**
```javascript
// Example: Create multiple rules with different priorities
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.cellValueRule);
rule.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
rule.value1(10);
rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
rule.style(style);
rule.priority(1); // Set priority to 1 (highest priority)
activeSheet.conditionalFormats.addRule(rule);
var style2 = new GC.Spread.Sheets.Style();
style2.backColor = "blue";
var rule2 = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
rule2.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.cellValueRule);
rule2.operator(GC.Spread.Sheets.ConditionalFormatting.ComparisonOperators.greaterThan);
rule2.value1(100);
rule2.ranges([new GC.Spread.Sheets.Range(5, 0, 10, 1)]);
rule2.style(style2);
rule2.priority(2); // Set priority to 1 (highest priority)
activeSheet.conditionalFormats.addRule(rule2);
```

#### 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 a copy of 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="reset" name="reset"></a> reset

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

Resets the rule to its default state.

**`example`**
```javascript
activeSheet.setArray(0, 0, [[0.2], [0.5], [0.75], [1.0], [0.6], [0.25], [0.35], [0.15], [0.45], [0.3]]);
var rule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('HBARSPARKLINE', {value: '@'}, [new GC.Spread.Sheets.Range(0, 0, 5, 1)]);
activeSheet.conditionalFormats.addRule(rule);
rule.reset();
rule.sparklineOptions({
   value: '@',
   colorScheme: 'blue'
});
rule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
activeSheet.repaint();
```

#### 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 topRule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
topRule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
topRule.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
topRule.rank(3);
topRule.style(style1);
topRule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
topRule.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(topRule);
```

#### 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="showsparklineonly" name="showsparklineonly"></a> showSparklineOnly

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

Gets or sets whether to display the sparkline without cell text.

**`example`**
```javascript
//This example uses the showSparklineOnly method.
activeSheet.setValue(0, 0, 50);
activeSheet.setValue(1, 0, 75);
activeSheet.setValue(2, 0, 25);
var sparklineRule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('HBARSPARKLINE', {
    value: '@',
    colorScheme: 'green'
}, [new GC.Spread.Sheets.Range(0, 0, 3, 1)]);
sparklineRule.showSparklineOnly(true);
activeSheet.conditionalFormats.addRule(sparklineRule);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | `boolean` | Whether to display the sparkline without cell text. |

#### Returns

`any`

If no value is set, returns whether the widget displays the sparkline without cell text; otherwise, returns the sparkline rule.

___

### <a id="sparklineoptions" name="sparklineoptions"></a> sparklineOptions

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

Gets or sets the sparkline options.

**`example`**
```javascript
// Example 1: Using options object
activeSheet.setArray(0, 0, [[0.2], [0.3], [0.5], [0.1], [0.4], [0.25], [0.35], [0.15], [0.45], [0.3]]);
var rule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('PIESPARKLINE', {
    value: '@',
    colors: ['red', 'green', 'blue']
}, [new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
activeSheet.conditionalFormats.addRule(rule);
console.log(rule.sparklineOptions()); // { value: '@', colors: ['red', 'green', 'blue'] }

// Example 2: Using positional array arguments
rule.sparklineOptions(['@', 'skyblue', 'orange', 'lightgray']);
activeSheet.repaint();
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `value?` | [`ISparklineOptions`](../modules/GC.Spread.Sheets.Sparklines#isparklineoptions) \| [`SparklineParameterType`](../modules/GC.Spread.Sheets.Sparklines#sparklineparametertype)[] | The sparkline options. Can be either:   - An options object with named parameters (for built-in sparklines with known parameter order).   - An array of positional arguments (for custom sparklines or explicit argument ordering).   Supports special placeholders: `$CF_RANGE$` (replaced with the rule's range string) and `@` (replaced with current cell value or cell index for index parameters like pointIndex). |

#### Returns

`any`

If no value is set, returns the sparkline options; otherwise, returns the sparkline rule.

___

### <a id="sparklinetype" name="sparklinetype"></a> sparklineType

▸ **sparklineType**(): [`SparklineExType`](../modules/GC.Spread.Sheets.Sparklines#sparklineextype)

Gets the sparkline function type name.

**`example`**
```javascript
activeSheet.setArray(0, 0, [[0.2], [0.5], [0.75], [1.0], [0.6]]);
var rule = new GC.Spread.Sheets.ConditionalFormatting.SparklineRule('HBARSPARKLINE', {value: '@'}, [new GC.Spread.Sheets.Range(0, 0, 5, 1)]);
activeSheet.conditionalFormats.addRule(rule);
console.log(rule.sparklineType()); // 'HBARSPARKLINE'
```

#### Returns

[`SparklineExType`](../modules/GC.Spread.Sheets.Sparklines#sparklineextype)

The sparkline type name (e.g., 'PIESPARKLINE').

___

### <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 topRule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
topRule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
topRule.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
topRule.rank(3);
topRule.style(style1);
topRule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
topRule.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(topRule);
```

#### 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 topRule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule();
topRule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.top10Rule);
topRule.type(GC.Spread.Sheets.ConditionalFormatting.Top10ConditionType.top);
topRule.rank(3);
topRule.style(style1);
topRule.ranges([new GC.Spread.Sheets.Range(0, 0, 10, 1)]);
topRule.stopIfTrue(true);
activeSheet.conditionalFormats.addRule(topRule);
```

#### 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)
