mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 06:20:15 +00:00
28 lines
635 B
C#
28 lines
635 B
C#
using UnityEngine;
|
|
using xcharts;
|
|
|
|
public class Demo : MonoBehaviour
|
|
{
|
|
private LineChart lineChart;
|
|
private float time;
|
|
private int count;
|
|
|
|
void Awake()
|
|
{
|
|
lineChart = transform.Find("xchart/line_chart").GetComponent<LineChart>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
time += Time.deltaTime;
|
|
if (time >= 1)
|
|
{
|
|
time = 0;
|
|
count++;
|
|
lineChart.AddXAxisCategory("key" + count);
|
|
lineChart.AddData("line1", "key"+count, Random.Range(24.0f, 60.0f));
|
|
lineChart.AddData("line2", "key"+count, Random.Range(24.0f, 60.0f));
|
|
}
|
|
}
|
|
}
|