mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 12:14:08 -06:00
Trend: Fix x field matching logic (#72862)
This commit is contained in:
parent
92e7829e7a
commit
9328febbab
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user