From d4a7f14eb4d774de446bcb4ae8812a506626f6d1 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 13:17:57 -0500 Subject: [PATCH] [v10.1.x] Trend: Fix x field matching logic (#72961) --- public/app/plugins/panel/trend/TrendPanel.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/app/plugins/panel/trend/TrendPanel.tsx b/public/app/plugins/panel/trend/TrendPanel.tsx index ccddf9b953b..2b514032734 100644 --- a/public/app/plugins/panel/trend/TrendPanel.tsx +++ b/public/app/plugins/panel/trend/TrendPanel.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from 'react'; -import { DataFrame, FieldType, getFieldDisplayName, PanelProps, TimeRange } from '@grafana/data'; +import { DataFrame, FieldMatcherID, fieldMatchers, FieldType, PanelProps, TimeRange } from '@grafana/data'; import { isLikelyAscendingVector } from '@grafana/data/src/transformations/transformers/joinDataFrames'; import { config, PanelDataErrorView } from '@grafana/runtime'; import { @@ -38,9 +38,7 @@ export const TrendPanel = ({ const preparePlotFrameTimeless = (frames: DataFrame[], dimFields: XYFieldMatchers, timeRange?: TimeRange | null) => { dimFields = { ...dimFields, - x: (field, frame, frames) => { - return getFieldDisplayName(field, frame, frames) === trendXFieldName; - }, + x: fieldMatchers.get(FieldMatcherID.byName).get(trendXFieldName), }; return preparePlotFrame(frames, dimFields);