Update external tooltip docs (#8674)

This commit is contained in:
Jukka Kurkela 2021-03-19 14:02:51 +02:00 committed by GitHub
parent 180f1b941e
commit 9a0a509385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,13 +314,14 @@ var myPieChart = new Chart(ctx, {
}
var position = context.chart.canvas.getBoundingClientRect();
var bodyFont = Chart.helpers.toFont(tooltipModel.options.bodyFont);
// Display, position, and set styles for font
tooltipEl.style.opacity = 1;
tooltipEl.style.position = 'absolute';
tooltipEl.style.left = position.left + window.pageXOffset + tooltipModel.caretX + 'px';
tooltipEl.style.top = position.top + window.pageYOffset + tooltipModel.caretY + 'px';
tooltipEl.style.font = tooltipModel.bodyFont.string;
tooltipEl.style.font = bodyFont.string;
tooltipEl.style.padding = tooltipModel.padding + 'px ' + tooltipModel.padding + 'px';
tooltipEl.style.pointerEvents = 'none';
}