Only draw the tooltip if it is defined (#7411)

This commit is contained in:
Evert Timberg 2020-05-26 20:03:18 -04:00 committed by GitHub
parent f472a3f9a7
commit e590a9792c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1076,6 +1076,7 @@ export default {
afterDraw(chart) { afterDraw(chart) {
const tooltip = chart.tooltip; const tooltip = chart.tooltip;
const args = { const args = {
tooltip tooltip
}; };
@ -1084,7 +1085,9 @@ export default {
return; return;
} }
tooltip.draw(chart.ctx); if (tooltip) {
tooltip.draw(chart.ctx);
}
plugins.notify(chart, 'afterTooltipDraw', [args]); plugins.notify(chart, 'afterTooltipDraw', [args]);
}, },