diff --git a/components/dashboard/ScrollDepth.tsx b/components/dashboard/ScrollDepth.tsx index fa53586..531bc3d 100644 --- a/components/dashboard/ScrollDepth.tsx +++ b/components/dashboard/ScrollDepth.tsx @@ -1,6 +1,6 @@ 'use client' -import { PolarAngleAxis, PolarGrid, Radar, RadarChart, Tooltip } from 'recharts' +import { Bar, BarChart, CartesianGrid, LabelList, XAxis, ResponsiveContainer, Tooltip } from 'recharts' import { BarChartIcon } from '@ciphera-net/ui' import type { GoalCountStat } from '@/lib/api/stats' @@ -22,54 +22,57 @@ export default function ScrollDepth({ goalCounts, totalPageviews }: ScrollDepthP const hasData = scrollCounts.size > 0 && totalPageviews > 0 - const chartData = [ - { label: '0%', value: 100 }, - ...THRESHOLDS.map((threshold) => ({ - label: `${threshold}%`, - value: totalPageviews > 0 ? Math.round(((scrollCounts.get(threshold) ?? 0) / totalPageviews) * 100) : 0, - })), - ] + const chartData = THRESHOLDS.map((threshold) => ({ + label: `${threshold}%`, + value: totalPageviews > 0 ? Math.round(((scrollCounts.get(threshold) ?? 0) / totalPageviews) * 100) : 0, + })) return (
+ % of visitors who scrolled this far +
{hasData ? ( -