mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix positioning in the custom tooltip example (#5454)
This commit is contained in:
parent
119a86f399
commit
0963c8f76c
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user