diff --git a/src/routes/stocks/[tickerID]/forecast/+page.svelte b/src/routes/stocks/[tickerID]/forecast/+page.svelte index c8e42916..a18f2bf7 100644 --- a/src/routes/stocks/[tickerID]/forecast/+page.svelte +++ b/src/routes/stocks/[tickerID]/forecast/+page.svelte @@ -19,9 +19,9 @@ let index = 0; let changeRevenue = 0; - let changeNetIncome = 0; - let changeEBITDA = 0; + let changeRevenueNextYear = 0; let changeEPS = 0; + let changeEPSNextYear = 0; const price = data?.getStockQuote?.price?.toFixed(2) || 0; @@ -262,21 +262,28 @@ const estimatedRevenueAvg = data?.getAnalystEstimate[index - 1]?.estimatedRevenueAvg; const revenue = data?.getAnalystEstimate[index - 2]?.revenue; - const estimatedNetIncomeAvg = - data?.getAnalystEstimate[index - 1]?.estimatedNetIncomeAvg; - const netIncome = data?.getAnalystEstimate[index - 2]?.netIncome; - const estimatedEbitdaAvg = - data?.getAnalystEstimate[index - 1]?.estimatedEbitdaAvg; - const ebitda = data?.getAnalystEstimate[index - 2]?.ebitda; + const estimatedRevenueAvgNextYear = + data?.getAnalystEstimate[index]?.estimatedRevenueAvg; + const estimatedEpsAvg = data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg; const eps = data?.getAnalystEstimate[index - 2]?.eps; + const estimatedEPSAvgNextYear = + data?.getAnalystEstimate[index]?.estimatedEpsAvg; // Calculate percentage changes for each metric changeRevenue = calculateChange(estimatedRevenueAvg, revenue); - changeNetIncome = calculateChange(estimatedNetIncomeAvg, netIncome); - changeEBITDA = calculateChange(estimatedEbitdaAvg, ebitda); + changeRevenueNextYear = calculateChange( + estimatedRevenueAvgNextYear, + estimatedRevenueAvg, + ); changeEPS = calculateChange(estimatedEpsAvg, eps); + changeEPSNextYear = calculateChange( + estimatedEPSAvgNextYear, + estimatedEpsAvg, + ); + + console.log(estimatedEpsAvg, data?.getAnalystEstimate[index - 2]?.eps); } let optionsData = getPlotOptions() || null; @@ -520,16 +527,16 @@ {#if data?.getAnalystEstimate?.length !== 0}
-
- +
+
+ Revenue This Year +
+ from {abbreviateNumber( + data?.getAnalystEstimate[index - 2]?.revenue, + )} +
0 ? '' - : 'rotate-180'}" + : 'rotate-180 '}" fill="none" viewBox="0 0 24 24" stroke="currentColor" @@ -557,12 +574,12 @@ stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12" > + > Increased by {abbreviateNumber(changeRevenue?.toFixed(1))}%
from {abbreviateNumber( data?.getAnalystEstimate[index - 2]?.revenue, @@ -570,32 +587,40 @@
- +
+ Revenue Next Year +
{abbreviateNumber( - data?.getAnalystEstimate[index - 1] - ?.estimatedNetIncomeAvg, + data?.getAnalystEstimate[index]?.estimatedRevenueAvg, )} +
+ from {abbreviateNumber( + data?.getAnalystEstimate[index - 1] + ?.estimatedRevenueAvg, + )} +
0 ? '' - : 'rotate-180'}" + : 'rotate-180 '}" fill="none" viewBox="0 0 24 24" stroke="currentColor" @@ -607,44 +632,50 @@ stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12" > - {abbreviateNumber(changeNetIncome?.toFixed(1))}% + > Increased by + {abbreviateNumber(changeRevenueNextYear?.toFixed(1))}%
from {abbreviateNumber( - data?.getAnalystEstimate[index - 2]?.netIncome, + data?.getAnalystEstimate[index - 1]?.estimatedRevenueAvg, )}
- +
+ EPS This Year +
{abbreviateNumber( - data?.getAnalystEstimate[index - 1]?.estimatedEbitdaAvg, + data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg, )} +
+ from {data?.getAnalystEstimate[index - 2]?.eps} +
0 ? '' - : 'rotate-180'}" + : 'rotate-180 '}" fill="none" viewBox="0 0 24 24" stroke="currentColor" @@ -656,63 +687,73 @@ stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12" > - {abbreviateNumber(changeEBITDA?.toFixed(2))}% -
-
-
- from {abbreviateNumber( - data?.getAnalystEstimate[index - 2]?.ebitda, - )} -
-
-
- -
-
- {data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg} -
-
- + > Increased by {abbreviateNumber(changeEPS?.toFixed(1))}%
from {data?.getAnalystEstimate[index - 2]?.eps}
+
+
+ EPS Next Year +
+
+
+ {abbreviateNumber( + data?.getAnalystEstimate[index]?.estimatedEpsAvg, + )} +
+ from {abbreviateNumber( + data?.getAnalystEstimate[index - 1]?.estimatedEpsAvg, + )} +
+
+
+ Increased by + {abbreviateNumber(changeEPSNextYear?.toFixed(1))}% +
+
+ +