diff --git a/src/lib/components/DarkPool/HistoricalVolume.svelte b/src/lib/components/DarkPool/HistoricalVolume.svelte
index 124cebb4..078d75c8 100644
--- a/src/lib/components/DarkPool/HistoricalVolume.svelte
+++ b/src/lib/components/DarkPool/HistoricalVolume.svelte
@@ -2,7 +2,7 @@
import { displayCompanyName, stockTicker, etfTicker } from "$lib/store";
import InfoModal from "$lib/components/InfoModal.svelte";
import { Chart } from "svelte-echarts";
- import { abbreviateNumber, formatDateRange } from "$lib/utils";
+ import { abbreviateNumber, formatDateRange, monthNames } from "$lib/utils";
import { init, use } from "echarts/core";
import { LineChart } from "echarts/charts";
import { GridComponent, TooltipComponent } from "echarts/components";
@@ -12,7 +12,6 @@
export let rawData = [];
- let isLoaded = false;
let optionsData;
let avgVolume = 0;
let avgShortVolume = 0;
@@ -110,12 +109,24 @@
top: "5%",
containLabel: true,
},
- xAxis: {
- type: "category",
- boundaryGap: false,
- data: dates,
- axisLabel: { color: "#fff" },
- },
+ xAxis: [
+ {
+ type: "category",
+ data: dates,
+ axisLabel: {
+ color: "#fff",
+
+ formatter: function (value) {
+ // Assuming dates are in the format 'yyyy-mm-dd'
+ const dateParts = value.split("-");
+ const monthIndex = parseInt(dateParts[1]) - 1; // Months are zero-indexed in JavaScript Date objects
+ const year = parseInt(dateParts[0]);
+ const day = parseInt(dateParts[2]);
+ return `${day} ${monthNames[monthIndex]} ${year}`;
+ },
+ },
+ },
+ ],
yAxis: [
{
type: "value",
@@ -143,10 +154,8 @@
};
}
- $: if (typeof window !== "undefined" && ($stockTicker || $etfTicker)) {
- isLoaded = false;
+ $: if ($stockTicker || $etfTicker) {
optionsData = getPlotOptions();
- isLoaded = true;
}
@@ -166,132 +175,118 @@
/>
- {#if isLoaded}
- {#if rawData?.length !== 0}
-
-
- Over the past 12 months, {$displayCompanyName} has experienced an average
- dark pool trading volume of
- {abbreviateNumber(avgVolume)}
- shares. Out of this total, an average of
- {abbreviateNumber(avgShortVolume)}
- shares, constituting approximately
- {((avgShortVolume / avgVolume) * 100)?.toFixed(2)}%, were short volume.
-
+ {#if rawData?.length !== 0}
+
+
+ Over the past 12 months, {$displayCompanyName} has experienced an average
+ dark pool trading volume of
+ {abbreviateNumber(avgVolume)}
+ shares. Out of this total, an average of
+ {abbreviateNumber(avgShortVolume)}
+ shares, constituting approximately
+ {((avgShortVolume / avgVolume) * 100)?.toFixed(2)}%, were short volume.
- {$displayCompanyName} has seen an average dark pool trade size of {@html abbreviateNumberWithColor(
- metrics?.avgTradeSize,
- false,
- true,
- )} and an average premium per trade of {@html abbreviateNumberWithColor(
- metrics?.avgPremTrade,
- false,
- true,
- )}, with a total premium of {@html abbreviateNumberWithColor(
- metrics?.totalPrem,
- false,
- true,
- )}.
-
+ {$displayCompanyName} has seen an average dark pool trade size of {@html abbreviateNumberWithColor(
+ metrics?.avgTradeSize,
+ false,
+ true,
+ )} and an average premium per trade of {@html abbreviateNumberWithColor(
+ metrics?.avgPremTrade,
+ false,
+ true,
+ )}, with a total premium of {@html abbreviateNumberWithColor(
+ metrics?.totalPrem,
+ false,
+ true,
+ )}.
+
-
-
-
- {#each ["Size", "Premium"] as item}
-
- {/each}
-