diff --git a/apps/start/src/components/report-chart/conversion/chart.tsx b/apps/start/src/components/report-chart/conversion/chart.tsx index 8710fdac..66c6885e 100644 --- a/apps/start/src/components/report-chart/conversion/chart.tsx +++ b/apps/start/src/components/report-chart/conversion/chart.tsx @@ -18,7 +18,6 @@ import { useTRPC } from '@/integrations/trpc/react'; import { average, getPreviousMetric, round } from '@openpanel/common'; import type { IInterval } from '@openpanel/validation'; import { useQuery } from '@tanstack/react-query'; -import { Fragment } from 'react'; import { useXAxisProps, useYAxisProps } from '../common/axis'; import { PreviousDiffIndicatorPure } from '../common/previous-diff-indicator'; import { useReportChartContext } from '../context'; @@ -69,11 +68,18 @@ export function Chart({ data }: Props) { }, 0), ); + const rechartData = data.current[0].data.map((item) => { + return { + ...item, + timestamp: new Date(item.date).getTime(), + }; + }); + return (
- + - {data.current.map((serie, index) => { - const color = getChartColor(index); - return ( - - - - - ); - })} + + {typeof averageConversionRate === 'number' && averageConversionRate && ( 0 @@ -194,14 +188,17 @@ const { Tooltip, TooltipProvider } = createChartTooltip<
{number.formatWithUnit(item.rate / 100, '%')} - - ({number.format(item.total)}) - + {item.total}
- +
+ + + ({prevItem?.total}) + +