123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XCharts.Runtime;
- public class Manager
- {
- public class TongSuanData
- {
- public float zhiji;
- public float serverct;
- public float devct;
- }
- public class JianKongPtData
- {
- public float shijianct;
- public float zhixingct;
- public float gaojingct;
- }
- public class ServerData
- {
- public List<ServerRoomData> serverList = new List<ServerRoomData>();
- }
- public class ServerRoomData
- {
- public int id;
- public string name;
- public float wendu;
- public float shidu;
- public float zonggonglv;
- public float shangridl;
- public List<ServerVideoData> videolist;
- public List<ServerJiLongData> jilonglist;
- }
- public class ServerVideoData
- {
- public int id;
- public string name;
- public string time;
- public List<string> url;
- }
- public class ServerJiLongData
- {
- public int id;
- public string name;
- public List<ServerjiguiData> jiguilist;
- }
- public class ServerjiguiData
- {
- public int id;
- public string name;
- public float zgl;
- public float srz;
- public float szz;
- public float syz;
- public float wendu;
- public float shidu;
- }
- public class PieChartData
- {
- public List<PieChartItemData> items;
- public float value;
- public string title;
- }
- public class PieChartItemData
- {
- public string name;
- public float value;
- }
- public class RingValueData
- {
- public string value;
- public string max;
- }
- public class GaoJingListData
- {
- public List<GaoJingItemData> list;
- }
- public class GaoJingItemData
- {
- public string lv;
- public string time;
- public string dev;
- public string type;
- }
- public class LineChartData
- {
- public List<string> xdata;
- public List<string> ydata;
- public List<LineChartSeriesData> sdata;
- }
- public class LineChartSeriesData
- {
- public string name;
- public List<float> values;
- }
- public static void setLineData(LineChart lineChart, LineChartData data)
- {
- setXValue(lineChart,data);
- setYValue(lineChart,data);
- setAllValue(lineChart,data);
- }
- static void setXValue(LineChart lineChart, LineChartData data)
- {
- XAxis x = lineChart.GetChartComponent<XAxis>();
- x.data = data.xdata;
- }
- static void setYValue(LineChart lineChart, LineChartData data)
- {
- YAxis y = lineChart.GetChartComponent<YAxis>();
- y.data = data.ydata;
- }
- static void setAllValue(LineChart lineChart, LineChartData data)
- {
- for (int i = 0; i < data.sdata.Count; i++)
- {
- if (lineChart.series.Count > i)
- {
- lineChart.series[i].serieName = data.sdata[i].name;
- Debug.Log(data.sdata[i].values.Count);
- for (int j = 0; j < data.sdata[i].values.Count; j++)
- {
- if (lineChart.series[i].data.Count<=j)
- {
- SerieData sd = new SerieData();
- sd.data = new List<double>();
- sd.data.Add(j);
- sd.data.Add(data.sdata[i].values[j]);
- lineChart.series[i].data.Add(sd);
- }
- else
- lineChart.series[i].data[j].data[1] = data.sdata[i].values[j];
- }
- }
- }
- }
- }
|