VizTooltip: Format header value (#88726)

This commit is contained in:
Adela Almasan 2024-06-06 12:08:05 -06:00 committed by GitHub
parent d359591dac
commit 79f9d529d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
import { css } from '@emotion/css';
import React, { ReactNode } from 'react';
import { DataFrame, Field, FieldType } from '@grafana/data';
import { DataFrame, Field, FieldType, formattedValueToString } from '@grafana/data';
import { SortOrder, TooltipDisplayMode } from '@grafana/schema/dist/esm/common/common.gen';
import { useStyles2 } from '@grafana/ui';
import { VizTooltipContent } from '@grafana/ui/src/components/VizTooltip/VizTooltipContent';
@ -52,8 +52,7 @@ export const TimeSeriesTooltip = ({
const styles = useStyles2(getStyles);
const xField = series.fields[0];
const xVal = xField.display!(xField.values[dataIdxs[0]!]).text;
const xVal = formattedValueToString(xField.display!(xField.values[dataIdxs[0]!]));
const contentItems = getContentItems(
series.fields,