完善文档

This commit is contained in:
monitor1394
2020-07-17 08:52:32 +08:00
parent fe1c11fc5d
commit ebceea3491
6 changed files with 82 additions and 116 deletions

View File

@@ -91,7 +91,7 @@ namespace XCharts
[NonSerialized] private bool m_NeedUpdateFilterData;
/// <summary>
/// Set this to false to prevent the axis from showing.
/// Whether to show axis.
/// 是否显示坐标轴。
/// </summary>
public bool show
@@ -118,7 +118,7 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_MinMaxType, value)) SetAllDirty(); }
}
/// <summary>
/// The minimun value of axis.
/// The minimun value of axis.Valid when `minMaxType` is `Custom`
/// 设定的坐标轴刻度最小值当minMaxType为Custom时有效。
/// </summary>
public float min
@@ -127,7 +127,7 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_Min, value)) SetAllDirty(); }
}
/// <summary>
/// The maximum value of axis.
/// The maximum value of axis.Valid when `minMaxType` is `Custom`
/// 设定的坐标轴刻度最大值当minMaxType为Custom时有效。
/// </summary>
public float max
@@ -145,8 +145,8 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_SplitNumber, value)) SetAllDirty(); }
}
/// <summary>
/// 强制设置坐标轴分割间隔。无法在类目轴中使用。
/// Compulsively set segmentation interval for axis.This is unavailable for category axis.
/// 强制设置坐标轴分割间隔。无法在类目轴中使用。
/// </summary>
public float interval
{
@@ -172,6 +172,7 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_LogBase, value)) SetAllDirty(); }
}
/// <summary>
/// On the log axis, if base e is the natural number, and is true, logBase fails.
/// 对数轴是否以自然数 e 为底数,为 true 时 logBase 失效。
/// </summary>
public bool logBaseE
@@ -190,6 +191,7 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_MaxCache, value < 0 ? 0 : value)) SetAllDirty(); }
}
/// <summary>
/// The ratio of maximum and minimum values rounded upward. The default is 0, which is automatically calculated.
/// 最大最小值向上取整的倍率。默认为0时自动计算。
/// </summary>
public int ceilRate

View File

@@ -13,6 +13,11 @@ using UnityEngine.UI;
namespace XCharts
{
/// <summary>
/// Background component.
/// Due to the limitations of the framework, there are two limitations to the use of background component:
/// 1: The parent node of chart cannot have a layout control class component.
/// 2: The parent node of Chart can only have one child node of the current chart.
///
/// 背景组件。
/// 由于框架的局限性,背景组件使用有以下两个限制:
/// 1chart的父节点不能有布局控制类组件。
@@ -25,14 +30,12 @@ namespace XCharts
[SerializeField] private bool m_Show = true;
[SerializeField] private Sprite m_Image;
[SerializeField] private Image.Type m_ImageType;
[SerializeField] private float m_Left;
[SerializeField] private float m_Right;
[SerializeField] private float m_Top;
[SerializeField] private float m_Bottom;
[SerializeField] private Color m_ImageColor = Color.white;
[SerializeField] private bool m_HideThemeBackgroundColor = true;
/// <summary>
/// Whether to enable the background component. However,
/// the ability to activate the background component is subject to other conditions.
/// 是否启用背景组件。但能否激活背景组件还要受其他条件限制。
/// </summary>
public bool show
@@ -41,6 +44,7 @@ namespace XCharts
internal set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetComponentDirty(); }
}
/// <summary>
/// the image of background.
/// 背景图。
/// </summary>
public Sprite image
@@ -50,6 +54,7 @@ namespace XCharts
}
/// <summary>
/// the fill type of background image.
/// 背景图填充类型。
/// </summary>
public Image.Type imageType
@@ -58,42 +63,6 @@ namespace XCharts
set { if (PropertyUtility.SetStruct(ref m_ImageType, value)) SetComponentDirty(); }
}
/// <summary>
/// Distance between background component and the left side of the container.
/// background 组件离容器左侧的距离。
/// </summary>
public float left
{
get { return m_Left; }
set { if (PropertyUtility.SetStruct(ref m_Left, value)) SetComponentDirty(); }
}
/// <summary>
/// Distance between background component and the right side of the container.
/// background 组件离容器右侧的距离。
/// </summary>
public float right
{
get { return m_Right; }
set { if (PropertyUtility.SetStruct(ref m_Right, value)) SetComponentDirty(); }
}
/// <summary>
/// Distance between background component and the top side of the container.
/// background 组件离容器上侧的距离。
/// </summary>
public float top
{
get { return m_Top; }
set { if (PropertyUtility.SetStruct(ref m_Top, value)) SetComponentDirty(); }
}
/// <summary>
/// Distance between background component and the bottom side of the container.
/// background 组件离容器下侧的距离。
/// </summary>
public float bottom
{
get { return m_Bottom; }
set { if (PropertyUtility.SetStruct(ref m_Bottom, value)) SetComponentDirty(); }
}
/// <summary>
/// 背景图颜色。
/// </summary>
@@ -104,6 +73,7 @@ namespace XCharts
}
/// <summary>
/// Whether to hide the background color set in the theme when the background component is on.
/// 当background组件开启时是否隐藏主题中设置的背景色。
/// </summary>
public bool hideThemeBackgroundColor
@@ -115,7 +85,7 @@ namespace XCharts
/// <summary>
/// 是否已激活
/// </summary>
public bool runtimeActive{get;internal set;}
public bool runtimeActive { get; internal set; }
public static Background defaultBackground
{