/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts
{
///
/// Settings related to axis line.
/// 坐标轴的分隔线。
///
[System.Serializable]
public class AxisLine : SubComponent
{
[SerializeField] private bool m_Show;
[SerializeField] private bool m_OnZero;
[SerializeField] private float m_Width = 0.6f;
[SerializeField] private bool m_Symbol;
[SerializeField] private float m_SymbolWidth;
[SerializeField] private float m_SymbolHeight;
[SerializeField] private float m_SymbolOffset;
[SerializeField] private float m_SymbolDent;
///
/// Set this to false to prevent the axis line from showing.
/// 是否显示坐标轴轴线。
///
public bool show
{
get { return m_Show; }
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
///
/// When mutiple axes exists, this option can be used to specify which axis can be "onZero" to.
/// X 轴或者 Y 轴的轴线是否在另一个轴的 0 刻度上,只有在另一个轴为数值轴且包含 0 刻度时有效。
///
public bool onZero
{
get { return m_OnZero; }
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
///
/// line style line width.
/// 坐标轴线线宽。
///
public float width
{
get { return m_Width; }
set { if (PropertyUtility.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
}
///
/// Whether to show the arrow symbol of axis.
/// 是否显示箭头。
///
public bool symbol
{
get { return m_Symbol; }
set { if (PropertyUtility.SetStruct(ref m_Symbol, value)) SetVerticesDirty(); }
}
///
/// the width of arrow symbol.
/// 箭头宽。
///
public float symbolWidth
{
get { return m_SymbolWidth; }
set { if (PropertyUtility.SetStruct(ref m_SymbolWidth, value)) SetVerticesDirty(); }
}
///
/// the height of arrow symbol.
/// 箭头高。
///
public float symbolHeight
{
get { return m_SymbolHeight; }
set { if (PropertyUtility.SetStruct(ref m_SymbolHeight, value)) SetVerticesDirty(); }
}
///
/// the offset of arrow symbol.
/// 箭头偏移。
///
public float symbolOffset
{
get { return m_SymbolOffset; }
set { if (PropertyUtility.SetStruct(ref m_SymbolOffset, value)) SetVerticesDirty(); }
}
///
/// the dent of arrow symbol.
/// 箭头的凹陷程度。
///
public float symbolDent
{
get { return m_SymbolDent; }
set { if (PropertyUtility.SetStruct(ref m_SymbolDent, value)) SetVerticesDirty(); }
}
public static AxisLine defaultAxisLine
{
get
{
var axisLine = new AxisLine
{
m_Show = true,
m_OnZero = true,
m_Width = 0.7f,
m_Symbol = false,
m_SymbolWidth = 10,
m_SymbolHeight = 15,
m_SymbolOffset = -5f,
m_SymbolDent = 3,
};
return axisLine;
}
}
}
}