Fixed realtime chart for relational. Removed getDateArray. Added chart min/max dates.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import PageviewsChart from 'components/metrics/PageviewsChart';
|
||||
import { getDateArray } from 'lib/date';
|
||||
import useWebsitePageviews from 'components/hooks/queries/useWebsitePageviews';
|
||||
import { useDateRange } from 'components/hooks';
|
||||
|
||||
@@ -19,8 +18,8 @@ export function WebsiteChart({
|
||||
const chartData = useMemo(() => {
|
||||
if (data) {
|
||||
const result = {
|
||||
pageviews: getDateArray(pageviews, startDate, endDate, unit),
|
||||
sessions: getDateArray(sessions, startDate, endDate, unit),
|
||||
pageviews,
|
||||
sessions,
|
||||
};
|
||||
|
||||
if (compare) {
|
||||
@@ -43,7 +42,15 @@ export function WebsiteChart({
|
||||
return { pageviews: [], sessions: [] };
|
||||
}, [data, startDate, endDate, unit]);
|
||||
|
||||
return <PageviewsChart data={chartData} unit={unit} isLoading={isLoading} />;
|
||||
return (
|
||||
<PageviewsChart
|
||||
data={chartData}
|
||||
minDate={startDate.toISOString()}
|
||||
maxDate={endDate.toISOString()}
|
||||
unit={unit}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default WebsiteChart;
|
||||
|
||||
Reference in New Issue
Block a user