mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Refactored tracker. Added handling for buttons.
This commit is contained in:
parent
2197551e58
commit
28d2787880
9 changed files with 152 additions and 209 deletions
|
|
@ -46,7 +46,7 @@ export function useDateRange(websiteId?: string) {
|
|||
};
|
||||
|
||||
return [dateRange, saveDateRange] as [
|
||||
{ startDate: Date; endDate: Date; modified?: number; value?: string },
|
||||
{ startDate: Date; endDate: Date; modified?: number; value?: string; unit?: string },
|
||||
(value: string | DateRange) => void,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ export function EventsChart({ websiteId, className, token }: EventsChartProps) {
|
|||
className={className}
|
||||
datasets={datasets}
|
||||
unit={unit}
|
||||
loading={isLoading}
|
||||
stacked
|
||||
stacked={true}
|
||||
renderXLabel={renderDateLabels(unit, locale)}
|
||||
renderTooltipPopup={renderStatusTooltipPopup(unit, locale)}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export function Legend({ chart }) {
|
|||
const { locale } = useLocale();
|
||||
const forceUpdate = useForceUpdate();
|
||||
|
||||
const handleClick = index => {
|
||||
const handleClick = (index: string | number) => {
|
||||
const meta = chart.getDatasetMeta(index);
|
||||
|
||||
meta.hidden = meta.hidden === null ? !chart.data.datasets[index].hidden : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue