移动端测试
This commit is contained in:
@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
@ -94,7 +95,7 @@ public class ChartDataUpdateController : Singleton<ChartDataUpdateController>
|
||||
{
|
||||
bar.series[index].label.formatter = "{c:f2}";
|
||||
}
|
||||
|
||||
|
||||
List<BarData> barData = JsonDataTool.Inst.JsonToOptionList<BarData>(data);
|
||||
|
||||
bar.series[index].ClearData();
|
||||
@ -121,7 +122,7 @@ public class ChartDataUpdateController : Singleton<ChartDataUpdateController>
|
||||
/// <param name="index">UI层</param>
|
||||
/// <param name="pie">饼图Chart载体</param>
|
||||
/// <param name="data">更新数据(Json)</param>
|
||||
void PieUpdate(int index, BaseChart pie, string data,Text text, int plan,string format)
|
||||
void PieUpdate(int index, BaseChart pie, string data, Text text, int plan, string format)
|
||||
{
|
||||
List<PieData> pieData = JsonDataTool.Inst.JsonToOptionList<PieData>(data);
|
||||
float sum = 0;
|
||||
@ -136,7 +137,7 @@ public class ChartDataUpdateController : Singleton<ChartDataUpdateController>
|
||||
}
|
||||
if (plan >= 0 && text != null)
|
||||
{
|
||||
text.text = string.Format("{0:" + format + "}%", (pie.series[index].data[plan].data[1] / sum)*100);
|
||||
text.text = string.Format("{0:" + format + "}%", (pie.series[index].data[plan].data[1] / sum) * 100);
|
||||
}
|
||||
pie.series[index].animation.FadeIn();
|
||||
}
|
||||
@ -159,7 +160,7 @@ public class ChartDataUpdateController : Singleton<ChartDataUpdateController>
|
||||
}
|
||||
if (plan >= 0 && text != null)
|
||||
{
|
||||
text.text = string.Format("{0:"+ format +"}%", (ring.series[index].data[plan].data[0] / ring.series[index].data[plan].data[1]) * 100);
|
||||
text.text = string.Format("{0:" + format + "}%", (ring.series[index].data[plan].data[0] / ring.series[index].data[plan].data[1]) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,7 +222,8 @@ public class Chart
|
||||
public Text text; // 显示进度的UI
|
||||
public string format = "f0"; // 格式(小数点后位数)
|
||||
|
||||
public Chart(UIType type,int index,string url,int plan,string format) {
|
||||
public Chart(UIType type, int index, string url, int plan, string format)
|
||||
{
|
||||
this.type = type;
|
||||
this.index = index;
|
||||
this.url = url;
|
||||
|
Reference in New Issue
Block a user