diff --git a/web/components/charts/helpers.tsx b/web/components/charts/helpers.tsx index edeccebb..684f6d76 100644 --- a/web/components/charts/helpers.tsx +++ b/web/components/charts/helpers.tsx @@ -233,8 +233,9 @@ export const SVGChart = (props: { ttParams.y, innerW, innerH, - tooltipMeasure.width, - tooltipMeasure.height + tooltipMeasure.width ?? 140, + tooltipMeasure.height ?? 35, + isMobile ?? false )} > { let left = mouseX + 12 - let bottom = containerHeight - mouseY + 12 + let bottom = !isMobile + ? containerHeight - mouseY + 12 + : containerHeight - tooltipHeight + 12 if (tooltipWidth != null) { const overflow = left + tooltipWidth - containerWidth if (overflow > 0) { left -= overflow } } + if (tooltipHeight != null) { const overflow = tooltipHeight - mouseY if (overflow > 0) { bottom -= overflow } } + return { left, bottom } }