Histogram: Fix field displayName cache (#94685)

This commit is contained in:
Edvard Falkskär 2024-10-17 21:00:03 +02:00 committed by GitHub
parent 221e640264
commit 125b7c2fd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
import { useMemo } from 'react';
import { PanelProps, buildHistogram, getHistogramFields } from '@grafana/data';
import { PanelProps, buildHistogram, cacheFieldDisplayNames, getHistogramFields } from '@grafana/data';
import { histogramFieldsToFrame } from '@grafana/data/src/transformations/transformers/histogram';
import { TooltipDisplayMode, TooltipPlugin2, useTheme2 } from '@grafana/ui';
import { TooltipHoverMode } from '@grafana/ui/src/components/uPlot/plugins/TooltipPlugin2';
@ -32,6 +32,8 @@ export const HistogramPanel = ({ data, options, width, height }: Props) => {
});
});
cacheFieldDisplayNames(data.series);
if (data.series.length === 1) {
const info = getHistogramFields(data.series[0]);
if (info) {