mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
Progress check-in for date compare.
This commit is contained in:
parent
24af06f3aa
commit
8cf7985dac
25 changed files with 181 additions and 61 deletions
|
|
@ -5,8 +5,12 @@ import { renderDateLabels } from 'lib/charts';
|
|||
|
||||
export interface PageviewsChartProps extends BarChartProps {
|
||||
data: {
|
||||
sessions: any[];
|
||||
pageviews: any[];
|
||||
sessions: any[];
|
||||
compare?: {
|
||||
pageviews: any[];
|
||||
sessions: any[];
|
||||
};
|
||||
};
|
||||
unit: string;
|
||||
isLoading?: boolean;
|
||||
|
|
@ -36,7 +40,25 @@ export function PageviewsChart({ data, unit, isLoading, ...props }: PageviewsCha
|
|||
borderWidth: 1,
|
||||
...colors.chart.views,
|
||||
},
|
||||
],
|
||||
data.compare
|
||||
? {
|
||||
type: 'line',
|
||||
label: formatMessage(labels.visitors),
|
||||
data: data.compare.pageviews,
|
||||
borderWidth: 2,
|
||||
borderColor: '#f15bb5',
|
||||
}
|
||||
: null,
|
||||
data.compare
|
||||
? {
|
||||
type: 'line',
|
||||
label: formatMessage(labels.visits),
|
||||
data: data.compare.sessions,
|
||||
borderWidth: 2,
|
||||
borderColor: '#9b5de5',
|
||||
}
|
||||
: null,
|
||||
].filter(n => n),
|
||||
};
|
||||
}, [data, locale]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue