mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-16 05:10:12 +00:00
29 lines
591 B
C#
29 lines
591 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using XCharts;
|
|
|
|
public class Demo_Test : MonoBehaviour
|
|
{
|
|
private CoordinateChart chart;
|
|
private float time;
|
|
private int count;
|
|
|
|
void Awake()
|
|
{
|
|
chart = gameObject.GetComponentInChildren<CoordinateChart>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
time += Time.deltaTime;
|
|
if (time >= 1)
|
|
{
|
|
time = 0;
|
|
count++;
|
|
chart.UpdateData(0, Random.Range(60, 150));
|
|
chart.AddXAxisData("time" + count);
|
|
chart.AddData(0, Random.Range(60, 150));
|
|
}
|
|
}
|
|
}
|