From eab4f9530b81090f593dde398099d944f5f91562 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Fri, 8 Mar 2024 08:39:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E7=9A=84`title`?= =?UTF-8?q?=E4=BB=8E=E6=97=A7=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7=E5=90=8E?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 2 ++ Runtime/Component/Tooltip/TooltipView.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 0db5e455..5b6661d2 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -72,6 +72,8 @@ slug: /changelog ## master +* (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 + ## v3.10.1 * (2024.02.21) 发布`v3.10.1`版本 diff --git a/Runtime/Component/Tooltip/TooltipView.cs b/Runtime/Component/Tooltip/TooltipView.cs index 15dd7fec..7fed3e34 100644 --- a/Runtime/Component/Tooltip/TooltipView.cs +++ b/Runtime/Component/Tooltip/TooltipView.cs @@ -241,6 +241,7 @@ namespace XCharts.Runtime view.title = ChartHelper.AddChartLabel("title", view.gameObject.transform, tooltip.titleLabelStyle, theme.tooltip, "", Color.clear, TextAnchor.MiddleLeft); + view.title.gameObject.SetActive(true); var item = CreateViewItem(0, view.gameObject.transform, tooltip, theme.tooltip); view.m_Items.Add(item); From a071956675048aa9a794e6f272e0c46bdae3dc1d Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 11 Mar 2024 07:00:31 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Legend`=E7=9A=84`formatt?= =?UTF-8?q?er`=E5=9C=A8=E8=AE=BE=E7=BD=AE`{d}`=E9=80=9A=E9=85=8D=E7=AC=A6?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA=E5=8F=AF=E8=83=BD=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=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/Helper/FormatterHelper.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 5b6661d2..f55222af 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -72,6 +72,7 @@ slug: /changelog ## master +* (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 * (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 ## v3.10.1 diff --git a/Runtime/Helper/FormatterHelper.cs b/Runtime/Helper/FormatterHelper.cs index 43fbd35c..6a9ac8ad 100644 --- a/Runtime/Helper/FormatterHelper.cs +++ b/Runtime/Helper/FormatterHelper.cs @@ -189,7 +189,7 @@ namespace XCharts.Runtime if (isPercent) { var total = serie.GetDataTotal(dimensionIndex, serie.GetSerieData(bIndex)); - var percent = total == 0 ? 0 : value / serie.yTotal * 100; + var percent = total == 0 ? 0 : value / total * 100; content = content.Replace(old, ChartCached.FloatToStr(percent, numericFormatter)); } else if (isTotal) From f21e9c6a32d58a1bee95e39eb1831c664aebb8bc Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 11 Mar 2024 07:01:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Legend`=E7=9A=84`formatt?= =?UTF-8?q?er`=E5=9C=A8=E8=AE=BE=E7=BD=AE`{d}`=E9=80=9A=E9=85=8D=E7=AC=A6?= =?UTF-8?q?=E6=97=B6=E6=98=BE=E7=A4=BA=E5=8F=AF=E8=83=BD=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=9A=84=E9=97=AE=E9=A2=98=20(#304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index f55222af..7a5d1741 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -72,7 +72,7 @@ slug: /changelog ## master -* (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 +* (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 (#304) * (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 ## v3.10.1 From 9f5040435f5e24eae13b99ac0ef8a352af2e0658 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 11 Mar 2024 08:00:40 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E7=A7=BB?= =?UTF-8?q?=E5=87=BA=E5=9D=90=E6=A0=87=E7=B3=BB=E5=90=8E=E8=BF=98=E6=98=BE?= =?UTF-8?q?=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 | 31 ++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 7a5d1741..6e98852e 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -73,6 +73,7 @@ slug: /changelog ## master * (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 (#304) +* (2024.03.11) 修复`Tooltip`移出坐标系后还显示的问题 * (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 ## v3.10.1 diff --git a/Runtime/Component/Tooltip/TooltipHandler.cs b/Runtime/Component/Tooltip/TooltipHandler.cs index 6777c708..aec2878a 100644 --- a/Runtime/Component/Tooltip/TooltipHandler.cs +++ b/Runtime/Component/Tooltip/TooltipHandler.cs @@ -95,30 +95,29 @@ namespace XCharts.Runtime { showTooltip = false; if (tooltip.trigger == Tooltip.Trigger.None) return; - if (!chart.isPointerInChart || !tooltip.show) + if (chart.isPointerInChart && tooltip.show) { - if (tooltip.IsActive()) + for (int i = chart.series.Count - 1; i >= 0; i--) { - tooltip.ClearValue(); - tooltip.SetActive(false); + var serie = chart.series[i]; + if (!(serie is INeedSerieContainer)) + { + showTooltip = true; + containerSeries = null; + return; + } } - return; - } - for (int i = chart.series.Count - 1; i >= 0; i--) - { - var serie = chart.series[i]; - if (!(serie is INeedSerieContainer)) + containerSeries = ListPool.Get(); + UpdatePointerContainerAndSeriesAndTooltip(tooltip, ref containerSeries); + if (containerSeries.Count > 0) { showTooltip = true; - containerSeries = null; - return; } } - containerSeries = ListPool.Get(); - UpdatePointerContainerAndSeriesAndTooltip(tooltip, ref containerSeries); - if (containerSeries.Count > 0) + if (!showTooltip && tooltip.IsActive()) { - showTooltip = true; + tooltip.ClearValue(); + tooltip.SetActive(false); } } From 113c3887ae14a1481e860e652a077ec7678d27ad Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 11 Mar 2024 08:12:28 +0800 Subject: [PATCH 5/5] 3.10.2 --- Documentation~/en/changelog.md | 9 +++++++++ Documentation~/zh/changelog.md | 4 ++++ Runtime/Internal/XChartsMgr.cs | 4 ++-- package.json | 6 +++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Documentation~/en/changelog.md b/Documentation~/en/changelog.md index fd411008..ea0198da 100644 --- a/Documentation~/en/changelog.md +++ b/Documentation~/en/changelog.md @@ -2,6 +2,8 @@ # 更新日志 [master](#master) +[v3.10.2](#v3102) +[v3.10.1](#v3101) [v3.10.0](#v3100) [v3.9.0](#v390) [v3.8.1](#v381) @@ -66,6 +68,13 @@ ## master +## v3.10.2 + +* (2024.03.11) Release `v3.10.2` +* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting {d} (#304) +* (2024.03.11) Fix to `Tooltip` still showing after moving out of coordinate system +* (2024.03.08) Fixed an issue where `Tooltip`'s title might not appear after upgrading from an older version + ## v3.10.1 * (2024.02.21) Release `v3.10.1` diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 6e98852e..8656fed8 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -6,6 +6,7 @@ slug: /changelog # 更新日志 [master](#master) +[v3.10.2](#v3102) [v3.10.1](#v3101) [v3.10.0](#v3100) [v3.9.0](#v390) @@ -72,6 +73,9 @@ slug: /changelog ## master +## v3.10.2 + +* (2024.03.11) 发布`v3.10.2`版本 * (2024.03.11) 修复`Legend`的`formatter`在设置`{d}`通配符时显示可能不匹配的问题 (#304) * (2024.03.11) 修复`Tooltip`移出坐标系后还显示的问题 * (2024.03.08) 修复`Tooltip`的`title`从旧版本升级后可能不显示的问题 diff --git a/Runtime/Internal/XChartsMgr.cs b/Runtime/Internal/XChartsMgr.cs index f6597719..b2f7677b 100644 --- a/Runtime/Internal/XChartsMgr.cs +++ b/Runtime/Internal/XChartsMgr.cs @@ -21,8 +21,8 @@ namespace XCharts.Runtime [ExecuteInEditMode] public static class XChartsMgr { - public static readonly string version = "3.10.1"; - public static readonly int versionDate = 20240221; + public static readonly string version = "3.10.2"; + public static readonly int versionDate = 20240311; public static string fullVersion { get { return version + "-" + versionDate; } } internal static List chartList = new List(); diff --git a/package.json b/package.json index b3390b19..a5b150d6 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "displayName": "XCharts", "author": "monitor1394", "license": "MIT", - "version": "3.10.1", - "date": "20240201", - "checkdate": "20240201", + "version": "3.10.2", + "date": "20240311", + "checkdate": "20240311", "unity": "2018.3", "description": "A charting and data visualization library for Unity. Support line chart, bar chart, pie chart, radar chart, scatter chart, heatmap chart, ring chart, candlestick chart, polar chart and parallel coordinates.", "keywords": [