AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
TriggerDistribution.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4 
5 namespace XCharts.Examples
6 {
7  [DisallowMultipleComponent]
8  public class TriggerDistribution : MonoBehaviour
9  {
10  private BarChart chart;
11  private Serie serie, serie2;
12  private int m_DataNum = 5;
13  void Start()
14  {
15 
16  chart = gameObject.GetComponent<BarChart>();
17  if (chart == null) chart = gameObject.AddComponent<BarChart>();
18  chart.title.text = "Trigger Source";
19  chart.title.subText = "普通柱状图";
20 
21  chart.yAxis0.minMaxType = Axis.AxisMinMaxType.Default;
22 
23  chart.RemoveData();
24  serie = chart.AddSerie(SerieType.Bar, "Bar1");
25  serie.label.show = true;
26  serie2 = chart.AddSerie(SerieType.Bar, "Bar2");
27  serie2.label.show = true;
28  serie2.lineType = LineType.Normal;
29  for (int i = 0; i < 1; i++)
30  {
31  chart.AddData(0, 0);
32  chart.AddData(1, 0);
33  }
34 
35  }
36 
37  void Update()
38  {
39  for (int i = 0; i < 1; i++)
40  {
41  chart.UpdateData(0, 0,UnityEngine.Random.Range(30, 90));
42  chart.UpdateData(1, 0,UnityEngine.Random.Range(30, 90));
43  }
44 
45  }
46 
47 
48  }
49 }
XCharts.SerieType
SerieType
the type of serie. 系列类型。
Definition: Serie.cs:19
XCharts.LineType
LineType
the type of line chart. 折线图样式类型
Definition: Serie.cs:99
XCharts.Serie.label
SerieLabel label
Text label of graphic element,to explain some data information about graphic item like value,...
Definition: Serie.cs:821
XCharts.Axis
The axis in rectangular coordinate. 直角坐标系的坐标轴组件。
Definition: Axis.cs:20
XCharts.Serie.lineType
LineType lineType
The type of line chart. 折线图样式类型。
Definition: Serie.cs:510
XCharts.SerieLabel.show
bool show
Whether the label is showed. 是否显示文本标签。
Definition: SerieLabel.cs:149
XCharts.BarChart
Definition: BarChart_API.cs:14
XCharts.Serie
系列。每个系列通过 type 决定自己的图表类型。
Definition: Serie.cs:261
XCharts.Examples
Definition: RewardChart.cs:14
XCharts.Examples.TriggerDistribution
Definition: TriggerDistribution.cs:8
XCharts.Axis.AxisMinMaxType
AxisMinMaxType
the type of axis min and max value. 坐标轴最大最小刻度显示类型。
Definition: Axis.cs:54