Skip to main content
The Stat panel displays a single value with optional background coloring, sparklines, and percentage change indicators.

Overview

The Stat panel is ideal for displaying:
  • Current values of metrics
  • Statistical summaries (min, max, average)
  • Percentage changes over time
  • Key performance indicators (KPIs)
  • Status indicators with color coding

Panel Options

The Stat panel is defined in public/app/plugins/panel/stat/module.tsx:18:

Options Interface

From public/app/plugins/panel/stat/panelcfg.gen.ts:15:

Default Options

From public/app/plugins/panel/stat/panelcfg.gen.ts:25:

Text Mode

Control what text is displayed (from public/app/plugins/panel/stat/module.tsx:28):

Color Mode

Control how color is applied (from public/app/plugins/panel/stat/module.tsx:62):

Graph Mode

Display a sparkline graph (from public/app/plugins/panel/stat/module.tsx:82):

Justify Mode

Control text alignment (from public/app/plugins/panel/stat/module.tsx:95):

Wide Layout

When using textMode: 'value_and_name', the wide layout option controls whether the name and value are displayed side-by-side (wide) or stacked (from public/app/plugins/panel/stat/module.tsx:47):

Percent Change

Display percentage change from previous value (from public/app/plugins/panel/stat/module.tsx:107):
Percent Change Color Mode (from public/app/plugins/panel/stat/module.tsx:114):
Percent change is only available when not displaying all values (reduceOptions.values: false).

Orientation

Control layout direction:

Data Reduce Options

Control how multiple values are reduced to a single value:
Common reducers:
  • last - Last value (default)
  • first - First value
  • mean - Average
  • sum - Sum of all values
  • min - Minimum value
  • max - Maximum value
  • count - Number of values

Text Size Options

Control text sizing:

Panel JSON Examples

Basic Stat Panel

Stat with Background Color

Stat with Percent Change

Multiple Stats

Advanced Features

Custom Thresholds

Use thresholds to define color ranges based on values:
Or use percentage mode:

Value Mappings

Map specific values to custom text and colors:
Add clickable links to stat values:

Implementation Details

The Stat panel extends SingleStatBaseOptions which provides common functionality shared with the Gauge and Bar Gauge panels. Key files:
  • public/app/plugins/panel/stat/module.tsx - Plugin definition
  • public/app/plugins/panel/stat/StatPanel.tsx - Component implementation
  • public/app/plugins/panel/stat/panelcfg.gen.ts - Generated types
  • public/app/plugins/panel/stat/common.ts - Shared utilities
The Stat panel uses setNoPadding() to remove default panel padding for edge-to-edge display.

Gauge Panel

Display values with radial gauges

Graph Panel

Visualize time series data