diff --git a/src/lib/components/RatingsChart.svelte b/src/lib/components/RatingsChart.svelte index 345baa24..0edadf7d 100644 --- a/src/lib/components/RatingsChart.svelte +++ b/src/lib/components/RatingsChart.svelte @@ -3,6 +3,7 @@ import { setCache, getCache } from "$lib/store"; import { init, use } from "echarts/core"; import { LineChart, BarChart } from "echarts/charts"; + import { monthNames } from "$lib/utils"; import { GridComponent, TooltipComponent, @@ -92,21 +93,6 @@ 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 plotData() { // Extract the time (x-axis) and close values (y-axis) @@ -237,6 +223,12 @@ 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("-"); diff --git a/src/routes/etf/[tickerID]/dividends/+page.svelte b/src/routes/etf/[tickerID]/dividends/+page.svelte index 896308d8..f1e103a4 100644 --- a/src/routes/etf/[tickerID]/dividends/+page.svelte +++ b/src/routes/etf/[tickerID]/dividends/+page.svelte @@ -5,7 +5,7 @@ etfTicker, } from "$lib/store"; import { onMount } from "svelte"; - + import { monthNames } from "$lib/utils"; import { Chart } from "svelte-echarts"; import { init, use } from "echarts/core"; import { LineChart, BarChart } from "echarts/charts"; @@ -30,7 +30,7 @@ // Combine the data into an array of objects to keep them linked const combinedData = rawData?.history?.map((item) => ({ date: item?.paymentDate, - dividend: item?.adjDividend?.toFixed(2), + dividend: item?.adjDividend?.toFixed(3), })); // Sort the combined data array based on the date @@ -41,10 +41,6 @@ const dividendList = combinedData.map((item) => item.dividend); const options = { - tooltip: { - trigger: "axis", - hideDelay: 100, // Set the delay in milliseconds - }, animation: false, grid: { 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}
Dividend Per Share: ${params[0].value}`; + }, + }, }; return options; diff --git a/src/routes/politicians/[slug]/+page.svelte b/src/routes/politicians/[slug]/+page.svelte index 674f30ff..e7fb73f8 100644 --- a/src/routes/politicians/[slug]/+page.svelte +++ b/src/routes/politicians/[slug]/+page.svelte @@ -393,9 +393,9 @@ > {#if item?.type === "Bought"} - Purchase + {item?.type} {:else if item?.type === "Sold"} - Sale + {item?.type} {:else if item?.type === "Exchange"} Exchange {/if} diff --git a/src/routes/politicians/flow-data/+page.svelte b/src/routes/politicians/flow-data/+page.svelte index 4eda3252..3c6d0a0d 100644 --- a/src/routes/politicians/flow-data/+page.svelte +++ b/src/routes/politicians/flow-data/+page.svelte @@ -1,6 +1,5 @@