增加DataZoomstartEndFunction委托

This commit is contained in:
monitor1394
2023-02-26 22:49:19 +08:00
parent 398fee2d97
commit 8c6d013341
4 changed files with 14 additions and 0 deletions

View File

@@ -65,6 +65,7 @@ slug: /changelog
## master
* (2023.02.26) 增加`DataZoom``startEndFunction`委托
* (2023.02.12) 重构`Component`相关代码调整API接口
* (2023.02.10) 修复`Axis``Log`轴时某些情况下最小值不正确的问题
* (2023.02.10) 优化`Axis`的数值`Label`的默认显示格式

View File

@@ -93,6 +93,7 @@ namespace XCharts.Runtime
[SerializeField][Since("v3.6.0")] private bool m_EndLock;
public DataZoomContext context = new DataZoomContext();
private CustomDataZoomStartEndFunction m_StartEndFunction;
/// <summary>
/// Whether to show dataZoom.
@@ -393,6 +394,10 @@ namespace XCharts.Runtime
get { return m_MarqueeStyle; }
set { if (PropertyUtil.SetClass(ref m_MarqueeStyle, value)) SetAllDirty(); }
}
/// <summary>
/// start和end变更委托。
/// </summary>
public CustomDataZoomStartEndFunction startEndFunction { get { return m_StartEndFunction; } set { m_StartEndFunction = value; } }
class AxisIndexValueInfo
{

View File

@@ -397,6 +397,8 @@ namespace XCharts.Runtime
if (end < start)
end = start;
if (dataZoom.startEndFunction != null)
dataZoom.startEndFunction(ref start, ref end);
if (!dataZoom.startLock)
dataZoom.start = start;

View File

@@ -22,4 +22,10 @@ namespace XCharts.Runtime
/// <returns></returns>
public delegate float SymbolSizeFunction(List<double> data);
public delegate void CustomDrawGaugePointerFunction(VertexHelper vh, int serieIndex, int dataIndex, float currentAngle);
/// <summary>
/// DataZoom的start和end变更时的委托方法。
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
public delegate void CustomDataZoomStartEndFunction(ref float start, ref float end);
}