Skip to content

Commit

Permalink
Fix positioning in the custom tooltip example (chartjs#5454)
Browse files Browse the repository at this point in the history
  • Loading branch information
jung35 authored and simonbrunel committed Jul 14, 2018
1 parent 71a646e commit 996a1f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/configuration/tooltip.md
Expand Up @@ -256,12 +256,13 @@ var myPieChart = new Chart(ctx, {
// Display, position, and set styles for font
tooltipEl.style.opacity = 1;
tooltipEl.style.position = 'absolute';
tooltipEl.style.left = position.left + tooltipModel.caretX + 'px';
tooltipEl.style.top = position.top + tooltipModel.caretY + 'px';
tooltipEl.style.left = position.left + window.pageXOffset + tooltipModel.caretX + 'px';
tooltipEl.style.top = position.top + window.pageYOffset + tooltipModel.caretY + 'px';
tooltipEl.style.fontFamily = tooltipModel._bodyFontFamily;
tooltipEl.style.fontSize = tooltipModel.bodyFontSize + 'px';
tooltipEl.style.fontStyle = tooltipModel._bodyFontStyle;
tooltipEl.style.padding = tooltipModel.yPadding + 'px ' + tooltipModel.xPadding + 'px';
tooltipEl.style.pointerEvents = 'none';
}
}
}
Expand Down

0 comments on commit 996a1f9

Please sign in to comment.