mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
[feature] Add smoothLimit for Line
This commit is contained in:
@@ -505,7 +505,7 @@ namespace XCharts.Runtime
|
||||
if (isY)
|
||||
UGLHelper.GetBezierListVertical(ref s_CurvesPosList, sp, ep, smoothness, setting.lineSmoothStyle);
|
||||
else
|
||||
UGLHelper.GetBezierList(ref s_CurvesPosList, sp, ep, lsp, nep, smoothness, setting.lineSmoothStyle, true);
|
||||
UGLHelper.GetBezierList(ref s_CurvesPosList, sp, ep, lsp, nep, smoothness, setting.lineSmoothStyle, serie.smoothLimit);
|
||||
for (int j = 1; j < s_CurvesPosList.Count; j++)
|
||||
{
|
||||
serie.context.drawPoints.Add(new PointInfo(s_CurvesPosList[j], ignore));
|
||||
|
||||
@@ -247,6 +247,7 @@ namespace XCharts.Runtime
|
||||
[SerializeField] private float m_SampleAverage = 0;
|
||||
|
||||
[SerializeField] private LineType m_LineType = LineType.Normal;
|
||||
[SerializeField][Since("v3.3.1")] private bool m_SmoothLimit = true;
|
||||
[SerializeField] private BarType m_BarType = BarType.Normal;
|
||||
[SerializeField] private bool m_BarPercentStack = false;
|
||||
[SerializeField] private float m_BarWidth = 0;
|
||||
@@ -492,6 +493,16 @@ namespace XCharts.Runtime
|
||||
set { if (PropertyUtil.SetStruct(ref m_LineType, value)) SetVerticesDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Whether to restrict the curve. When true, the curve between two continuous data of the same value
|
||||
/// is restricted to not exceed the data point, and is flat to the data point.
|
||||
/// |是否限制曲线。当为true时,两个连续相同数值的数据间的曲线会限制为不超出数据点,和数据点是平直的。
|
||||
/// </summary>
|
||||
public bool smoothLimit
|
||||
{
|
||||
get { return m_SmoothLimit; }
|
||||
set { if (PropertyUtil.SetStruct(ref m_SmoothLimit, value)) { SetVerticesDirty(); } }
|
||||
}
|
||||
/// <summary>
|
||||
/// the min pixel dist of sample.
|
||||
/// |采样的最小像素距离,默认为0时不采样。当两个数据点间的水平距离小于改值时,开启采样,保证两点间的水平距离不小于改值。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user