mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-19 15:00:08 +00:00
增加Tooltip的ignoreDataShow参数
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
## Latest
|
||||
|
||||
* (2021.02.21) 增加`Tooltip`的`ignoreDataShow`参数
|
||||
* (2021.02.19) 修复图表在`LayoutGroup`控制下时可能显示错乱的问题 #121
|
||||
* (2021.02.18) 修复`Radar`参数变更后无法自刷新的问题 #122
|
||||
|
||||
|
||||
@@ -231,7 +231,8 @@
|
||||
* `paddingLeftRight`:文字和边框的左右边距。
|
||||
* `paddingTopBottom`:文字和边框的上下边距。
|
||||
* `backgroundImage`:提示框的背景图。
|
||||
* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息。
|
||||
* `ignoreDataShow`:`(since v2.0.1)`是否显示忽略数据在`tooltip`上。 [defaut: `false`]。
|
||||
* `ignoreDataDefaultContent`:忽略数据的默认显示字符信息。
|
||||
* `alwayShow`:是否触发后一直显示。
|
||||
* `offset`:`(since v1.5.3)`提示框相对于鼠标位置的偏移。
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
/// </summary>
|
||||
public float paddingTopBottom { get { return m_PaddingTopBottom; } set { m_PaddingTopBottom = value; } }
|
||||
/// <summary>
|
||||
/// Whether to show ignored data on tooltip.
|
||||
/// 是否显示忽略数据在tooltip上。
|
||||
/// </summary>
|
||||
public bool ignoreDataShow { get { return m_IgnoreDataShow; } set { m_IgnoreDataShow = value; } }
|
||||
/// <summary>
|
||||
/// The default display character information for ignored data.
|
||||
/// 被忽略数据的默认显示字符信息。
|
||||
/// </summary>
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user