From f8d19a38e5b90de18b95c9160eb86fb068e9a4ed Mon Sep 17 00:00:00 2001 From: Marek Mihok Date: Tue, 7 Jun 2022 09:44:22 +0200 Subject: [PATCH] fix: Ranged plot tooltip values are not shown properly #1473 (#1486) --- ui/src/plot.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/src/plot.tsx b/ui/src/plot.tsx index bd184d412c..f35c0f4a37 100644 --- a/ui/src/plot.tsx +++ b/ui/src/plot.tsx @@ -1038,7 +1038,12 @@ const PlotTooltip = ({ items }: { items: TooltipItem[] }) => {item}: - {data[item] instanceof Date ? data[item].toISOString().split('T')[0] : data[item]} + + {(Array.isArray(data[item]) ? data[item] : [data[item]]).map((val: any, idx: number) => { + const value = val instanceof Date ? val.toISOString().split('T')[0] : val + return idx > 0 ? ` - ${value}` : value + })} + )