12345678910111213141516171819202122232425262728293031323334 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- using XCharts.Runtime;
- public class SixServerManager : UpdateManager
- {
- public List<PieChart> items;
- public Text flops;
- public override void updateData()
- {
- base.updateData();
- DataManager.Instance.GetSixServer((data) => {
- for (int i = 0; i < items.Count; i++)
- {
- items[i].GetChartComponent<Title>().text = data[i].title;
- items[i].GetComponent<PieValue>().setData(data[i]);
- items[i].GetChartComponent<Legend>().data = new List<string>();
- items[i].series[0].GetSerieData(0).data[1] = data[i].items[0].value;
- items[i].series[0].GetSerieData(0).name = data[i].items[0].name + " " + data[i].items[0].value;
- items[i].GetChartComponent<Legend>().data.Add(data[i].items[0].name + " " + data[i].items[0].value);
- items[i].series[0].GetSerieData(1).data[1] = data[i].items[1].value;
- items[i].series[0].GetSerieData(1).name = data[i].items[1].name + " " + data[i].items[1].value;
- items[i].GetChartComponent<Legend>().data.Add(data[i].items[1].name + " " + data[i].items[1].value);
- }
-
- flops.text= data[5].value.ToString();
- });
- }
- }
|