From eb94455be7d69e551bcff41d705d0fc49992854f Mon Sep 17 00:00:00 2001 From: Sanskar Soni Date: Thu, 8 Aug 2024 15:21:36 +0530 Subject: [PATCH] fix(insights): added title for tooltip --- .../scenes/insights/InsightTooltip/InsightTooltip.tsx | 9 +++------ .../insights/InsightTooltip/insightTooltipUtils.tsx | 1 + .../src/scenes/insights/views/LineGraph/LineGraph.tsx | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/scenes/insights/InsightTooltip/InsightTooltip.tsx b/frontend/src/scenes/insights/InsightTooltip/InsightTooltip.tsx index 5a83cad0c9c8e..75368895ac908 100644 --- a/frontend/src/scenes/insights/InsightTooltip/InsightTooltip.tsx +++ b/frontend/src/scenes/insights/InsightTooltip/InsightTooltip.tsx @@ -75,6 +75,7 @@ export function InsightTooltip({ date, timezone = 'UTC', seriesData = [], + title: _title, altTitle, altRightTitle, renderSeries, @@ -99,13 +100,9 @@ export function InsightTooltip({ const { formatPropertyValueForDisplay } = useValues(propertyDefinitionsModel) - const title: ReactNode | null = + const title: ReactNode = getTooltipTitle(seriesData, altTitle, date) || - (date - ? `${getFormattedDate(date, seriesData?.[0]?.filter?.interval)} (${ - timezone ? shortTimeZone(timezone) : 'UTC' - })` - : null) + `${getFormattedDate(_title)} ${timezone ? shortTimeZone(timezone) : 'UTC'}` const rightTitle: ReactNode | null = getTooltipTitle(seriesData, altRightTitle, date) || null if (itemizeEntitiesAsColumns) { diff --git a/frontend/src/scenes/insights/InsightTooltip/insightTooltipUtils.tsx b/frontend/src/scenes/insights/InsightTooltip/insightTooltipUtils.tsx index 58cff3667b28b..bfe8465dec719 100644 --- a/frontend/src/scenes/insights/InsightTooltip/insightTooltipUtils.tsx +++ b/frontend/src/scenes/insights/InsightTooltip/insightTooltipUtils.tsx @@ -59,6 +59,7 @@ export interface InsightTooltipProps extends Omit