mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 19:45:35 +01:00
Fixed issue with hover tooltips.
This commit is contained in:
parent
2b13002f1b
commit
ab0838e272
20 changed files with 50 additions and 91 deletions
|
|
@ -21,15 +21,15 @@ export function FunnelChart({ className, loading }) {
|
|||
[parameters],
|
||||
);
|
||||
|
||||
const renderTooltip = useCallback((setTooltip, model) => {
|
||||
const renderTooltipPopup = useCallback((setTooltipPopup, model) => {
|
||||
const { opacity, dataPoints } = model.tooltip;
|
||||
|
||||
if (!dataPoints?.length || !opacity) {
|
||||
setTooltip(null);
|
||||
setTooltipPopup(null);
|
||||
return;
|
||||
}
|
||||
|
||||
setTooltip(`${formatLongNumber(dataPoints[0].raw.y)} ${formatMessage(labels.visitors)}`);
|
||||
setTooltipPopup(`${formatLongNumber(dataPoints[0].raw.y)} ${formatMessage(labels.visitors)}`);
|
||||
}, []);
|
||||
|
||||
const datasets = useMemo(() => {
|
||||
|
|
@ -54,7 +54,7 @@ export function FunnelChart({ className, loading }) {
|
|||
unit="day"
|
||||
loading={loading}
|
||||
renderXLabel={renderXLabel}
|
||||
renderTooltip={renderTooltip}
|
||||
renderTooltipPopup={renderTooltipPopup}
|
||||
XAxisType="category"
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue