⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@abelyakin
Copy link
Contributor

Description

following issue #501
Implements Grafana's text mode feature to provide users with explicit control over what's displayed in stat panels. Previously, users were confused about when to use metricLabel vs legendFormat, and there was no way to show series names alongside values.

legendFormat: Template for formatting series names (e.g., {{instance}} - {{job}}). Applied to all series for display purposes.
metricLabel: Selects which label's value to display instead of the calculated number (e.g., show the "status" label value like "healthy" or "degraded" rather than a numeric metric).
textMode: Controls what to show - the calculated value, series name, both, or neither.

Updated and simplified the migration logic to map textMode from panel options and handle various display scenarios.
Grafana's textMode values pass through directly without conversion. Existing panels default to auto for backward compatibility.

Screenshots

text mode = name

Screenshot 2026-01-16 at 03 29 07

text mode = value

Screenshot 2026-01-16 at 03 29 18

text mode = value and name

Screenshot 2026-01-16 at 03 29 40

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

…ogic

- Introduced a new  property in the StatChart schema to control how values and names are displayed.
- Updated the migration logic to map  from panel options and handle various display scenarios.
- Refactored the StatChartBase component to utilize  for determining what to display (value, name, both, or none).
- Adjusted tests and expected outputs to reflect changes in text mode handling.
- Enhanced the StatChartOptionsEditorSettings to allow users to select the desired text mode.

Signed-off-by: Alexander Belyakin <[email protected]>
@abelyakin abelyakin requested review from a team and AntoineThebaud as code owners January 16, 2026 00:58
@abelyakin abelyakin requested review from Gladorme and removed request for a team January 16, 2026 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant