Skip to content

Commit aca9814

Browse files
author
Michael Mrowetz
committed
above / below positioning working
1 parent 4f36b7d commit aca9814

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: src/ts/waterfall/row/svg-tooltip.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ export const onHoverInShowTooltip = (base: SVGRectElement, rectData: RectData, f
4848
foreignEl.setAttribute("x", x);
4949
foreignEl.setAttribute("y", y);
5050
if (yNum - height < 0) {
51-
console.log("Top max");
52-
offsetY = height + 2;
51+
offsetY = yTransformOffest + rectData.height + 10; // more offset to not hide text with mouse
5352
} else {
54-
offsetY = -height;
53+
offsetY = yTransformOffest - height;
5554
}
56-
foreignEl.style.transform = `translate(${offsetX}px, ${offsetY + yTransformOffest}px)`;
55+
foreignEl.style.transform = `translate(${offsetX}px, ${offsetY}px)`;
5756
foreignEl.setAttribute("height", height.toString());
5857
foreignEl.style.opacity = "1";
5958
// foreignEl.style.display = "block";

0 commit comments

Comments
 (0)