diff --git a/CHANGELOG-EN.md b/CHANGELOG-EN.md
index 9c32cd1b..f16fbe19 100644
--- a/CHANGELOG-EN.md
+++ b/CHANGELOG-EN.md
@@ -31,6 +31,7 @@
## Latest
+* (2021.02.21) Added `Tooltip` parameter `ignoreDataShow`
* (2021.02.19) Fixed an issue where charts could appear abnormal when under `LayoutGroup` control #121
* (2021.02.18) Fixed an issue where the `Radar` could not refresh itself after parameter changing #122
@@ -47,7 +48,7 @@
* (2021.01.21) Release `v2.0.0-preview.2` version
* (2021.01.21) Fixed an error about `AxisTick` in `Inpsector`
* (2021.01.21) Fixed a build compatibility error
-* (2021.01.19) Add `XChartsSettings` `editorShowAllListData` parameter to configure whether to display all the list's data in Inspector
+* (2021.01.19) Added `XChartsSettings` `editorShowAllListData` parameter to configure whether to display all the list's data in Inspector
## v2.0.0-preview.1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3dc954bd..31fb5da6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,7 @@
## Latest
+* (2021.02.21) 增加`Tooltip`的`ignoreDataShow`参数
* (2021.02.19) 修复图表在`LayoutGroup`控制下时可能显示错乱的问题 #121
* (2021.02.18) 修复`Radar`参数变更后无法自刷新的问题 #122
diff --git a/Documentation/XCharts配置项手册.md b/Documentation/XCharts配置项手册.md
index e62d4d71..97930fd4 100644
--- a/Documentation/XCharts配置项手册.md
+++ b/Documentation/XCharts配置项手册.md
@@ -231,7 +231,8 @@
* `paddingLeftRight`:文字和边框的左右边距。
* `paddingTopBottom`:文字和边框的上下边距。
* `backgroundImage`:提示框的背景图。
-* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息。
+* `ignoreDataShow`:`(since v2.0.1)`是否显示忽略数据在`tooltip`上。 [defaut: `false`]。
+* `ignoreDataDefaultContent`:忽略数据的默认显示字符信息。
* `alwayShow`:是否触发后一直显示。
* `offset`:`(since v1.5.3)`提示框相对于鼠标位置的偏移。
diff --git a/Documentation/xcharts-configuration-EN.md b/Documentation/xcharts-configuration-EN.md
index 825f60f0..b1f21691 100644
--- a/Documentation/xcharts-configuration-EN.md
+++ b/Documentation/xcharts-configuration-EN.md
@@ -235,6 +235,7 @@ Tooltip component.
* `paddingLeftRight`: the text padding of left and right. [defaut: `5f`].
* `paddingTopBottom`: the text padding of top and bottom. [defaut: `5f`].
* `backgroundImage`: The image of icon.
+* `ignoreDataShow`: Whether to show ignored data on tooltip. [defaut: `false`].
* `ignoreDataDefaultContent`: The default display character information for ignored data.
* `alwayShow`: Whether to trigger after always display.
* `offset`: `(since v1.5.3)`The position offset of tooltip relative to the mouse position.
diff --git a/Runtime/Component/Main/Tooltip.cs b/Runtime/Component/Main/Tooltip.cs
index 9833b8dc..162d6def 100644
--- a/Runtime/Component/Main/Tooltip.cs
+++ b/Runtime/Component/Main/Tooltip.cs
@@ -60,6 +60,7 @@ namespace XCharts
[SerializeField] private string m_NumericFormatter = "";
[SerializeField] private float m_PaddingLeftRight = 5f;
[SerializeField] private float m_PaddingTopBottom = 5f;
+ [SerializeField] private bool m_IgnoreDataShow = false;
[SerializeField] private string m_IgnoreDataDefaultContent = "-";
[SerializeField] private bool m_AlwayShow = false;
[SerializeField] private Vector2 m_Offset = new Vector2(18f, -25f);
@@ -185,6 +186,11 @@ namespace XCharts
///
public float paddingTopBottom { get { return m_PaddingTopBottom; } set { m_PaddingTopBottom = value; } }
///
+ /// Whether to show ignored data on tooltip.
+ /// 是否显示忽略数据在tooltip上。
+ ///
+ public bool ignoreDataShow { get { return m_IgnoreDataShow; } set { m_IgnoreDataShow = value; } }
+ ///
/// The default display character information for ignored data.
/// 被忽略数据的默认显示字符信息。
///
diff --git a/Runtime/Internal/Helper/TooltipHelper.cs b/Runtime/Internal/Helper/TooltipHelper.cs
index a80853a0..75ebaa4f 100644
--- a/Runtime/Internal/Helper/TooltipHelper.cs
+++ b/Runtime/Internal/Helper/TooltipHelper.cs
@@ -106,7 +106,7 @@ namespace XCharts
public static void InitRadarTooltip(ref StringBuilder sb, Tooltip tooltip, Serie serie, Radar radar,
ChartTheme theme)
{
- if(radar == null) return;
+ if (radar == null) return;
if (!serie.show) return;
if (tooltip.runtimeGridIndex >= 0) return;
if (serie.radarIndex != radar.index) return;
@@ -206,7 +206,7 @@ namespace XCharts
.Append(ChartCached.FloatToStr(yValue, numericFormatter)).Append("]");
}
}
- else
+ else if (!isIngore || (isIngore && tooltip.ignoreDataShow))
{
var valueTxt = isIngore ? tooltip.ignoreDataDefaultContent :
ChartCached.FloatToStr(yValue, numericFormatter);