From 06ef86a9d6f40a08cfe2c9ee7385322c2214c757 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 19 Dec 2023 22:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Legend`=E7=9A=84`LabelStyle`?= =?UTF-8?q?=E7=9A=84`formatter`=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84?= =?UTF-8?q?=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/Legend/LegendHandler.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index abefd9f4..3bc725bf 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -70,6 +70,7 @@ slug: /changelog ## master +* (2023.12.19) 修复`Legend`的`LabelStyle`的`formatter`不生效的问题 * (2023.12.12) 增加`Legend`的`TextLimit`可限制图例显示文本的长度 * (2023.12.11) 修复`Serie`添加`double.MaxValue`时坐标绘制失败的问题 * (2023.12.10) 增加`Serie`的`minShowLabel`可隐藏小于指定值的`label` diff --git a/Runtime/Component/Legend/LegendHandler.cs b/Runtime/Component/Legend/LegendHandler.cs index b40cac5f..f42ec6e9 100644 --- a/Runtime/Component/Legend/LegendHandler.cs +++ b/Runtime/Component/Legend/LegendHandler.cs @@ -161,7 +161,7 @@ namespace XCharts.Runtime private string GetFormatterContent(Legend legend, int dataIndex, string category) { #pragma warning disable 0618 - if (string.IsNullOrEmpty(legend.formatter) || string.IsNullOrEmpty(legend.labelStyle.formatter)) + if (string.IsNullOrEmpty(legend.formatter) && string.IsNullOrEmpty(legend.labelStyle.formatter)) return category; else {