# StyledColumn

Canonical page: https://www.adaptabletools.com/docs/reference/styledcolumn

One column drawn with a Styled Column.

Set exactly one of `GradientStyle`, `PercentBarStyle`, `BulletChartStyle`, `RangeBarStyle`, `RatingStyle`, `IconStyle`, `BadgeStyle` or `SparklineStyle`. The Settings Panel edits them as alternatives and clears the others when the type changes.

If a cell-renderer style is combined with another, AdapTable uses the first match in this order: Percent Bar, Bullet Chart, Range Bar, Rating, Icon, Badge, Sparkline. `GradientStyle` is the cell background rather than a replacement renderer, so it still paints when it is set.

Suspend with `IsSuspended` (inherited from ). A suspended Styled Column is kept in state and is not drawn.

```ts title="TypeScript"
export interface StyledColumn extends SuspendableObject 
```

###### Extends

[`SuspendableObject`](https://www.adaptabletools.com/docs/reference/suspendableobject.md)

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [BadgeStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#badgestyle) | [`BadgeStyle`](https://www.adaptabletools.com/docs/reference/badgestyle.md) | Any column. Draws the cell value as a pill. A `numberArray` or `textArray` column draws one pill per element; other array types are drawn as a single value.<br/><br/>`Badges` is the list of pill definitions. A `Rule` is an AdapTableQL boolean expression, evaluated per cell (and per element on a number or text array). Rules are tried in list order and the first match wins. A badge with no `Rule` is the fallback when no rule matches; if several have no rule, the first of those is used. `Density`, `Spacing` and `OverflowMode` (`Truncate`, `Wrap` or `Scroll`) apply to the whole column. |
| [BulletChartStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#bulletchartstyle) | [`BulletChartStyle`](https://www.adaptabletools.com/docs/reference/bulletchartstyle.md) | Numeric column. Draws a bullet chart in the cell: the value as a bar, a target as a marker, and optional qualitative bands behind the bar.<br/><br/>`CellRanges` colours those background bands (poor / ok / good). They are not a colour switch for the bar itself, which is what Percent Bar uses `CellRanges` for. `TargetProperties` supplies the target. `Orientation` is `Horizontal` (the default) or `Vertical`; a vertical chart needs a tall row. |
| [ColumnId](https://www.adaptabletools.com/docs/reference/styledcolumn.md#columnid) | `string` | `colId` of the column this style draws.<br/><br/>AdapTable uses the first Styled Column with this `ColumnId`. |
| [GradientStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#gradientstyle) | [`GradientStyle`](https://www.adaptabletools.com/docs/reference/gradientstyle.md) | Numeric column. Tints the cell background by where the value sits in a range.<br/><br/>The cell text stays. Set `CellRanges` for bands (a traffic-light scale), or `ZeroCentred` for a diverging colour either side of 0. `ColumnComparison` measures this cell against another column. `RangeValueType` is `Number` (the default) or `Percentage` (0–100). |
| [IconStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#iconstyle) | [`IconStyle`](https://www.adaptabletools.com/docs/reference/iconstyle.md) | Scalar column. Looks the cell value up in `Mappings` (and an optional `Preset`) and draws the matching icon.<br/><br/>Array columns are not supported; use `BadgeStyle` to draw one glyph per array element. `Preset` is `Flags`, `Currencies`, `Trend` or `Status`. `MatchMode` is `Exact` (the default) or `CaseInsensitive`. When nothing matches, `FallbackProperties.Mode` is `Hide` (the default), `ShowText` or `Icon`. |
| [Name](https://www.adaptabletools.com/docs/reference/styledcolumn.md#name) | `string` | Name shown in the Settings Panel and used by `styledColumnApi` to find this definition.<br/><br/>Unique among Styled Columns. |
| [PercentBarStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#percentbarstyle) | [`PercentBarStyle`](https://www.adaptabletools.com/docs/reference/percentbarstyle.md) | Numeric column. Draws a bar whose length is the cell value on the column&#39;s scale.<br/><br/>`CellRanges` colours the bar by which band the value falls in. `Origin` is where the bar grows from: `Auto` (the default), `Zero`, `Min`, or a fixed number. `ColumnComparison` measures the cell against another column. |
| [RangeBarStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#rangebarstyle) | [`RangeBarStyle`](https://www.adaptabletools.com/docs/reference/rangebarstyle.md) | Numeric column. Draws a track from `Min` to `Max` and a marker at the cell value.<br/><br/>`Min` and `Max` are required. Each can be a number, another column&#39;s `colId` (that row&#39;s value), or `Col-Min`, `Col-Max`, `Col-Avg` or `Col-Median` across the visible rows. `Reference` is an optional second marker (a target or a previous close). `CellRanges` draws background bands on the track. |
| [RatingStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#ratingstyle) | [`RatingStyle`](https://www.adaptabletools.com/docs/reference/ratingstyle.md) | Numeric column. Draws a row of icons (stars by default) filled in proportion to the cell value.<br/><br/>`Max` is both the number of icons and the top of the scale, in the same units as the cell value. The default is 5, so a value of 4 fills four of five stars. The value is clamped to `[0, Max]`. `AllowHalf` (the default) fills the boundary icon by the fraction; otherwise the value rounds to a whole icon. `Icon` is `Star`, `Heart`, `Circle` or `Thumb`. |
| [RowScope](https://www.adaptabletools.com/docs/reference/styledcolumn.md#rowscope) | [`RowScope`](https://www.adaptabletools.com/docs/reference/rowscope.md) | Which row kinds draw the style: data (leaf) rows, group rows, summary rows and grand-total rows.<br/><br/>Each `Exclude*` flag turns that kind off. When `RowScope` is omitted, Badge draws on every row kind and every other style draws on every kind except group rows.<br/><br/>Sparkline ignores this for non-data rows: it only draws on leaf rows, because the cell value has to be the array of points. |
| [SparklineStyle](https://www.adaptabletools.com/docs/reference/styledcolumn.md#sparklinestyle) | [`SparklineStyle`](https://www.adaptabletools.com/docs/reference/sparklinestyle.md) | Numeric-array column. The cell value is the series, and AG Grid&#39;s sparkline renderer draws it.<br/><br/>`options` is an AG Charts sparkline options object (`type: 'line'`, `'bar'`, `'area'` or `'column'`). Only leaf data rows are drawn. |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/styledcolumn.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |
| [IsSuspended](https://www.adaptabletools.com/docs/reference/styledcolumn.md#issuspended) | `boolean` | Suspends (i.e. turns off) an Adaptable Object |

## Property Details

### BadgeStyle

Any column. Draws the cell value as a pill. A `numberArray` or `textArray` column draws one pill per element; other array types are drawn as a single value.

`Badges` is the list of pill definitions. A `Rule` is an AdapTableQL boolean expression, evaluated per cell (and per element on a number or text array). Rules are tried in list order and the first match wins. A badge with no `Rule` is the fallback when no rule matches; if several have no rule, the first of those is used. `Density`, `Spacing` and `OverflowMode` (`Truncate`, `Wrap` or `Scroll`) apply to the whole column.

```ts title="TypeScript"
BadgeStyle?: BadgeStyle;
```

###### Property Value

[`BadgeStyle`](https://www.adaptabletools.com/docs/reference/badgestyle.md)

### BulletChartStyle

Numeric column. Draws a bullet chart in the cell: the value as a bar, a target as a marker, and optional qualitative bands behind the bar.

`CellRanges` colours those background bands (poor / ok / good). They are not a colour switch for the bar itself, which is what Percent Bar uses `CellRanges` for. `TargetProperties` supplies the target. `Orientation` is `Horizontal` (the default) or `Vertical`; a vertical chart needs a tall row.

```ts title="TypeScript"
BulletChartStyle?: BulletChartStyle;
```

###### Property Value

[`BulletChartStyle`](https://www.adaptabletools.com/docs/reference/bulletchartstyle.md)

### ColumnId

`colId` of the column this style draws.

AdapTable uses the first Styled Column with this `ColumnId`.

```ts title="TypeScript"
ColumnId: string;
```

###### Property Value

`string`

### GradientStyle

Numeric column. Tints the cell background by where the value sits in a range.

The cell text stays. Set `CellRanges` for bands (a traffic-light scale), or `ZeroCentred` for a diverging colour either side of 0. `ColumnComparison` measures this cell against another column. `RangeValueType` is `Number` (the default) or `Percentage` (0–100).

```ts title="TypeScript"
GradientStyle?: GradientStyle;
```

###### Property Value

[`GradientStyle`](https://www.adaptabletools.com/docs/reference/gradientstyle.md)

### IconStyle

Scalar column. Looks the cell value up in `Mappings` (and an optional `Preset`) and draws the matching icon.

Array columns are not supported; use `BadgeStyle` to draw one glyph per array element. `Preset` is `Flags`, `Currencies`, `Trend` or `Status`. `MatchMode` is `Exact` (the default) or `CaseInsensitive`. When nothing matches, `FallbackProperties.Mode` is `Hide` (the default), `ShowText` or `Icon`.

```ts title="TypeScript"
IconStyle?: IconStyle;
```

###### Property Value

[`IconStyle`](https://www.adaptabletools.com/docs/reference/iconstyle.md)

### Name

Name shown in the Settings Panel and used by `styledColumnApi` to find this definition.

Unique among Styled Columns.

```ts title="TypeScript"
Name: string;
```

###### Property Value

`string`

### PercentBarStyle

Numeric column. Draws a bar whose length is the cell value on the column&#39;s scale.

`CellRanges` colours the bar by which band the value falls in. `Origin` is where the bar grows from: `Auto` (the default), `Zero`, `Min`, or a fixed number. `ColumnComparison` measures the cell against another column.

```ts title="TypeScript"
PercentBarStyle?: PercentBarStyle;
```

###### Property Value

[`PercentBarStyle`](https://www.adaptabletools.com/docs/reference/percentbarstyle.md)

### RangeBarStyle

Numeric column. Draws a track from `Min` to `Max` and a marker at the cell value.

`Min` and `Max` are required. Each can be a number, another column&#39;s `colId` (that row&#39;s value), or `Col-Min`, `Col-Max`, `Col-Avg` or `Col-Median` across the visible rows. `Reference` is an optional second marker (a target or a previous close). `CellRanges` draws background bands on the track.

```ts title="TypeScript"
RangeBarStyle?: RangeBarStyle;
```

###### Property Value

[`RangeBarStyle`](https://www.adaptabletools.com/docs/reference/rangebarstyle.md)

### RatingStyle

Numeric column. Draws a row of icons (stars by default) filled in proportion to the cell value.

`Max` is both the number of icons and the top of the scale, in the same units as the cell value. The default is 5, so a value of 4 fills four of five stars. The value is clamped to `[0, Max]`. `AllowHalf` (the default) fills the boundary icon by the fraction; otherwise the value rounds to a whole icon. `Icon` is `Star`, `Heart`, `Circle` or `Thumb`.

```ts title="TypeScript"
RatingStyle?: RatingStyle;
```

###### Property Value

[`RatingStyle`](https://www.adaptabletools.com/docs/reference/ratingstyle.md)

### RowScope

Which row kinds draw the style: data (leaf) rows, group rows, summary rows and grand-total rows.

Each `Exclude*` flag turns that kind off. When `RowScope` is omitted, Badge draws on every row kind and every other style draws on every kind except group rows.

Sparkline ignores this for non-data rows: it only draws on leaf rows, because the cell value has to be the array of points.

```ts title="TypeScript"
RowScope?: RowScope;
```

###### Property Value

[`RowScope`](https://www.adaptabletools.com/docs/reference/rowscope.md)

### SparklineStyle

Numeric-array column. The cell value is the series, and AG Grid&#39;s sparkline renderer draws it.

`options` is an AG Charts sparkline options object (`type: 'line'`, `'bar'`, `'area'` or `'column'`). Only leaf data rows are drawn.

```ts title="TypeScript"
SparklineStyle?: SparklineStyle;
```

###### Property Value

[`SparklineStyle`](https://www.adaptabletools.com/docs/reference/sparklinestyle.md)

### IsSuspended

> *Inherited from [SuspendableObject](https://www.adaptabletools.com/docs/reference/suspendableobject.md)*

Suspends (i.e. turns off) an Adaptable Object

```ts title="TypeScript"
IsSuspended?: boolean;
```

###### Property Value

`boolean`

### IsReadOnly

> *Inherited from [AdaptableObject](https://www.adaptabletools.com/docs/reference/adaptableobject.md)*

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;)

```ts title="TypeScript"
IsReadOnly?: boolean;
```

###### Property Value

`boolean`
