graph chart引入&骑行结果弹窗

This commit is contained in:
lishuo committed 2021-04-22 19:29:59 +08:00
1 parent 40d118cea3
commit 96f3644b5b
2374 files changed
+485161 -2410

No files matched your search

@@ -0,0 +1,41 @@
#define Graph_And_Chart_PRO
using UnityEngine;
using ChartAndGraph;
using System.Collections;
public class GraphChartFeed : MonoBehaviour
{
void Start ()
{
GraphChartBase graph = GetComponent<GraphChartBase>();
if (graph != null)
{
graph.Scrollable = false;
graph.HorizontalValueToStringMap[0.0] = "Zero"; // example of how to set custom axis strings
graph.DataSource.StartBatch();
graph.DataSource.ClearCategory("Player 1");
graph.DataSource.ClearAndMakeBezierCurve("Player 2");
for (int i = 0; i <10000; i++)
{
graph.DataSource.AddPointToCategory("Player 1",i*5,Random.value*10f + 20f);
if (i == 0)
graph.DataSource.SetCurveInitialPoint("Player 2",i*5, Random.value * 10f + 10f);
else
graph.DataSource.AddLinearCurveToCategory("Player 2",
new DoubleVector2(i*5 , Random.value * 10f + 10f));
}
graph.DataSource.MakeCurveCategorySmooth("Player 2");
graph.DataSource.EndBatch();
}
// StartCoroutine(ClearAll());
}
IEnumerator ClearAll()
{
yield return new WaitForSeconds(5f);
GraphChartBase graph = GetComponent<GraphChartBase>();
graph.DataSource.Clear();
}
}