update hoverstockchart
This commit is contained in:
parent
23532be1c4
commit
cadc223699
@ -6,7 +6,7 @@
|
|||||||
import { Chart, BaselineSeries, PriceLine } from "svelte-lightweight-charts";
|
import { Chart, BaselineSeries, PriceLine } from "svelte-lightweight-charts";
|
||||||
import { screenWidth } from "$lib/store";
|
import { screenWidth } from "$lib/store";
|
||||||
import { abbreviateNumber } from "$lib/utils";
|
import { abbreviateNumber } from "$lib/utils";
|
||||||
|
import { afterUpdate } from "svelte";
|
||||||
export let stockChartData;
|
export let stockChartData;
|
||||||
export let symbol;
|
export let symbol;
|
||||||
|
|
||||||
@ -108,10 +108,18 @@
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($screenWidth && chart && typeof window !== "undefined") {
|
afterUpdate(async () => {
|
||||||
|
if (
|
||||||
|
$screenWidth &&
|
||||||
|
stockChartData &&
|
||||||
|
chart &&
|
||||||
|
typeof window !== "undefined"
|
||||||
|
) {
|
||||||
console.log("yes");
|
console.log("yes");
|
||||||
|
|
||||||
chart?.timeScale()?.fitContent();
|
chart?.timeScale()?.fitContent();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div on:mouseover>
|
<div on:mouseover>
|
||||||
@ -131,7 +139,7 @@
|
|||||||
>
|
>
|
||||||
</HoverCard.Trigger>
|
</HoverCard.Trigger>
|
||||||
</div>
|
</div>
|
||||||
<HoverCard.Content class="w-80 bg-[#09090B] border border-gray-600">
|
<HoverCard.Content class=" w-96 bg-[#09090B] border border-gray-400">
|
||||||
<div class="flex justify-between space-x-4 w-full text-white">
|
<div class="flex justify-between space-x-4 w-full text-white">
|
||||||
<div class="space-y-1 w-full">
|
<div class="space-y-1 w-full">
|
||||||
<!--Hover Stock Chart-->
|
<!--Hover Stock Chart-->
|
||||||
@ -187,7 +195,7 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{#if priceData?.length > 0}
|
{#if priceData?.length > 0}
|
||||||
<div class="w-[50%]">
|
<div class="w-[40%]">
|
||||||
<Chart
|
<Chart
|
||||||
{...options}
|
{...options}
|
||||||
{...theme.chart}
|
{...theme.chart}
|
||||||
|
|||||||
@ -53,7 +53,6 @@ export const secFilingsClicked = writable(<boolean>false);
|
|||||||
export const discordMembers = writable(<Number>380);
|
export const discordMembers = writable(<Number>380);
|
||||||
|
|
||||||
export const newAvatar = writable(<string>"");
|
export const newAvatar = writable(<string>"");
|
||||||
|
|
||||||
export const displayCompanyName = writable(<string>"");
|
export const displayCompanyName = writable(<string>"");
|
||||||
export const currentPrice = writable(<number>0);
|
export const currentPrice = writable(<number>0);
|
||||||
export const currentPortfolioPrice = writable(<number>0);
|
export const currentPortfolioPrice = writable(<number>0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user