ui fixes
This commit is contained in:
parent
8ebdf11682
commit
32a2518518
@ -3,6 +3,7 @@
|
|||||||
import { setCache, getCache } from "$lib/store";
|
import { setCache, getCache } from "$lib/store";
|
||||||
import { init, use } from "echarts/core";
|
import { init, use } from "echarts/core";
|
||||||
import { LineChart, BarChart } from "echarts/charts";
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
|
import { monthNames } from "$lib/utils";
|
||||||
import {
|
import {
|
||||||
GridComponent,
|
GridComponent,
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
@ -92,21 +93,6 @@
|
|||||||
optionsData = plotData();
|
optionsData = plotData();
|
||||||
}
|
}
|
||||||
|
|
||||||
const monthNames = [
|
|
||||||
"Jan",
|
|
||||||
"Feb",
|
|
||||||
"Mar",
|
|
||||||
"Apr",
|
|
||||||
"May",
|
|
||||||
"Jun",
|
|
||||||
"Jul",
|
|
||||||
"Aug",
|
|
||||||
"Sep",
|
|
||||||
"Oct",
|
|
||||||
"Nov",
|
|
||||||
"Dec",
|
|
||||||
];
|
|
||||||
|
|
||||||
// Function to plot data based on a specified time period
|
// Function to plot data based on a specified time period
|
||||||
function plotData() {
|
function plotData() {
|
||||||
// Extract the time (x-axis) and close values (y-axis)
|
// Extract the time (x-axis) and close values (y-axis)
|
||||||
@ -237,6 +223,12 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
formatter: function (params) {
|
formatter: function (params) {
|
||||||
const date = params[0].name; // Get the date from the x-axis value
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
const dateParts = date.split("-");
|
const dateParts = date.split("-");
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
etfTicker,
|
etfTicker,
|
||||||
} from "$lib/store";
|
} from "$lib/store";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
import { monthNames } from "$lib/utils";
|
||||||
import { Chart } from "svelte-echarts";
|
import { Chart } from "svelte-echarts";
|
||||||
import { init, use } from "echarts/core";
|
import { init, use } from "echarts/core";
|
||||||
import { LineChart, BarChart } from "echarts/charts";
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
@ -30,7 +30,7 @@
|
|||||||
// Combine the data into an array of objects to keep them linked
|
// Combine the data into an array of objects to keep them linked
|
||||||
const combinedData = rawData?.history?.map((item) => ({
|
const combinedData = rawData?.history?.map((item) => ({
|
||||||
date: item?.paymentDate,
|
date: item?.paymentDate,
|
||||||
dividend: item?.adjDividend?.toFixed(2),
|
dividend: item?.adjDividend?.toFixed(3),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Sort the combined data array based on the date
|
// Sort the combined data array based on the date
|
||||||
@ -41,10 +41,6 @@
|
|||||||
const dividendList = combinedData.map((item) => item.dividend);
|
const dividendList = combinedData.map((item) => item.dividend);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
hideDelay: 100, // Set the delay in milliseconds
|
|
||||||
},
|
|
||||||
animation: false,
|
animation: false,
|
||||||
grid: {
|
grid: {
|
||||||
left: "3%",
|
left: "3%",
|
||||||
@ -86,6 +82,27 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
const dateParts = date.split("-");
|
||||||
|
const year = dateParts[0];
|
||||||
|
const monthIndex = parseInt(dateParts[1]) - 1;
|
||||||
|
const day = dateParts[2];
|
||||||
|
const formattedDate = `${monthNames[monthIndex]} ${day}, ${year}`;
|
||||||
|
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${formattedDate}<br/> Dividend Per Share: ${params[0].value}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
|||||||
@ -393,9 +393,9 @@
|
|||||||
>
|
>
|
||||||
<span class="font-semibold">
|
<span class="font-semibold">
|
||||||
{#if item?.type === "Bought"}
|
{#if item?.type === "Bought"}
|
||||||
<span class="text-[#57D7BA]">Purchase</span>
|
<span class="text-[#00FC50]">{item?.type}</span>
|
||||||
{:else if item?.type === "Sold"}
|
{:else if item?.type === "Sold"}
|
||||||
<span class="text-[#fe5555]">Sale</span>
|
<span class="text-[#FF2F1F]">{item?.type}</span>
|
||||||
{:else if item?.type === "Exchange"}
|
{:else if item?.type === "Exchange"}
|
||||||
<span class="text-[#C6A755]">Exchange</span>
|
<span class="text-[#C6A755]">Exchange</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { formatString } from "$lib/utils";
|
import { formatString } from "$lib/utils";
|
||||||
import { getPartyForPoliticians } from "$lib/utils";
|
|
||||||
import { screenWidth, numberOfUnreadNotification } from "$lib/store";
|
import { screenWidth, numberOfUnreadNotification } from "$lib/store";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
|
import HoverStockChart from "$lib/components/HoverStockChart.svelte";
|
||||||
@ -175,7 +174,7 @@
|
|||||||
<th
|
<th
|
||||||
class="{index % 2
|
class="{index % 2
|
||||||
? 'bg-[#09090B]'
|
? 'bg-[#09090B]'
|
||||||
: 'bg-primary'} text-white text-sm sm:text-[1rem] whitespace-nowrap"
|
: 'bg-secondary'} text-white text-sm sm:text-[1rem] whitespace-nowrap"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row items-center">
|
<div class="flex flex-row items-center">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
stockTicker,
|
stockTicker,
|
||||||
} from "$lib/store";
|
} from "$lib/store";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
import { monthNames } from "$lib/utils";
|
||||||
import { Chart } from "svelte-echarts";
|
import { Chart } from "svelte-echarts";
|
||||||
import { init, use } from "echarts/core";
|
import { init, use } from "echarts/core";
|
||||||
import { LineChart, BarChart } from "echarts/charts";
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
@ -30,7 +30,7 @@
|
|||||||
// Combine the data into an array of objects to keep them linked
|
// Combine the data into an array of objects to keep them linked
|
||||||
const combinedData = rawData?.history?.map((item) => ({
|
const combinedData = rawData?.history?.map((item) => ({
|
||||||
date: item?.paymentDate,
|
date: item?.paymentDate,
|
||||||
dividend: item?.adjDividend?.toFixed(2),
|
dividend: item?.adjDividend?.toFixed(3),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Sort the combined data array based on the date
|
// Sort the combined data array based on the date
|
||||||
@ -38,13 +38,9 @@
|
|||||||
|
|
||||||
// Separate the sorted data back into individual arrays
|
// Separate the sorted data back into individual arrays
|
||||||
const dates = combinedData.map((item) => item.date);
|
const dates = combinedData.map((item) => item.date);
|
||||||
const dividendList = combinedData.map((item) => item.dividend);
|
const dividendList = combinedData?.map((item) => item.dividend);
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
tooltip: {
|
|
||||||
trigger: "axis",
|
|
||||||
hideDelay: 100, // Set the delay in milliseconds
|
|
||||||
},
|
|
||||||
animation: false,
|
animation: false,
|
||||||
grid: {
|
grid: {
|
||||||
left: "3%",
|
left: "3%",
|
||||||
@ -86,6 +82,27 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
const dateParts = date.split("-");
|
||||||
|
const year = dateParts[0];
|
||||||
|
const monthIndex = parseInt(dateParts[1]) - 1;
|
||||||
|
const day = dateParts[2];
|
||||||
|
const formattedDate = `${monthNames[monthIndex]} ${day}, ${year}`;
|
||||||
|
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${formattedDate}<br/> Dividend Per Share: ${params[0].value}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
|||||||
@ -265,6 +265,21 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${date}<br/> ${
|
||||||
|
statementConfig?.find(
|
||||||
|
(item) => item?.propertyName === displayStatement,
|
||||||
|
)?.label
|
||||||
|
}: ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -320,6 +320,21 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${date}<br/> ${
|
||||||
|
statementConfig?.find(
|
||||||
|
(item) => item?.propertyName === displayStatement,
|
||||||
|
)?.label
|
||||||
|
}: ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -266,6 +266,21 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${date}<br/> ${
|
||||||
|
statementConfig?.find(
|
||||||
|
(item) => item?.propertyName === displayStatement,
|
||||||
|
)?.label
|
||||||
|
}: ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -224,6 +224,21 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${date}<br/> ${
|
||||||
|
statementConfig?.find(
|
||||||
|
(item) => item?.propertyName === displayStatement,
|
||||||
|
)?.label
|
||||||
|
}: ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,9 @@
|
|||||||
displayCompanyName,
|
displayCompanyName,
|
||||||
stockTicker,
|
stockTicker,
|
||||||
} from "$lib/store";
|
} from "$lib/store";
|
||||||
import { abbreviateNumber } from "$lib/utils";
|
import { abbreviateNumber, monthNames } from "$lib/utils";
|
||||||
|
|
||||||
import { Chart } from "svelte-echarts";
|
import { Chart } from "svelte-echarts";
|
||||||
|
|
||||||
import { init, use } from "echarts/core";
|
import { init, use } from "echarts/core";
|
||||||
import { LineChart, BarChart } from "echarts/charts";
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
import { GridComponent, TooltipComponent } from "echarts/components";
|
import { GridComponent, TooltipComponent } from "echarts/components";
|
||||||
@ -102,6 +101,23 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
const dateParts = date.split("-");
|
||||||
|
const year = dateParts[0];
|
||||||
|
const monthIndex = parseInt(dateParts[1]) - 1;
|
||||||
|
const day = dateParts[2];
|
||||||
|
const formattedDate = `${monthNames[monthIndex]} ${day}, ${year}`;
|
||||||
|
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${formattedDate}<br/> Revenue: ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,18 @@
|
|||||||
|
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${date}<br/> Employees: ${params[0].value?.toLocaleString("en-US")}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
displayCompanyName,
|
displayCompanyName,
|
||||||
stockTicker,
|
stockTicker,
|
||||||
} from "$lib/store";
|
} from "$lib/store";
|
||||||
import { abbreviateNumber } from "$lib/utils";
|
import { abbreviateNumber, monthNames } from "$lib/utils";
|
||||||
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
|
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.js";
|
||||||
import { Button } from "$lib/components/shadcn/button/index.js";
|
import { Button } from "$lib/components/shadcn/button/index.js";
|
||||||
//import * as XLSX from 'xlsx';
|
//import * as XLSX from 'xlsx';
|
||||||
@ -311,6 +311,23 @@
|
|||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
hideDelay: 100,
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const date = params[0].name; // Get the date from the x-axis value
|
||||||
|
const dateParts = date.split("-");
|
||||||
|
const year = dateParts[0];
|
||||||
|
const monthIndex = parseInt(dateParts[1]) - 1;
|
||||||
|
const day = dateParts[2];
|
||||||
|
const formattedDate = `${monthNames[monthIndex]} ${day}, ${year}`;
|
||||||
|
|
||||||
|
// Return the tooltip content
|
||||||
|
return `${formattedDate}<br/> ${abbreviateNumber(params[0].value)}`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user