]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Only draw the tooltip if it is defined (#7411)
authorEvert Timberg <evert.timberg+github@gmail.com>
Wed, 27 May 2020 00:03:18 +0000 (20:03 -0400)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 00:03:18 +0000 (20:03 -0400)
src/plugins/plugin.tooltip.js

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