From b30619e6b445ff062f6f60efd0b02dd529d1a020 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 11 Mar 2026 22:30:19 +0100 Subject: [PATCH] fix: add 0% baseline axis to scroll depth radar for pentagon shape --- components/dashboard/ScrollDepth.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/components/dashboard/ScrollDepth.tsx b/components/dashboard/ScrollDepth.tsx index 9409420..fa53586 100644 --- a/components/dashboard/ScrollDepth.tsx +++ b/components/dashboard/ScrollDepth.tsx @@ -22,10 +22,13 @@ export default function ScrollDepth({ goalCounts, totalPageviews }: ScrollDepthP const hasData = scrollCounts.size > 0 && totalPageviews > 0 - const chartData = THRESHOLDS.map((threshold) => ({ - label: `${threshold}%`, - value: totalPageviews > 0 ? Math.round(((scrollCounts.get(threshold) ?? 0) / totalPageviews) * 100) : 0, - })) + const chartData = [ + { label: '0%', value: 100 }, + ...THRESHOLDS.map((threshold) => ({ + label: `${threshold}%`, + value: totalPageviews > 0 ? Math.round(((scrollCounts.get(threshold) ?? 0) / totalPageviews) * 100) : 0, + })), + ] return (