Styled Columns in AdapTable

Summary

  • AdapTable provides 8 Styled Columns which render a column with a rich, data-driven visual style:
    • Gradient Style
    • Percent Bar
    • Badge Style
    • Sparkline Column
    • Bullet Chart
    • Rating Style
    • Range Bar
    • Icon Style

Styled Columns enable users of AdapTable to visualise their data in sophisticated and powerful ways.

They are designed to enable complicated styles to be defined with just a few clicks (or property settings), while providing a very striking visual effect.

There are 8 Styled Columns provided by AdapTable:

Styled ColumnColumn TypeDescription
GradientNumericColours cells by comparing values against one or more ranges
Percent BarNumericDraws a horizontal bar whose length reflects the value
BadgeNumeric, textRenders badge(s) in a cell, with optional icons and rules
SparklineNumeric arrayRenders an AG Grid sparkline in each cell from array data
Bullet ChartNumericRenders a bullet graph inside a cell
RatingNumericRenders a row of icons (e.g. stars) scaled to the cell value
Range BarNumericShows value and optional reference on track between min & max
IconAny (key lookup)Maps cell values to icons with presets and optional cell text
Deep Dive

How Styled Columns Work in AdapTable and how to implent them

Styled Columns
Fork

Gradient Style

The Gradient Style will colour numeric cells by comparing their value against a maximum value.

This maximum value can be the highest value in the Column or in a given Range.

Hint

  • Gradients can be reversed so the colour is lighter (rather than darker) the nearer it is to the max value
  • You can also provide a Zero-centred gradient for columns that also contain negative numbers

Percent Bar Style

In the Percent Bar Style each cell in the numeric column displays as a relatively sized bar, evaluated using either the cell's actual value or its relative percentage value.

Percent Bar Styles can include multiple Ranges and be styled to show a back colour, Cell Text or a Tooltip.

Badge Style

In the Badge Style each cell in a numeric or text column can be rendered as a Badge.

A Badge can include the Cell Text, or an Icon, or both.

Rules can be provided to determine whether the Badge is displayed.

Hint

This allows you to provide multiple different badge styles for a column depending on the cell value

Sparkline Column

The Sparkline Column style enables columns to be displayed as an AG Grid sparkline.

These are array columns, typically numeric, but objects can also be provided.

Bullet Chart Style

The Bullet Chart Style renders a bullet graph in each cell of a numeric column.

Each cell shows three things in a single row of pixels: the actual value (a bar), a target value (a marker) and optional qualitative bands (e.g. poor / ok / good).

Bullet Charts are particularly useful for KPI columns where each row's value should be compared against a target and classified into a qualitative band.

Hint

  • Bullet Charts also support Col-Avg and Col-Median as dynamic band/target endpoints
  • The bands and markers can adapt automatically as the data changes

Rating Style

The Rating Column Style turns a numeric column into a row of repeated icons (such as stars or hearts).

The filled portion reflects the cell value against configurable maximum (with optional half-icon for fractions).

Hint

Use the Rating Style when you want a compact, familiar “score out of five” (or similar) visual

Range Bar Style

The Range Bar Style draws a horizontal track between a minimum and maximum for each numeric cell.

It includes a marker for the cell value and an optional second marker for a reference value.

Optional qualitative bands can tint regions of the track.

It suits KPIs where you need to see “where am I on the scale?” and optionally compare to a benchmark in the same glance.

Icon Column Style

The Icon Column Style maps each cell’s value to a visual (emoji, system icon, or image URL).

Built-in presets (for example flags or status) can be combined with your own key–icon pairs; unmatched values can be hidden or shown as raw text or a fallback icon.

Hint

Icon columns work on any column data type that can be matched as text or a discrete key (not just numeric columns)

Find Out More

See the dedicated help page on each Styled Column to find out more and see relevant demos:

Row Scope

AdapTable allows both run-time and design-time users to decide which Rows will be included in the Style.

This is done using the RowScope property which controls 4 kinds of Rows:

  • Data — leaf data rows
  • Group — group rows (when AG Grid Row Grouping is active)
  • Summary — pinned summary rows
  • Total — grand-total rows

Note

All Styled Columns can render on all row kinds, with sole exception of Sparkline (which supportes Data rows only)

When RowScope is not explicitly set, AdapTable picks a sensible per-type default:

Styled ColumnDefault row kinds
BadgeAll four — Data, Group, Summary and Total
SparklineData only (the others aren't supported)
All other StylesData, Summary and Total (Group excluded)

Note

  • Only Badge includes Grouped Rows by default because aggregated values rarely make sense for other Styles
  • AdapTable still allows rendering Styles on Group rows because the Aggregation doesn't have to be sum
  • For example, it could be min or max, in which case the rendering would fit in with the rest of the column
Deep Dive

Understanding the RowScope object

Using Styled Columns

Run-time users are able to add, edit, share, suspend and delete Styled Columns using the Styled Column section in the Settings Panel.

Column Menu

A menu item in the Column Menu opens the Styled Column wizard for the selected column.

Labels follow a consistent pattern:

  • Create … when no Styled Column exists for that column yet
  • Edit … when one already does (for example Edit Gradient Column)

Which create actions appear depends on the column’s data type :

Note

  • Badge and Icon are offered on several types because they do not assume a numeric scale
  • Numeric-only styles are only listed for numeric columns
Column typeStyles available in Menu
NumericGradient, Percent Bar, Bullet Chart, Range Bar, Rating, Badge, Icon
StringBadge, Icon
String arrayBadge
Number arrayBadge, Sparkline

Hint

  • When editing, the wizard opens on a sensible first step for that style
  • For example Ranges for Gradient or Percent Bar, Mappings for Icon, Style for Range Bar

For full control over ordering and visibility of menu items, see Column Menu Options.

UI Entitlements

The UI Entitlements behaviour for Styled Columns is as expected for Full and Hidden Access Levels.

The ReadOnly Entitlement behaviour is that the Styled Columns will still be rendered but Users are not permitted to manage or suspend the Style definitions.

FAQ

Can I apply more than one Styled Column to the same column? No. A column can have at most one Styled Column at a time, and all the types are distinct and mutually exclusive. They all provide different ways to display column data and each has a separate implementation. The wizard reflects this by asking you to pick the Type on the Settings step.

What's the difference between a Badge and an Icon Column? Both can show a small visual in a cell, but they answer different questions:

  • Badge is rule-driven: each badge is shown when the rule matches the cell (or always, if no Rule is given). A badge is a pill with optional text and an optional icon and you can configure multiple badges per column.
  • Icon Column is value-mapped: it uses Key → Icon mappings and the renderer looks up the cell's value to find the matching icon. There is exactly one icon per cell, with configurable fallback behaviour for unmatched values.

Hint

  • Use a Badge when you want rule-based visual labels with optional text
  • Use an Icon Column when each value should map to a single, fixed glyph (e.g. flag or currency)

Why is a Styled Column (e.g. Percent Bar or Gradient) not shown on grouped or summary rows? Each Styled Column type defines which row kinds (data, group, summary, total) it can render on, and the wizard includes a Scope step to choose columns and those row kinds. Some types are intended only for leaf data rows (for example sparklines). If a style does not appear on an aggregated row, check the Styled Column's Row scope in the wizard or in Adaptable State — not all types apply to every row kind.

How do Styled Columns interact with Format Columns on the same cell? Styled Columns claim specific style slices and override the matching Format Column properties for those slices. In practice that means:

  • The renderer-owned visuals (gradient tint, percent bar, badge pill, sparkline, bullet chart geometry, rating icons, range track, icon glyph) always come from the Styled Column.
  • Where a Styled Column exposes a Font and/or Cell slice in its wizard (e.g. Gradient, Percent Bar, Bullet Chart, Rating, Badge, Icon), those properties take precedence over the Format Column for the same column.
  • Anything the Styled Column leaves unset still inherits normally from any matching Format Column.

Can I temporarily turn a Styled Column off without deleting it? Yes. Every Styled Column can be suspended from the Styled Column section in the Settings Panel. A suspended Styled Column keeps its definition but does not render — useful for quickly comparing styled vs. unstyled, or temporarily disabling a rule.

Why does my Styled Column not appear after I set it in Initial State? The most common reasons are:

  • The Styled Column's ColumnId doesn't match a column in the grid (typos, or the column hasn't been added yet)
  • The wrong type is configured for the column's data type (for example a Gradient on a string column)
  • The Styled Column is suspended or read-only in a way that hides it
  • For aggregated rows: the Row Scope excludes the row kind you're looking at

Hint

Use getStyledColumnForColumnId in Styled Column API at runtime to check if a Styled Column exists