update forecast overview page

This commit is contained in:
MuslemRahimi 2024-08-31 15:52:03 +02:00
parent 6c44831338
commit 04e4c12560
2 changed files with 13 additions and 5 deletions

View File

@ -98,7 +98,6 @@ function findIndex(data) {
const isBeforeStopIndex = index < stopIndex - 1;
const isAfterStartIndex = index >= stopIndex - 2;
dates.push(`FY${date}`);
switch (displayData) {
case "Revenue":
valueList.push(isBeforeStopIndex ? item.revenue : null);
@ -311,7 +310,7 @@ function findIndex(data) {
<div class="w-full m-auto mt-5 sm:mt-0">
<div class="flex flex-row items-center">
<label for="predictiveFundamentalsInfo" class="mr-1 cursor-pointer flex flex-row items-center text-white text-xl sm:text-3xl font-bold">
Revenue Forecast
{displayData} Forecast
</label>
<InfoModal
title={"Predictive Fundamentals"}

View File

@ -1,10 +1,18 @@
<script lang="ts">
import { numberOfUnreadNotification, displayCompanyName, stockTicker, analystEstimateComponent } from "$lib/store";
import { abbreviateNumber } from "$lib/utils";
import Lazy from "$lib/components/Lazy.svelte";
import InfoModal from "$lib/components/InfoModal.svelte";
import { Chart } from "svelte-echarts";
import { init, use } from "echarts/core";
import { LineChart } from "echarts/charts";
import { GridComponent, TooltipComponent } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";
export let data;
use([LineChart, GridComponent, TooltipComponent, CanvasRenderer]);
function findIndex(data) {
const currentYear = new Date().getFullYear();
return data.findIndex(item => item.date >= currentYear && item.revenue === null);
@ -121,13 +129,14 @@ const changeEPS = abbreviateNumber(((data?.getAnalystEstimate[index-1]?.estimate
<Lazy>
<div class="w-full m-auto sm:pb-6 sm:pt-6 {!$analystEstimateComponent ? 'hidden' : ''}">
{#await import("$lib/components/AnalystEstimate.svelte") then { default: Comp }}
<svelte:component this={Comp} {data} />
{/await}
</div>
</Lazy>
</div>
</div>
</div>