mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
增加Tooltip的ignoreDataShow参数
This commit is contained in:
@@ -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