mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-03 06:54:02 +01:00
Do not draw tooltips that have no items (#4034)
This commit is contained in:
@@ -789,7 +789,10 @@ module.exports = function(Chart) {
|
||||
// IE11/Edge does not like very small opacities, so snap to 0
|
||||
var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;
|
||||
|
||||
if (this._options.enabled) {
|
||||
// Truthy/falsey value for empty tooltip
|
||||
var hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;
|
||||
|
||||
if (this._options.enabled && hasTooltipContent) {
|
||||
// Draw Background
|
||||
this.drawBackground(pt, vm, ctx, tooltipSize, opacity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user