mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
serie增加自定义参数
This commit is contained in:
@@ -307,6 +307,12 @@ namespace XCharts
|
||||
[SerializeField] private float m_Right;
|
||||
[SerializeField] private float m_Top;
|
||||
[SerializeField] private float m_Bottom;
|
||||
[SerializeField] private bool m_CustomBool1;
|
||||
[SerializeField] private bool m_CustomBool2;
|
||||
[SerializeField] private int m_CustomInt1;
|
||||
[SerializeField] private int m_CustomInt2;
|
||||
[SerializeField] private float m_CustomFloat1;
|
||||
[SerializeField] private float m_CustomFloat2;
|
||||
|
||||
[SerializeField] private List<SerieData> m_Data = new List<SerieData>();
|
||||
|
||||
@@ -928,6 +934,36 @@ namespace XCharts
|
||||
get { return m_Bottom; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_Bottom, value)) SetAllDirty(); }
|
||||
}
|
||||
public bool customBool1
|
||||
{
|
||||
get { return m_CustomBool1; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomBool1, value)) SetAllDirty(); }
|
||||
}
|
||||
public bool customBool2
|
||||
{
|
||||
get { return m_CustomBool2; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomBool2, value)) SetAllDirty(); }
|
||||
}
|
||||
public int customInt1
|
||||
{
|
||||
get { return m_CustomInt1; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomInt1, value)) SetAllDirty(); }
|
||||
}
|
||||
public int customInt2
|
||||
{
|
||||
get { return m_CustomInt2; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomInt2, value)) SetAllDirty(); }
|
||||
}
|
||||
public float customFloat1
|
||||
{
|
||||
get { return m_CustomFloat1; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomFloat1, value)) SetAllDirty(); }
|
||||
}
|
||||
public float customFloat2
|
||||
{
|
||||
get { return m_CustomFloat2; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_CustomFloat2, value)) SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 系列中的数据内容数组。SerieData可以设置1到n维数据。
|
||||
/// </summary>
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace XCharts
|
||||
/// <param name="type"></param>
|
||||
/// <param name="show"></param>
|
||||
/// <returns></returns>
|
||||
public Serie AddSerie(SerieType type, string serieName, bool show = true)
|
||||
public Serie AddSerie(SerieType type, string serieName, bool show = true, bool addToHead = false)
|
||||
{
|
||||
var serie = new Serie();
|
||||
serie.type = type;
|
||||
@@ -277,7 +277,8 @@ namespace XCharts
|
||||
serie.symbol.show = false;
|
||||
}
|
||||
serie.animation.Restart();
|
||||
m_Series.Add(serie);
|
||||
if (addToHead) m_Series.Insert(0, serie);
|
||||
else m_Series.Add(serie);
|
||||
SetVerticesDirty();
|
||||
return serie;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user