mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
fix min date chart bug when using all time
This commit is contained in:
parent
bf89dfdd49
commit
c851f3bb3c
4 changed files with 19 additions and 7 deletions
|
|
@ -14,6 +14,7 @@ export interface BarChartProps extends ChartProps {
|
|||
YAxisType?: string;
|
||||
minDate?: number | string;
|
||||
maxDate?: number | string;
|
||||
isAllTime?: boolean;
|
||||
}
|
||||
|
||||
export function BarChart(props: BarChartProps) {
|
||||
|
|
@ -29,6 +30,7 @@ export function BarChart(props: BarChartProps) {
|
|||
minDate,
|
||||
maxDate,
|
||||
currency,
|
||||
isAllTime,
|
||||
} = props;
|
||||
|
||||
const options: any = useMemo(() => {
|
||||
|
|
@ -37,7 +39,7 @@ export function BarChart(props: BarChartProps) {
|
|||
x: {
|
||||
type: XAxisType,
|
||||
stacked: true,
|
||||
min: minDate && new Date(minDate).getSeconds() === 0 ? minDate : '',
|
||||
min: isAllTime ? '' : minDate,
|
||||
max: maxDate,
|
||||
time: {
|
||||
unit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue