> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# IComparison

- Package: [@gooddata/sdk-ui-charts](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/index.md)
- Kind: interface
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-charts/src/interfaces/comparison.ts

Configuration options for comparing values.

**Signature:**

```typescript
export interface IComparison 
```

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [calculationType?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisoncalculationtype) |  | [CalculationType](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.calculationtype/index.md) | _(Optional)_ Defines how the comparison value will be calculated. |
| [colorConfig?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisoncolorconfig) |  | [IColorConfig](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icolorconfig/index.md) | _(Optional)_ Controls the application of conditional colors. |
| [enabled](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonenabled) |  | boolean | Enables or disables the comparison. |
| [format?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonformat) |  | [ComparisonFormat](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.comparisonformat/index.md) | _(Optional)_ Defines the number format of the comparison value. |
| [isArrowEnabled?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonisarrowenabled) |  | boolean | _(Optional)_ Controls the visibility of the arrow trend indicator and its direction based on conditions. |
| [labelConfig?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonlabelconfig) |  | [ILabelConfig](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.ilabelconfig/index.md) | _(Optional)_ Controls the label displayed beneath the comparison value. |
| [position?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonposition) |  | [ComparisonPosition](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.comparisonposition/index.md) | _(Optional)_ Defines how the comparison value will be placed. |
| [subFormat?](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.icomparison/index.md#icomparisonsubformat) |  | [ComparisonFormat](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-charts/sdk-ui-charts.comparisonformat/index.md) | _(Optional)_ Defines the number format of the comparison sub value. |

## Property details

### IComparison.calculationType

Defines how the comparison value will be calculated.

**Signature:**

```typescript
calculationType?: CalculationType;
```

#### Default Value

Based on the secondary measure.

#### Remarks

The default value is determined by the type of secondary measure: <table>  <tr><th width="250">Type of secondary measure</th><th width="250">Default value</th></tr>  <tr><td>Derived measure</td><td>change</td></tr>  <tr><td>Non-derived measure</td><td>ratio</td></tr> </table>

### IComparison.colorConfig

Controls the application of conditional colors.

**Signature:**

```typescript
colorConfig?: IColorConfig;
```

### IComparison.enabled

Enables or disables the comparison.

**Signature:**

```typescript
enabled: boolean;
```

#### Default Value

true

### IComparison.format

Defines the number format of the comparison value.

**Signature:**

```typescript
format?: ComparisonFormat;
```

#### Default Value

Based on the calculation type.

#### Remarks

The default value is based on the calculation type: <table>  <tr><th width="150">Calculation Type</th><th width="350">Default format</th></tr>  <tr><td>change</td><td>Percent (rounded)</td></tr>  <tr><td>ratio</td><td>Percent (rounded)</td></tr>  <tr><td>difference</td><td>Inherit</td></tr> </table>

### IComparison.isArrowEnabled

Controls the visibility of the arrow trend indicator and its direction based on conditions.

**Signature:**

```typescript
isArrowEnabled?: boolean;
```

#### Remarks

The arrow direction is determined as follows:

<table>  <tr><th width="300">Condition</th><th width="200">Direction</th></tr>  <tr><td>Primary greater than Secondary</td><td>Up</td></tr>  <tr><td>Primary less than Secondary</td><td>Down</td></tr>  <tr><td>Primary equal to Secondary</td><td>No direction, arrow hidden</td></tr> </table>

### IComparison.labelConfig

Controls the label displayed beneath the comparison value.

**Signature:**

```typescript
labelConfig?: ILabelConfig;
```

### IComparison.position

Defines how the comparison value will be placed.

**Signature:**

```typescript
position?: ComparisonPosition;
```

#### Default Value

auto

### IComparison.subFormat

Defines the number format of the comparison sub value.

**Signature:**

```typescript
subFormat?: ComparisonFormat;
```

#### Default Value

Based on the calculation subtype.

#### Remarks

The default value is based on the calculation subtype: <table>  <tr><th width="150">Calculation Type</th><th width="350">Default format</th></tr>  <tr><td>change</td><td>Percent (rounded)</td></tr>  <tr><td>ratio</td><td>Percent (rounded)</td></tr>  <tr><td>difference</td><td>Inherit</td></tr> </table>
