diff --git a/src/lib/highcharts.ts b/src/lib/highcharts.ts index 79d69c28..12d14db6 100644 --- a/src/lib/highcharts.ts +++ b/src/lib/highcharts.ts @@ -1,5 +1,5 @@ import Highcharts from 'highcharts'; -//import { browser } from '$app/environment'; +import { browser } from '$app/environment'; /* if (browser) { @@ -13,6 +13,15 @@ if (browser) { } */ + +if (browser) { +Highcharts.setOptions({ + lang: { + numericSymbols: ['k', 'M', 'B', 'T', 'P', 'E'] + } +}); +} + export default (node, config) => { const redraw = true; const oneToOne = true; diff --git a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte index 66996379..de1455d4 100644 --- a/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte +++ b/src/routes/stocks/[tickerID]/metrics/[slug]/+page.svelte @@ -1,17 +1,12 @@ - - - - - {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""} - {$displayCompanyName} ({$stockTicker}) Revenue Breakdown · Stocknear - - - - - - - - - +
- {#if isLoaded} -
-
-
-

- {convertToTitleCase(data?.getParams)} Revenue -

-
+
+
+
+

+ {convertToTitleCase(data?.getParams)} Revenue +

+
- {#if rawData?.length !== 0} -
- -
+ {#if rawData?.length !== 0} +
-

History

+

+ History +

-
- - - - - - - - - - - {#each tableList as item, index} - - - - - - - - - - - {/each} - -
QuarterValue - Change - Growth
- {new Date(item?.date ?? null)?.toLocaleString( - "en-US", - { - month: "short", - day: "numeric", - year: "numeric", - }, - )} - - {@html item?.value !== null && - item?.value !== undefined - ? abbreviateNumber(item?.value, false, true) - : "n/a"} - - {#if Number(item?.value - tableList[index + 1]?.value)} - {@html abbreviateNumber( - item?.value - tableList[index + 1]?.value, - false, - true, - )} - {:else} - n/a - {/if} - - {#if item?.valueGrowth > 0} - - +{item?.valueGrowth?.toFixed(2)}% - - {:else if item?.valueGrowth < 0} - - {item?.valueGrowth?.toFixed(2)}% - - {:else} - n/a - {/if} -
-
- {:else} -

+ - No data available - - {/if} - - - {:else} -
-
-
+ + + + + + + + {#each tableList as item, index} + + + + + + + + + + + {/each} + +
QuarterValue + Change + Growth
+ {new Date(item?.date ?? null)?.toLocaleString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + })} + + {@html item?.value !== null && item?.value !== undefined + ? abbreviateNumber(item?.value, false, true) + : "n/a"} + + {#if Number(item?.value - tableList[index + 1]?.value)} + {@html abbreviateNumber( + item?.value - tableList[index + 1]?.value, + false, + true, + )} + {:else} + n/a + {/if} + + {#if item?.valueGrowth > 0} + + +{item?.valueGrowth?.toFixed(2)}% + + {:else if item?.valueGrowth < 0} + + {item?.valueGrowth?.toFixed(2)}% + + {:else} + n/a + {/if} +
+

+ {:else} +

- - -

+ No data available + + {/if}
- {/if} +
- -