Skip to content

Commit

Permalink
Update external tooltip docs (#8674)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored Mar 19, 2021
1 parent 180f1b9 commit 9a0a509
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/docs/configuration/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 9a0a509

Please sign in to comment.