Commit 0944f4a4 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix tooltip position when it's on the bottom - #635

parent 78a21e78
......@@ -3589,10 +3589,13 @@
if (tooltipRight > chartRight) {
tooltipLeft -= tooltipRight - chartRight;
}
if (tooltipTop + tHeight > $$.currentHeight && tooltipTop > tHeight + 30) {
if (tooltipTop + tHeight > $$.currentHeight) {
tooltipTop -= tHeight + 30;
}
}
if (tooltipTop < 0) {
tooltipTop = 0;
}
// Set tooltip
$$.tooltip
.style("top", tooltipTop + "px")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -83,10 +83,13 @@ c3_chart_internal_fn.showTooltip = function (selectedData, mouse) {
if (tooltipRight > chartRight) {
tooltipLeft -= tooltipRight - chartRight;
}
if (tooltipTop + tHeight > $$.currentHeight && tooltipTop > tHeight + 30) {
if (tooltipTop + tHeight > $$.currentHeight) {
tooltipTop -= tHeight + 30;
}
}
if (tooltipTop < 0) {
tooltipTop = 0;
}
// Set tooltip
$$.tooltip
.style("top", tooltipTop + "px")
......
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