mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
StateTimeline: Show correct legend label when value mappings set (#62282)
* StateTimeline: Show correct legend label when value mappings set * Add test dashboard for thresholds and value mappings * run stripnulls.sh
This commit is contained in:
@@ -556,9 +556,10 @@ export function getFieldLegendItem(fields: Field[], theme: GrafanaTheme2): VizLe
|
||||
const items: VizLegendItem[] = [];
|
||||
const fieldConfig = fields[0].config;
|
||||
const colorMode = fieldConfig.color?.mode ?? FieldColorModeId.Fixed;
|
||||
const thresholds = fieldConfig.thresholds;
|
||||
|
||||
// If thresholds are enabled show each step in the legend
|
||||
if (colorMode === FieldColorModeId.Thresholds) {
|
||||
if (colorMode === FieldColorModeId.Thresholds && thresholds?.steps && thresholds.steps.length > 1) {
|
||||
return getThresholdItems(fieldConfig, theme);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user