Skip to content

Commit

Permalink
above / below positioning working
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Mrowetz committed Jun 5, 2017
1 parent 4f36b7d commit aca9814
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ts/waterfall/row/svg-tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ export const onHoverInShowTooltip = (base: SVGRectElement, rectData: RectData, f
foreignEl.setAttribute("x", x);
foreignEl.setAttribute("y", y);
if (yNum - height < 0) {
console.log("Top max");
offsetY = height + 2;
offsetY = yTransformOffest + rectData.height + 10; // more offset to not hide text with mouse
} else {
offsetY = -height;
offsetY = yTransformOffest - height;
}
foreignEl.style.transform = `translate(${offsetX}px, ${offsetY + yTransformOffest}px)`;
foreignEl.style.transform = `translate(${offsetX}px, ${offsetY}px)`;
foreignEl.setAttribute("height", height.toString());
foreignEl.style.opacity = "1";
// foreignEl.style.display = "block";
Expand Down

0 comments on commit aca9814

Please sign in to comment.