Skip to content

Commit e590a97

Browse files
authored
Only draw the tooltip if it is defined (chartjs#7411)
1 parent f472a3f commit e590a97

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugins/plugin.tooltip.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ export default {
10761076

10771077
afterDraw(chart) {
10781078
const tooltip = chart.tooltip;
1079+
10791080
const args = {
10801081
tooltip
10811082
};
@@ -1084,7 +1085,9 @@ export default {
10841085
return;
10851086
}
10861087

1087-
tooltip.draw(chart.ctx);
1088+
if (tooltip) {
1089+
tooltip.draw(chart.ctx);
1090+
}
10881091

10891092
plugins.notify(chart, 'afterTooltipDraw', [args]);
10901093
},

0 commit comments

Comments
 (0)