K8SManager.cs 819 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using XCharts.Runtime;
  6. public class K8SManager : UpdateManager
  7. {
  8. public Text kname;
  9. public Text kstatue;
  10. public RingChart kitem;
  11. public override void updateData()
  12. {
  13. base.updateData();
  14. DataManager.Instance.GetK8s((data) => {
  15. SerieData data1 = kitem.series[0].GetSerieData(0);
  16. data1.data[0] = double.Parse(data[2].value);
  17. data1.data[1] = double.Parse(data[2].max);
  18. kitem.gameObject.GetComponent<RingValue>().setData(data[2]);
  19. kitem.gameObject.SetActive(true);
  20. kname.text = data[0].value.ToString();
  21. kstatue.text = data[1].value.ToString();
  22. });
  23. }
  24. }