From eadd93eb9b962fee31400c28a848e4a654ff67d3 Mon Sep 17 00:00:00 2001 From: Kenil Shah <32725411+Kenil27@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:38:33 +0530 Subject: [PATCH] Fix: support string value for xAxis apart from date (#18590) * Fix: show string value for xAxis apart from date * update key name --- .../src/main/resources/ui/src/utils/DataInsightUtils.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DataInsightUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/DataInsightUtils.tsx index 44a5cba7f80..c5205431c5c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DataInsightUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DataInsightUtils.tsx @@ -152,7 +152,11 @@ export const CustomTooltip = (props: DataInsightChartTooltipProps) => { } = props; if (active && payload && payload.length) { - const timestamp = dateTimeFormatter(payload[0].payload[timeStampKey] || 0); + // we need to check if the xAxis is a date or not. + const timestamp = + timeStampKey === 'term' + ? payload[0].payload[timeStampKey] + : dateTimeFormatter(payload[0].payload[timeStampKey] || 0); const payloadValue = uniqBy(payload, 'dataKey'); return (