增加AxismainAxis参数设置主轴可控制柱图的朝向 (#331)

This commit is contained in:
monitor1394
2026-02-26 08:47:51 +08:00
parent 90e9187808
commit 92abee1a6c
5 changed files with 88 additions and 11 deletions

View File

@@ -100,6 +100,7 @@ namespace XCharts.Runtime
[SerializeField] private bool m_Clockwise = true;
[SerializeField] private bool m_InsertDataToHead;
[SerializeField][Since("v3.11.0")] private float m_MinCategorySpacing = 0;
[SerializeField][Since("v3.15.0")] private bool m_MainAxis = false;
[SerializeField] protected List<Sprite> m_Icons = new List<Sprite>();
[SerializeField] protected List<string> m_Data = new List<string>();
[SerializeField] protected AxisLine m_AxisLine = AxisLine.defaultAxisLine;
@@ -299,6 +300,17 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_Clockwise, value)) SetAllDirty(); }
}
/// <summary>
/// Whether it is the main axis. When both X and Y axes are of the same type, the axis set to main axis will determine the orientation,
/// such as horizontal bar chart and vertical bar chart.
/// ||是否为主轴。当XY轴类型都相同时设置为主轴的轴会决定朝向如横向柱图和纵向柱图。
/// </summary>
[Since("v3.15.0")]
public bool mainAxis
{
get { return m_MainAxis; }
set { if (PropertyUtil.SetStruct(ref m_MainAxis, value)) SetAllDirty(); }
}
/// <summary>
/// Category data, available in type: 'Category' axis.
/// ||类目数据在类目轴type: 'category')中有效。
/// </summary>