mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
Revert "Fixed realtime chart for relational. Removed getDateArray. Added chart min/max dates."
This reverts commit 647dcb5f25.
This commit is contained in:
parent
82f766342e
commit
5e5b61dc7e
7 changed files with 46 additions and 46 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { useMemo, useRef } from 'react';
|
||||
import { startOfMinute, subMinutes, isBefore } from 'date-fns';
|
||||
import PageviewsChart from './PageviewsChart';
|
||||
import { getDateArray } from 'lib/date';
|
||||
import { DEFAULT_ANIMATION_DURATION, REALTIME_RANGE } from 'lib/constants';
|
||||
import { RealtimeData } from 'lib/types';
|
||||
|
||||
|
|
@ -21,8 +22,8 @@ export function RealtimeChart({ data, unit, ...props }: RealtimeChartProps) {
|
|||
}
|
||||
|
||||
return {
|
||||
pageviews: data.series.views,
|
||||
sessions: data.series.visitors,
|
||||
pageviews: getDateArray(data.series.views, startDate, endDate, unit),
|
||||
sessions: getDateArray(data.series.visitors, startDate, endDate, unit),
|
||||
};
|
||||
}, [data, startDate, endDate, unit]);
|
||||
|
||||
|
|
@ -36,14 +37,7 @@ export function RealtimeChart({ data, unit, ...props }: RealtimeChartProps) {
|
|||
}, [endDate]);
|
||||
|
||||
return (
|
||||
<PageviewsChart
|
||||
{...props}
|
||||
minDate={startDate.toISOString()}
|
||||
maxDate={endDate.toISOString()}
|
||||
unit={unit}
|
||||
data={chartData}
|
||||
animationDuration={animationDuration}
|
||||
/>
|
||||
<PageviewsChart {...props} unit={unit} data={chartData} animationDuration={animationDuration} />
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue