 |
AirControl
1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
|
8 using System.Collections;
9 using System.Collections.Generic;
14 [DisallowMultipleComponent]
18 private Serie serie, serie1;
24 private void OnEnable()
32 StartCoroutine(RadarDemo());
35 IEnumerator RadarDemo()
37 StartCoroutine(RadarAdd());
38 yield
return new WaitForSeconds(2);
39 StartCoroutine(RadarUpdate());
40 yield
return new WaitForSeconds(2);
41 StartCoroutine(RadarAddMultiple());
42 yield
return new WaitForSeconds(2);
46 IEnumerator RadarAdd()
49 if (chart ==
null) chart = gameObject.AddComponent<
RadarChart>();
65 chart.AddIndicator(0,
"indicator1", 0, 100);
66 chart.AddIndicator(0,
"indicator2", 0, 100);
67 chart.AddIndicator(0,
"indicator3", 0, 100);
68 chart.AddIndicator(0,
"indicator4", 0, 100);
69 chart.AddIndicator(0,
"indicator5", 0, 100);
73 chart.
AddData(0,
new List<double> { 10, 20, 60, 40, 20 },
"data1");
74 chart.
AddData(0,
new List<double> { 40, 60, 90, 80, 70 },
"data2");
75 yield
return new WaitForSeconds(1);
78 IEnumerator RadarUpdate()
81 chart.
UpdateData(0, 0,
new List<double> { 15, 30, 50, 60, 50 });
83 yield
return new WaitForSeconds(1);
86 IEnumerator RadarAddMultiple()
103 for (
int i = 1; i <= 5; i++)
105 chart.AddIndicator(0,
"radar1" + i, 0, 100);
109 for (
int i = 1; i <= 5; i++)
111 chart.AddIndicator(1,
"radar2" + i, 0, 100);
116 chart.
AddData(0,
new List<double> { 10, 20, 60, 40, 20 },
"data1");
120 chart.
AddData(1,
new List<double> { 10, 20, 60, 40, 20 },
"data2");
121 yield
return new WaitForSeconds(1);
Orient
the layout is horizontal or vertical. 垂直还是水平布局方式。
string text
The main title text, supporting for newlines. 主标题文本,支持使用 换行。
int radarIndex
Index of radar component that radar chart uses. 雷达图所使用的 radar 组件的 index。
virtual SerieData AddData(string serieName, double data, string dataName=null)
Add a data to serie. If serieName doesn't exist in legend,will be add to legend. 添加一个数据到指定的系列中。
Location type. Quick to set the general location. 位置类型。通过Align快速设置大体位置,再通过left,right,top,bottom微调具体位置...
SerieType
the type of serie. 系列类型。
virtual bool UpdateDataName(string serieName, int dataIndex, string dataName)
Update serie data name. 更新指定系列中的指定索引数据名称。
bool UpdateIndicator(int radarIndex, int indicatorIndex, string name, float min, float max)
更新指示器。
Shape
Radar render type, in which 'Polygon' and 'Circle' are supported. 雷达图绘制类型,支持 'Polygon' 和 'Circle'。
Radar coordinate conponnet for radar charts. 雷达图坐标系组件,只适用于雷达图。
bool show
Whether to show legend component. 是否显示图例组件。
Location location
The location of legend. 图例显示的位置。 [default:Location.defaultTop]
virtual bool UpdateData(string serieName, int dataIndex, double value)
Update serie data by serie name. 更新指定系列中的指定索引数据。
float top
Distance between component and the left side of the container. 离容器上侧的距离。
string subText
Subtitle text, supporting for for newlines. 副标题文本,支持使用 换行。
Orient orient
Specify whether the layout of legend component is horizontal or vertical. 布局方式是横还是竖。 [default:Orient....
系列。每个系列通过 type 决定自己的图表类型。
float left
Distance between component and the left side of the container. 离容器左侧的距离。
float itemHeight
Image height of legend symbol. 图例标记的图形高度。 [default:12f]
virtual Serie AddSerie(SerieType type, string serieName=null, bool show=true, bool addToHead=false)
Add a serie to serie list. 添加一个系列到系列列表中。
void AddRadar(Radar radar)
添加雷达坐标系组件。
Legend? legend
The legend setting of chart. 图例组件
void RemoveRadar()
移除所有雷达坐标系组件。
Title? title
The title setting of chart. 标题组件
float itemWidth
Image width of legend symbol. 图例标记的图形宽度。 [default:24f]
virtual void RemoveData()
Remove all data from series and legend. The series list is also cleared. 清除所有系列和图例数据,系列的列表也会被清除。