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 inpublic/app/plugins/panel/stat/module.tsx:18:
Options Interface
Frompublic/app/plugins/panel/stat/panelcfg.gen.ts:15:
Default Options
Frompublic/app/plugins/panel/stat/panelcfg.gen.ts:25:
Text Mode
Control what text is displayed (frompublic/app/plugins/panel/stat/module.tsx:28):
Color Mode
Control how color is applied (frompublic/app/plugins/panel/stat/module.tsx:62):
Graph Mode
Display a sparkline graph (frompublic/app/plugins/panel/stat/module.tsx:82):
Justify Mode
Control text alignment (frompublic/app/plugins/panel/stat/module.tsx:95):
Wide Layout
When usingtextMode: '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 (frompublic/app/plugins/panel/stat/module.tsx:107):
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:last- Last value (default)first- First valuemean- Averagesum- Sum of all valuesmin- Minimum valuemax- Maximum valuecount- 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:Value Mappings
Map specific values to custom text and colors:Data Links
Add clickable links to stat values:Implementation Details
The Stat panel extendsSingleStatBaseOptions which provides common functionality shared with the Gauge and Bar Gauge panels.
Key files:
public/app/plugins/panel/stat/module.tsx- Plugin definitionpublic/app/plugins/panel/stat/StatPanel.tsx- Component implementationpublic/app/plugins/panel/stat/panelcfg.gen.ts- Generated typespublic/app/plugins/panel/stat/common.ts- Shared utilities
The Stat panel uses
setNoPadding() to remove default panel padding for edge-to-edge display.Related Resources
Gauge Panel
Display values with radial gauges
Graph Panel
Visualize time series data