Commit d61c9012 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix tooltip position

parent be9caf62
......@@ -1063,17 +1063,23 @@
tHeight = tooltip.property('offsetHeight');
// Determin tooltip position
if (__axis_rotated) {
tooltipLeft = mouse[0];
tooltipLeft = mouse[0] + 100;
tooltipRight = tooltipLeft + tWidth;
chartRight = getCurrentWidth() - getCurrentPaddingRight();
tooltipTop = x(dataToShow[0].x) + 20;
} else {
svgLeft = getSvgLeft();
tooltipLeft = svgLeft + getCurrentPaddingLeft() + x(dataToShow[0].x) + 20;
tooltipRight = tooltipLeft + tWidth;
chartRight = svgLeft + getCurrentWidth() - getCurrentPaddingRight();
if (tooltipRight > chartRight) {
tooltipLeft -= tWidth + 30;
}
tooltipTop = mouse[1] + 15;
}
if (tooltipRight > chartRight) {
tooltipLeft -= tWidth + 60;
}
if (tooltipTop + tHeight > getCurrentHeight()) {
tooltipTop -= tHeight + 30;
}
tooltipTop = mouse[1] + 15 + tHeight < getCurrentHeight() ? mouse[1] + 15 : mouse[1] - tHeight;
// Set tooltip
// todo get rid of magic numbers
tooltip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment