diff --git a/src/lib/components/Sidecard.svelte b/src/lib/components/Sidecard.svelte index 5ec1c3a9..ac12a2be 100644 --- a/src/lib/components/Sidecard.svelte +++ b/src/lib/components/Sidecard.svelte @@ -15,9 +15,11 @@ let website = "n/a"; let snippet; + let strongBuyCount = 0; let buyCount = 0; let holdCount = 0; let sellCount = 0; + let strongSellCount = 0; let priceTarget = "n/a"; let numOfAnalyst = 0; let consensusRating = "n/a"; @@ -39,11 +41,23 @@ function plotData() { // X-axis categories - const categories = ["Sell", "Hold", "Buy"]; + const categories = [ + "Strong
Sell", + "Sell", + "Hold", + "Buy", + "Strong
Buy", + ]; // Corresponding data - const dataValues = [sellCount, holdCount, buyCount]; - const colors = ["#FF4C4C", "#F5B700", "#008A00"]; + const dataValues = [ + strongSellCount, + sellCount, + holdCount, + buyCount, + strongBuyCount, + ]; + const colors = ["#FF4C4C", "#FF4C4C", "#F5B700", "#008A00", "#008A00"]; const options = { chart: { @@ -54,7 +68,8 @@ animation: false, }, title: { - text: `
Price Target: $${priceTarget}
+ text: `
Price Target: $${priceTarget}
+
(${changesPercentage}% ${changesPercentage >= 0 ? "upside" : "downside"})
Analyst Consensus: ${consensusRating ?? "n/a"}
`, style: { color: "white", @@ -67,7 +82,8 @@ categories: categories, gridLineWidth: 0, labels: { - style: { color: "white" }, + rotation: 0, + style: { color: "white", fontSize: "12.5px" }, }, }, yAxis: { @@ -100,7 +116,7 @@ let tooltipContent = ""; this.points.forEach((point) => { tooltipContent += ` - ${point.key}: + ${point.key?.replace("
", " ")}:
${point.y}
`; }); @@ -157,9 +173,12 @@ snippet = description?.slice(0, 450) + "..."; numOfAnalyst = data?.getAnalystSummary?.numOfAnalyst; - buyCount = data?.getAnalystSummary?.Buy; - holdCount = data?.getAnalystSummary?.Hold; - sellCount = data?.getAnalystSummary?.Sell; + strongBuyCount = data?.getAnalystSummary?.strongBuy || 0; + buyCount = data?.getAnalystSummary?.buy || 0; + holdCount = data?.getAnalystSummary?.hold || 0; + sellCount = data?.getAnalystSummary?.sell || 0; + strongSellCount = data?.getAnalystSummary?.strongSell || 0; + priceTarget = data?.getAnalystSummary?.medianPriceTarget !== ("n/a" && 0) ? data?.getAnalystSummary?.medianPriceTarget @@ -276,7 +295,7 @@

diff --git a/src/routes/potus-tracker/+page.svelte b/src/routes/potus-tracker/+page.svelte index 08b4e834..7861e7cd 100644 --- a/src/routes/potus-tracker/+page.svelte +++ b/src/routes/potus-tracker/+page.svelte @@ -158,8 +158,8 @@ enabled: true, color: "white", style: { - fontSize: "13px", - fontWeight: "bold", + fontSize: "14px", + fontWeight: "normal", }, formatter: function () { return this.y.toFixed(2) + "%"; // Add percentage symbol @@ -178,11 +178,13 @@ { value: 0, // Values below 0 color: "#E02424", // Red + borderRadius: "0px", borderColor: "#E02424", // Red border }, { color: "#10B981", // Green for values 0 and above borderColor: "#10B981", // Green border + borderRadius: "0px", }, ], },