graph优化

This commit is contained in:
lishuo committed 2022-06-06 18:54:04 +08:00
1 parent c6d0f7ac13
commit 383fed4966
3 files changed
+74 -26

No files matched your search

@@ -7,10 +7,12 @@ using System.Collections.Generic;
public class RowerGraphChartFeed : MonoBehaviour
{
GraphChartBase graph { get; set; }
GraphData dataSource { get; set; }
void Start ()
{
graph = GetComponent<GraphChartBase>();
dataSource = graph.DataSource;
//GraphChartBase graph = GetComponent<GraphChartBase>();
//if (graph != null)
//{
@@ -34,7 +36,20 @@ public class RowerGraphChartFeed : MonoBehaviour
//}
// StartCoroutine(ClearAll());
}
public void SetPrePoint(double x, double y)
{
dataSource?.AddPointToCategoryRealtime("Player 1", x, y);
}
public void SetCurrentPoint(double x,double y)
{
dataSource?.AddPointToCategoryRealtime("Player 2", x, y);
}
public void ClearChart()
{
dataSource?.ClearCategory("Player 1");
dataSource?.ClearCategory("Player 2");
}
public void SetData(List<DoubleVector2> list,List<DoubleVector2> list2 = null)
{
if (graph != null)
@@ -42,10 +57,9 @@ public class RowerGraphChartFeed : MonoBehaviour
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.ClearCategory("Player 2");
graph.ClearCache();
//graph.DataSource.ClearCategory("Player 1");
//graph.DataSource.ClearCategory("Player 2");
//graph.ClearCache();
for (int i = 0; i < list.Count; i++)
{
var item = list[i];