From fa9e2a172673fe98e41a93db47e25afdebe35130 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 27 Nov 2024 16:29:43 +0100 Subject: [PATCH] ui fix --- src/lib/components/AnalystEstimate.svelte | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/lib/components/AnalystEstimate.svelte b/src/lib/components/AnalystEstimate.svelte index 2314c5c4..3b75ba17 100644 --- a/src/lib/components/AnalystEstimate.svelte +++ b/src/lib/components/AnalystEstimate.svelte @@ -506,12 +506,22 @@ const high = highList[dataIndex]; const low = lowList[dataIndex]; - return ` - ${dates[dataIndex]}
- High: ${high ? high?.toFixed(2) : "N/A"}
- Avg: ${mainValue?.toFixed(2)}
- Low: ${low ? low?.toFixed(2) : "N/A"} - `; + // Only show High and Low if they are not "N/A" + let tooltipContent = `${dates[dataIndex]}
`; + + if (high && high !== "N/A") { + tooltipContent += `High: ${high.toFixed(2)}
`; + } + + if (mainValue && mainValue !== "N/A") { + tooltipContent += `Avg: ${mainValue.toFixed(2)}
`; + } + + if (low && low !== "N/A") { + tooltipContent += `Low: ${low.toFixed(2)}
`; + } + + return tooltipContent; }, }, };