[add][legend] add the delegate callback for legend

This commit is contained in:
monitor1394
2022-05-04 09:19:45 +08:00
parent d1fd4dcf44
commit e92afac0de
3 changed files with 44 additions and 6 deletions

View File

@@ -105,7 +105,21 @@ namespace XCharts.Runtime
/// 坐标轴变更数据索引时回调。参数axis, dataIndex/dataValue
/// </summary>
public Action<Axis, double> onAxisPointerValueChanged { set { m_OnAxisPointerValueChanged = value; } get { return m_OnAxisPointerValueChanged; } }
/// <summary>
/// the callback function of click legend.
/// |点击图例按钮回调。参数legendIndex, legendName, show
/// </summary>
public Action<Legend, int, string, bool> onLegendClick { set { m_OnLegendClick = value; } internal get { return m_OnLegendClick; } }
/// <summary>
/// the callback function of enter legend.
/// |鼠标进入图例回调。参数legendIndex, legendName
/// </summary>
public Action<Legend, int, string> onLegendEnter { set { m_OnLegendEnter = value; } internal get { return m_OnLegendEnter; } }
/// <summary>
/// the callback function of exit legend.
/// |鼠标退出图例回调。参数legendIndex, legendName
/// </summary>
public Action<Legend, int, string> onLegendExit { set { m_OnLegendExit = value; } internal get { return m_OnLegendExit; } }
public void Init(bool defaultChart = true)
{
if (defaultChart)