diff --git a/src/lib/components/AnalystEstimate.svelte b/src/lib/components/AnalystEstimate.svelte index 82e428b4..4b8d8527 100644 --- a/src/lib/components/AnalystEstimate.svelte +++ b/src/lib/components/AnalystEstimate.svelte @@ -769,7 +769,7 @@ class="no-scrollbar flex justify-start items-center w-screen sm:w-full mt-6 m-auto overflow-x-scroll pr-5 sm:pr-0" > diff --git a/src/routes/stocks/[tickerID]/+layout.svelte b/src/routes/stocks/[tickerID]/+layout.svelte index aefd71c5..b47e0014 100644 --- a/src/routes/stocks/[tickerID]/+layout.svelte +++ b/src/routes/stocks/[tickerID]/+layout.svelte @@ -899,7 +899,6 @@ >Statistics - {#if ["amd", "save", "ba", "adbe", "nflx", "pltr", "msft", "meta", "tsla", "nvda", "aapl", "gme"]?.includes($stockTicker?.toLowerCase())} changeSection("metrics")} @@ -909,7 +908,6 @@ : 'text-gray-400 sm:hover:text-white sm:hover:bg-primary sm:hover:bg-opacity-[0.95]'}" >Metrics - {/if} {#if Object?.keys(data?.getAnalystRating ?? {})?.length > 0} { }); const output = await response.json(); - return output; }; diff --git a/src/routes/stocks/[tickerID]/metrics/+page.svelte b/src/routes/stocks/[tickerID]/metrics/+page.svelte index 68a54cc4..d33ae8ab 100644 --- a/src/routes/stocks/[tickerID]/metrics/+page.svelte +++ b/src/routes/stocks/[tickerID]/metrics/+page.svelte @@ -35,15 +35,15 @@ const xData = dataset?.map((item) => item?.date); const geographicXData = geographicDataset?.map((item) => item?.date); - const categoryValues = revenueNames.map((_, index) => - dataset.map((item) => item.value[index]), + const categoryValues = revenueNames?.map((_, index) => + dataset?.map((item) => item.value[index]), ); - const geographiCategoryValues = geographicNames.map((_, index) => - geographicDataset.map((item) => item.value[index]), + const geographiCategoryValues = geographicNames?.map((_, index) => + geographicDataset?.map((item) => item.value[index]), ); const growthValues = revenueNames?.map((_, index) => - dataset.map((item) => item.valueGrowth[index]), + dataset?.map((item) => item.valueGrowth[index]), ); const geographicGrowthValues = geographicNames?.map((_, index) => geographicDataset?.map((item) => item.valueGrowth[index]), @@ -88,7 +88,7 @@ /> -
+
{/if} {:else} -
- - Currently, there are no business metrics available for {$stockTicker}. - We're working to add more data soon! -
+
+ +
+
+
+ Currently, there are no business metrics available for {$stockTicker}. +
+
+
+
+ {/if}
diff --git a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte index e463332c..0c141b44 100644 --- a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte +++ b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte @@ -67,11 +67,20 @@ containLabel: true, }, xAxis: { + type: "category", + boundaryGap: false, + data: xData, axisLabel: { color: "#fff", + formatter: function (value) { + // Assuming dates are in the format 'yyyy-mm-dd' + // Extract the month and day from the date string and convert the month to its abbreviated name + const dateParts = value.split("-"); + const year = dateParts[0].substring(2); // Extracting the last two digits of the year + const monthIndex = parseInt(dateParts[1]) - 1; // Months are zero-indexed in JavaScript Date objects + return `${monthNames[monthIndex]} '${year} `; + }, }, - data: xData, - type: "category", }, yAxis: [ { @@ -90,7 +99,7 @@ name: "Revenue", data: valueList, type: "line", - areaStyle: { opacity: 0.2 }, + areaStyle: { opacity: 0.08 }, smooth: true, symbol: "none", itemStyle: {