diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index ad857e6..3af6270 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -10,7 +10,6 @@ import { CartesianGrid, Tooltip, ResponsiveContainer, - ReferenceLine, } from 'recharts' import type { TooltipProps } from 'recharts' import { formatNumber, formatDuration, formatUpdatedAgo } from '@ciphera-net/ui' @@ -92,13 +91,6 @@ function formatAxisDuration(seconds: number): string { return `${s}s` } -function formatAvgLabel(value: number, metric: MetricType): string { - if (metric === 'bounce_rate') return `${Math.round(value)}%` - if (metric === 'avg_duration') return formatAxisDuration(value) - if (metric === 'visitors' || metric === 'pageviews') return formatAxisValue(Math.round(value)) - return formatAxisValue(value) -} - function getPrevDateRangeLabel(dateRange: { start: string; end: string }): string { const startDate = new Date(dateRange.start) const endDate = new Date(dateRange.end) @@ -295,10 +287,6 @@ export default function Chart({ const prevPeriodLabel = prevData?.length ? getPrevDateRangeLabel(dateRange) : '' const trendContext = getTrendContext(dateRange) - const avg = chartData.length - ? chartData.reduce((s, d) => s + (d[metric] as number), 0) / chartData.length - : 0 - const hasPrev = !!(prevData?.length && showComparison) const hasData = data.length > 0 const hasAnyNonZero = hasData && chartData.some((d) => (d[metric] as number) > 0) @@ -383,11 +371,6 @@ export default function Chart({ {metricLabel} - {hasAnyNonZero && avg > 0 && ( - - Avg: {formatAvgLabel(avg, metric)} - - )} {hasPrev && (