This commit is contained in:
MuslemRahimi 2024-10-15 16:33:58 +02:00
parent b5974342cd
commit 13ca22d68f
2 changed files with 34 additions and 27 deletions

View File

@ -28,6 +28,11 @@
function findMonthlyValue(data, lastDateStr) {
if (!data || !data.sentiment) {
console.error("Sentiment is undefined or missing in the data:", data);
$retailVolumeComponent = false;
return; // Or return a default value if necessary
}
// Convert lastDateStr to Date object
const lastDate = new Date(lastDateStr);
// Set the first date to the beginning of the month of lastDate

View File

@ -36,15 +36,14 @@ let showFullStats = false;
const plotPieChart = () => {
if(rawData?.ownershipPercent !== undefined) {
shareholderList = shareholderList?.filter(item => item?.ownership <= 100);
topHolders = 0;
otherOwner = 0;
institutionalOwner = rawData?.ownershipPercent > 100 ? 99.99 : rawData?.ownershipPercent;
otherOwner = institutionalOwner === 0 ? 0 : (100-institutionalOwner);
topHolders = shareholderList?.slice(0,10)?.reduce((total, shareholder) => total + shareholder.ownership, 0);
topHolders = shareholderList?.slice(0,10)?.reduce((total, shareholder) => total + shareholder?.ownership, 0);
const options = {
animation: false,
@ -81,6 +80,8 @@ const plotPieChart = () => {
return options;
} else return null;
}
const getShareholders = async (ticker) => {
@ -185,7 +186,7 @@ let charNumber = 30;
}).format(rawData?.investorsHolding)}</span> Hedge Funds hold a total of <span class="font-semibold">{abbreviateNumber(rawData?.numberOf13Fshares)}</span> {$displayCompanyName} shares, with a combined investment of <span class="font-semibold">{abbreviateNumber(rawData?.totalInvested, true)}</span>.
</div>
{#if optionsPieChart !== null}
<div class="flex flex-row items-center sm:-mt-5">
<div class="app w-56">
<Chart {init} options={optionsPieChart} class="chart w-full" />
@ -210,6 +211,7 @@ let charNumber = 30;
</div>
</div>
</div>
{/if}
</div>
{#if putCallRatio !== 0}