mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
增加SerieData的ignore可忽略当前数据项
This commit is contained in:
@@ -1704,19 +1704,22 @@ namespace XCharts
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsIgnoreIndex(int index, int dimension)
|
||||
public bool IsIgnoreIndex(int index, int dimension = 1)
|
||||
{
|
||||
if (m_Ignore)
|
||||
var serieData = GetSerieData(index);
|
||||
if (serieData != null)
|
||||
{
|
||||
var serieData = GetSerieData(index);
|
||||
if (serieData != null)
|
||||
{
|
||||
return IsIgnoreValue(serieData.GetData(dimension));
|
||||
}
|
||||
return IsIgnoreValue(serieData, dimension);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsIgnoreValue(SerieData serieData, int dimension = 1)
|
||||
{
|
||||
if (serieData.ignore) return true;
|
||||
return IsIgnoreValue(serieData.GetData(dimension));
|
||||
}
|
||||
|
||||
public bool IsIgnoreValue(float value)
|
||||
{
|
||||
return m_Ignore && Mathf.Approximately(value, m_IgnoreValue);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace XCharts
|
||||
{
|
||||
[SerializeField] private string m_Name;
|
||||
[SerializeField] private bool m_Selected;
|
||||
[SerializeField] private bool m_Ignore = false;
|
||||
[SerializeField] private float m_Radius;
|
||||
[SerializeField] private IconStyle m_IconStyle = new IconStyle();
|
||||
[SerializeField] private bool m_EnableLabel = false;
|
||||
@@ -94,6 +95,14 @@ namespace XCharts
|
||||
/// </summary>
|
||||
public SerieSymbol symbol { get { return m_Symbol; } set { m_Symbol = value; } }
|
||||
/// <summary>
|
||||
/// 是否忽略数据。当为 true 时,数据不进行绘制。
|
||||
/// </summary>
|
||||
public bool ignore
|
||||
{
|
||||
get { return m_Ignore; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_Ignore, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// An arbitrary dimension data list of data item.
|
||||
/// 可指定任意维数的数值列表。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user