From 317cf73b1a6b72cedf610bb5469d5e2d80104cbb Mon Sep 17 00:00:00 2001 From: Manish Gupta Date: Tue, 17 Sep 2024 12:59:51 +0200 Subject: [PATCH] economics - chart tooltip fixes --- .../layout/Economics/BreakdownCharts.tsx | 32 +++++++++---------- components/layout/Economics/HeadCharts.tsx | 6 ++-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/components/layout/Economics/BreakdownCharts.tsx b/components/layout/Economics/BreakdownCharts.tsx index 40f30f5b..4933e5f8 100644 --- a/components/layout/Economics/BreakdownCharts.tsx +++ b/components/layout/Economics/BreakdownCharts.tsx @@ -258,8 +258,8 @@ function BreakdownCharts({ }); } - const tooltip = `
-
${dateString}
`; + const tooltip = `
+
${dateString}
`; const tooltipEnd = `
`; // let pointsSum = 0; @@ -305,7 +305,7 @@ function BreakdownCharts({ if (selectedScale === "percentage") return ` -
+
${name}
${Highcharts.numberFormat( @@ -332,10 +332,10 @@ function BreakdownCharts({ if (name === "Revenue" || name === "Costs") { return ` -
-
-
+
+
+
+
${name}
@@ -350,10 +350,10 @@ function BreakdownCharts({
${lastIndex - ? `
-
-
+ ? `
+
+
+
${"Profit"}
@@ -372,7 +372,7 @@ function BreakdownCharts({ `; } else { return ` -
+
@@ -402,7 +402,7 @@ function BreakdownCharts({ const sumRow = selectedScale === "stacked" ? ` -
+
Total
@@ -468,18 +468,18 @@ function BreakdownCharts({ if (pointX - tooltipWidth / 2 < plotLeft) { return { x: plotLeft, - y: -250, + y: -20, }; } if (pointX + tooltipWidth / 2 > plotLeft + plotWidth) { return { x: plotLeft + plotWidth - tooltipWidth, - y: -250, + y: -20, }; } return { x: pointX - tooltipWidth / 2, - y: -250, + y: -20, }; } diff --git a/components/layout/Economics/HeadCharts.tsx b/components/layout/Economics/HeadCharts.tsx index b3f1c1ee..d4a12ef1 100644 --- a/components/layout/Economics/HeadCharts.tsx +++ b/components/layout/Economics/HeadCharts.tsx @@ -249,18 +249,18 @@ export default function EconHeadCharts({ if (pointX - tooltipWidth / 2 < plotLeft) { return { x: plotLeft, - y: -250, + y: -20, }; } if (pointX + tooltipWidth / 2 > plotLeft + plotWidth) { return { x: plotLeft + plotWidth - tooltipWidth, - y: -250, + y: -20, }; } return { x: pointX - tooltipWidth / 2, - y: -250, + y: -20, }; }