mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 05:10:12 +00:00
增加Chart的onSerieClick,onSerieDown,onSerieEnter和onSerieExit回调
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using XCharts.Runtime;
|
||||
#if INPUT_SYSTEM_ENABLED
|
||||
@@ -14,6 +15,9 @@ namespace XCharts.Example
|
||||
void Awake()
|
||||
{
|
||||
chart = gameObject.GetComponent<BaseChart>();
|
||||
chart.onSerieClick = OnPointerClickLine;
|
||||
chart.onSerieEnter = OnPointerEnterLine;
|
||||
chart.onSerieExit = OnPointerExitLine;
|
||||
var btnTrans = transform.parent.Find("Button");
|
||||
if (btnTrans)
|
||||
{
|
||||
@@ -21,6 +25,21 @@ namespace XCharts.Example
|
||||
}
|
||||
}
|
||||
|
||||
void OnPointerClickLine(SerieEventData data)
|
||||
{
|
||||
Debug.Log("OnPointerClick: " + data.serieIndex+ " " + data.dataIndex +" "+ data.dimension);
|
||||
}
|
||||
|
||||
void OnPointerEnterLine(SerieEventData data)
|
||||
{
|
||||
Debug.Log("OnPointerEnter: " + data.serieIndex + " " + data.dataIndex + " " + data.dimension);
|
||||
}
|
||||
|
||||
void OnPointerExitLine(SerieEventData data)
|
||||
{
|
||||
Debug.Log("OnPointerExit: " + data.serieIndex + " " + data.dataIndex + " " + data.dimension);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
|
||||
Reference in New Issue
Block a user