增加AreaStyletoTop参数可设置折线图渐变色是到顶部还是到实际位置

This commit is contained in:
monitor1394
2022-12-08 07:32:33 +08:00
parent 927644fb10
commit d4a3886530
9 changed files with 79 additions and 59 deletions

View File

@@ -38,6 +38,7 @@ namespace XCharts.Runtime
[SerializeField] private Color32 m_ToColor;
[SerializeField][Range(0, 1)] private float m_Opacity = 0.6f;
[SerializeField][Since("v3.2.0")] private bool m_InnerFill;
[SerializeField][Since("v3.6.0")] private bool m_ToTop = true;
/// <summary>
/// Set this to false to prevent the areafrom showing.
@@ -93,6 +94,16 @@ namespace XCharts.Runtime
get { return m_InnerFill; }
set { if (PropertyUtil.SetStruct(ref m_InnerFill, value)) SetVerticesDirty(); }
}
/// <summary>
/// Whether to fill the gradient color to the top. The default is true, which means that the gradient color is filled to the top.
/// If it is false, the gradient color is filled to the actual position.
/// |渐变色是到顶部还是到实际位置。默认为true到顶部。
/// </summary>
public bool toTop
{
get { return m_ToTop; }
set { if (PropertyUtil.SetStruct(ref m_ToTop, value)) SetVerticesDirty(); }
}
public Color32 GetColor()
{