mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 02:10:16 +00:00
v3.0.0-preivew8
This commit is contained in:
@@ -11,21 +11,9 @@ namespace XCharts.Runtime
|
||||
[Serializable]
|
||||
public class AxisName : ChildComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// the location of axis name.
|
||||
/// |坐标轴名称显示位置。
|
||||
/// </summary>
|
||||
public enum Location
|
||||
{
|
||||
Start,
|
||||
Middle,
|
||||
End
|
||||
}
|
||||
[SerializeField] private bool m_Show;
|
||||
[SerializeField] private string m_Name;
|
||||
[SerializeField] private string m_Formatter;
|
||||
[SerializeField] private Location m_Location;
|
||||
[SerializeField] private TextStyle m_TextStyle = new TextStyle();
|
||||
[SerializeField] private LabelStyle m_LabelStyle = new LabelStyle();
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show axis name.
|
||||
@@ -45,46 +33,28 @@ namespace XCharts.Runtime
|
||||
get { return m_Name; }
|
||||
set { if (PropertyUtil.SetClass(ref m_Name, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// The formatter of indicator's name.
|
||||
/// |指示器名称显示的格式器。可用在雷达图。
|
||||
/// </summary>
|
||||
public string formatter
|
||||
{
|
||||
get { return m_Formatter; }
|
||||
set { if (PropertyUtil.SetClass(ref m_Formatter, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Location of axis name.
|
||||
/// |坐标轴名称显示位置。
|
||||
/// </summary>
|
||||
public Location location
|
||||
{
|
||||
get { return m_Location; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_Location, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The text style of axis name.
|
||||
/// |文本样式。
|
||||
/// </summary>
|
||||
public TextStyle textStyle
|
||||
public LabelStyle labelStyle
|
||||
{
|
||||
get { return m_TextStyle; }
|
||||
set { if (PropertyUtil.SetClass(ref m_TextStyle, value)) SetComponentDirty(); }
|
||||
get { return m_LabelStyle; }
|
||||
set { if (PropertyUtil.SetClass(ref m_LabelStyle, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
public static AxisName defaultAxisName
|
||||
{
|
||||
get
|
||||
{
|
||||
return new AxisName()
|
||||
var axisName = new AxisName()
|
||||
{
|
||||
m_Show = false,
|
||||
m_Name = "axisName",
|
||||
m_Location = Location.End,
|
||||
m_TextStyle = new TextStyle(),
|
||||
m_LabelStyle = new LabelStyle()
|
||||
};
|
||||
axisName.labelStyle.position = LabelStyle.Position.End;
|
||||
return axisName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +63,7 @@ namespace XCharts.Runtime
|
||||
var axisName = new AxisName();
|
||||
axisName.show = show;
|
||||
axisName.name = name;
|
||||
axisName.location = location;
|
||||
axisName.textStyle.Copy(textStyle);
|
||||
axisName.m_LabelStyle.Copy(m_LabelStyle);
|
||||
return axisName;
|
||||
}
|
||||
|
||||
@@ -102,8 +71,7 @@ namespace XCharts.Runtime
|
||||
{
|
||||
show = axisName.show;
|
||||
name = axisName.name;
|
||||
location = axisName.location;
|
||||
textStyle.Copy(axisName.textStyle);
|
||||
m_LabelStyle.Copy(axisName.labelStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user