From b9c56236873dbc155a3a377f516d109be67a8994 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 31 Jan 2024 13:21:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E5=9C=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE`itemFormatter`=E4=B8=BA`-`=E5=90=8E=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Component/Tooltip/TooltipHandler.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 418b82c2..c0a3df13 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -70,6 +70,7 @@ slug: /changelog ## master +* (2024.01.31) 修复`Tooltip`在设置`itemFormatter`为`-`后整个不显示的问题 * (2024.01.27) 修复`TextLimit`在开启`TextMeshPro`后无效的问题 (#301) * (2024.01.24) 增加`Bar`支持X轴和Y轴都为`Category`类目轴 * (2024.01.23) 增加`{y}`通配符用于获取Y轴的类目名 diff --git a/Runtime/Component/Tooltip/TooltipHandler.cs b/Runtime/Component/Tooltip/TooltipHandler.cs index b4476823..6777c708 100644 --- a/Runtime/Component/Tooltip/TooltipHandler.cs +++ b/Runtime/Component/Tooltip/TooltipHandler.cs @@ -530,7 +530,7 @@ namespace XCharts.Runtime ref tooltip.context.data.title); } TooltipHelper.ResetTooltipParamsByItemFormatter(tooltip, chart); - if (tooltip.context.data.param.Count > 0) + if (tooltip.context.data.param.Count > 0 || !string.IsNullOrEmpty(tooltip.context.data.title)) { tooltip.SetActive(true); if (tooltip.view != null)