This commit is contained in:
monitor1394
2022-05-22 22:17:38 +08:00
parent 003f4da9de
commit bafe032bb9
391 changed files with 3718 additions and 2774 deletions

View File

@@ -0,0 +1,40 @@
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Example
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(PieChart))]
public class Example_PieChart : MonoBehaviour
{
private PieChart chart;
private float time;
private int count = 0;
private void Awake()
{
chart = transform.GetComponent<PieChart>();
chart.ClearData();
}
private void Update()
{
time += Time.deltaTime;
if (time > 1)
{
time = 0;
if (count < 5)
{
chart.AddData(0, Random.Range(10, 100), "time" + count);
}
else
{
int index = count % 5;
chart.UpdateData(0, Random.Range(10, 100), index);
}
count++;
}
}
}
}