Fix tooltip label, retention report for mysql, pass minDate into eventsChart

This commit is contained in:
Francis Cao 2024-08-27 16:02:43 -07:00
parent a5e2242486
commit ab050e51c5
4 changed files with 14 additions and 13 deletions

View file

@ -1,9 +1,8 @@
import { useMemo } from 'react';
import { useTheme } from 'components/hooks';
import Chart, { ChartProps } from 'components/charts/Chart';
import { renderNumberLabels } from 'lib/charts';
import { useState } from 'react';
import BarChartTooltip from 'components/charts/BarChartTooltip';
import Chart, { ChartProps } from 'components/charts/Chart';
import { useTheme } from 'components/hooks';
import { renderNumberLabels } from 'lib/charts';
import { useMemo, useState } from 'react';
export interface BarChartProps extends ChartProps {
unit: string;
@ -36,7 +35,7 @@ export function BarChart(props: BarChartProps) {
x: {
type: XAxisType,
stacked: true,
min: unit === 'year' ? '' : minDate,
min: minDate && new Date(minDate).getSeconds() === 0 ? minDate : '',
max: maxDate,
time: {
unit,

View file

@ -47,6 +47,8 @@ export function EventsChart({ websiteId, className }: EventsChartProps) {
return (
<BarChart
minDate={startDate.toISOString()}
maxDate={endDate.toISOString()}
className={className}
data={chartData}
unit={unit}