diff --git a/src/routes/stocks/[tickerID]/+layout.svelte b/src/routes/stocks/[tickerID]/+layout.svelte index 280bdf8d..62ea784a 100644 --- a/src/routes/stocks/[tickerID]/+layout.svelte +++ b/src/routes/stocks/[tickerID]/+layout.svelte @@ -804,7 +804,7 @@ function handleTypeOfTrade(state:string) : 'bg-[#09090B]'} mt-1 h-[3px] rounded-full w-[2rem]" /> - {#if $stockTicker?.toLowerCase() === "nvda"} + {#if ["nvda", "aapl", "gme"]?.includes($stockTicker?.toLowerCase())}
  • + name?.toLowerCase()?.replace(/[ &]+/g, "-"), + ) || []; + let isLoaded = false; let optionsData; @@ -95,34 +99,12 @@ isLoaded = false; dataset = []; tableList = []; - + // Find the index of the current getParams value in the names array + const index = names?.indexOf(data.getParams); dataset = rawData?.map((entry) => ({ date: entry.date, - value: - data?.getParams === "data-center" - ? entry?.value[0] - : data?.getParams === "gaming" - ? entry?.value[1] - : data?.getParams === "visualization" - ? entry?.value[2] - : data?.getParams === "automotive" - ? entry?.value[3] - : data?.getParams === "oem-other" - ? entry?.value[4] - : null, - - valueGrowth: - data?.getParams === "data-center" - ? entry?.valueGrowth[0] - : data?.getParams === "gaming" - ? entry?.valueGrowth[1] - : data?.getParams === "visualization" - ? entry?.valueGrowth[2] - : data?.getParams === "automotive" - ? entry?.valueGrowth[3] - : data?.getParams === "oem-other" - ? entry?.valueGrowth[4] - : null, + value: index !== -1 ? entry.value[index] : null, + valueGrowth: index !== -1 ? entry.valueGrowth[index] : null, })); tableList = [...dataset]; @@ -130,6 +112,7 @@ tableList = tableList?.sort( (a, b) => new Date(b?.date) - new Date(a?.date), ); + optionsData = plotData(); isLoaded = true; }