From 76edffdbeee5764d2433351cea8cd05e1946ce7e Mon Sep 17 00:00:00 2001 From: simaQ Date: Tue, 17 Mar 2020 16:32:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(tooltip):=20=E4=BF=AE=E5=A4=8D=20tooltip=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=B8=8D=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chart/controller/tooltip.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chart/controller/tooltip.ts b/src/chart/controller/tooltip.ts index 6056eb07a1..5507d22b18 100644 --- a/src/chart/controller/tooltip.ts +++ b/src/chart/controller/tooltip.ts @@ -62,7 +62,10 @@ export default class Tooltip extends Controller { const view = this.view; const items = this.getTooltipItems(point); if (!items.length) { - // 无内容则不展示 + // 无内容则不展示,同时 tooltip 需要隐藏 + if (this.tooltip) { + this.tooltip.hide(); + } return; } const title = this.getTitle(items);