diff --git a/src/lib/components/AnalystEstimate.svelte b/src/lib/components/AnalystEstimate.svelte index 70aeb44a..81e34c3d 100644 --- a/src/lib/components/AnalystEstimate.svelte +++ b/src/lib/components/AnalystEstimate.svelte @@ -40,21 +40,6 @@ function findIndex(data) { displayData = event.target.value; } - function normalizer(value) { - if (Math?.abs(value) >= 1e18) { - return { unit: "Q", denominator: 1e18 }; - } else if (Math?.abs(value) >= 1e12) { - return { unit: "T", denominator: 1e12 }; - } else if (Math?.abs(value) >= 1e9) { - return { unit: "B", denominator: 1e9 }; - } else if (Math?.abs(value) >= 1e6) { - return { unit: "M", denominator: 1e6 }; - } else if (Math?.abs(value) >= 1e5) { - return { unit: "K", denominator: 1e5 }; - } else { - return { unit: "", denominator: 1 }; - } - } let tableDataActual = []; let tableDataForecast = []; @@ -115,7 +100,6 @@ function findIndex(data) { } // Normalize the data if needed (not required in this case, but leaving it here for reference) - const { unit, denominator } = normalizer(Math.max(...valueList, ...avgList) ?? 0); const option = { silent: true, @@ -139,23 +123,18 @@ function findIndex(data) { color: "#fff", }, }, - yAxis: { - type: "value", + yAxis: [ + { + type: 'value', splitLine: { - show: false, // Disable x-axis grid lines + show: false, // Disable x-axis grid lines }, + axisLabel: { - color: "#fff", // Change label color to white - formatter: function (value, index) { - // Display every second tick - if (index % 2 === 0) { - return (value / denominator)?.toFixed(0) + unit; // Format value in millions - } else { - return ""; // Hide this tick - } - }, - }, + show: false // Hide y-axis labels + } }, + ], series: [ { name: "Actual", diff --git a/src/lib/components/PriceAnalysis.svelte b/src/lib/components/PriceAnalysis.svelte index ff598f34..38c141f0 100644 --- a/src/lib/components/PriceAnalysis.svelte +++ b/src/lib/components/PriceAnalysis.svelte @@ -37,7 +37,6 @@ let r2Score; let mape; let priceSentiment = 'n/a'; - let displayData = 'threeMonth'; let lastPrice = 'n/a'; let oneYearPricePrediction = 'n/a'; let optionsData; @@ -59,6 +58,10 @@ function getPlotOptions() { bottom: $screenWidth < 640 ? '0%' : '5%', containLabel: true }, + tooltip: { + trigger: 'axis', + hideDelay: 100, // Set the delay in milliseconds + }, xAxis: { type: 'category', boundaryGap: false, @@ -75,17 +78,31 @@ function getPlotOptions() { } } }, - yAxis: { - type: 'value', - splitLine: { - show: false, - }, - axisLabel: { - color: '#fff', - } - }, - series: [ + yAxis: [ { + type: 'value', + splitLine: { + show: false, // Disable x-axis grid lines + }, + + axisLabel: { + show: false // Hide y-axis labels + } + }, + ], + series: [ + { + name: 'Stock Price', + data: historicalPrice, + showSymbol: false, + smooth: true, + type: 'line', + itemStyle: { + color: "#fff" + } + }, + { + name: 'Upperband', data: upperBand, showSymbol: false, smooth: true, @@ -98,6 +115,7 @@ function getPlotOptions() { } }, { + name: 'Lowerband', data: lowerBand, showSymbol: false, smooth: true, @@ -121,15 +139,6 @@ function getPlotOptions() { } }, */ - { - data: historicalPrice, - showSymbol: false, - smooth: true, - type: 'line', - itemStyle: { - color: "#fff" - } - } ] }; diff --git a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte index 6332cf2d..f1d71d2e 100644 --- a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte +++ b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte @@ -249,10 +249,10 @@ changeTab(0)
{#each (data?.user?.tier === 'Pro' ? historyList : historyList?.slice(0,3)) as item,index} -|
@@ -262,7 +224,7 @@ onMount(async () => {
@@ -294,95 +256,7 @@ onMount(async () => {
-
- {#each senateTradingList as item}
-
{#if rawData?.length >= 20}
{/if}
-
-
- {/each}
-
-
-
- {#if item?.party === 'Republican'}
-
-
-
-
-
-
-
-
-
-
-
- {item?.representative?.replace('_',' ')}
-
-
- {item?.party ?? 'n/a'} / {district[item?.representative] ?? 'n/a'}
-
-
-
-
-
-
-
-
-
- Owner
-
- {item?.owner?.length !== 0 ? item?.owner : '-'}
-
-
-
-
-
-
-
-
- Transaction Date
-
- {new Date(item?.transactionDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
-
-
-
-
- Disclosure Date
-
- {new Date(item?.disclosureDate)?.toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
-
-
-
-
-
-
- Amount
-
- {item?.amount?.replace("$1,000,001 - $5,000,000","$1Mio - $5Mio")}
-
-
-
-
- Type
-
- {#if item?.type === 'Bought'}
- Bought
- {:else if item?.type === 'Sold'}
- Sold
- {:else if item?.type === 'Exchange'}
- Exchange
- {/if}
-
-
-
diff --git a/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte b/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte
index 0fc003cb..e8592073 100644
--- a/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte
+++ b/src/routes/stocks/[tickerID]/stats/ratios/+page.svelte
@@ -2,6 +2,8 @@
import { Chart } from 'svelte-echarts'
import {numberOfUnreadNotification, displayCompanyName, stockTicker} from '$lib/store';
import { abbreviateNumber } from '$lib/utils';
+import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
+import { Button } from "$lib/components/shadcn/button/index.js";
//import * as XLSX from 'xlsx';
import { init, use } from 'echarts/core'
import { LineChart, BarChart } from 'echarts/charts'
@@ -126,7 +128,6 @@ const statementConfig = [
];
-let namingList = statementConfig?.map(config => config?.propertyName) || [];
function toggleMode()
{
@@ -204,21 +205,16 @@ function plotData()
type: 'category',
},
yAxis: [
- {
+ {
type: 'value',
splitLine: {
- show: false, // Disable x-axis grid lines
+ show: false, // Disable x-axis grid lines
},
+
axisLabel: {
- color: '#fff', // Change label color to white
+ show: false // Hide y-axis labels
+ }
},
- },
- {
- type: 'value',
- splitLine: {
- show: false, // Disable x-axis grid lines
- },
- },
],
series: [
{
@@ -237,53 +233,7 @@ function plotData()
return options;
}
-/*
-const exportData = (format = 'csv') => {
- const data = fullStatement;
- if (!data || data.length === 0) {
- return;
- }
- let properties = [
- { key: "calendarYear", label: "Year" },
- ];
-
- for (let i = 0; i < statementConfig?.length; i++) {
- properties.push({ key: statementConfig[i]?.propertyName, label: statementConfig[i]?.label })
- }
-
- // Helper function to handle special cases
-
-
- // Create rows for CSV/Excel
- let rows = data.map(item => properties?.map(property => item[property?.key] || 0));
-
- // Include headers
- const headers = properties.map(prop => prop.label);
- rows.unshift(headers);
-
-
- // Check the format to export
- if (format.toLowerCase() === 'csv') {
- const csvContent = rows.map(row => row.join(",")).join("\n");
- const blob = new Blob([csvContent], { type: "data:text/csv;charset=utf-8" });
- const url = URL.createObjectURL(blob);
- const a = document.createElement("a");
- a.href = url;
- a.download = $stockTicker.toLowerCase() + "-ratios-statement.csv";
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
- URL.revokeObjectURL(url);
- } else if (format.toLowerCase() === 'excel') {
- const worksheet = XLSX.utils.aoa_to_sheet(rows);
- const workbook = XLSX.utils.book_new();
- XLSX.utils.book_append_sheet(workbook, worksheet, "Ratios Statement");
- XLSX.writeFile(workbook, `${$stockTicker.toLowerCase()}-ratios-statement.xlsx`);
- }
-};
-
-*/
fullStatement = data?.getRatiosStatement;
@@ -404,12 +354,42 @@ $: {
-
+
+
+
+
+ |