AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
XCharts.CoordinateChart Class Reference

The basic class of rectangular coordinate chart,such as LineChart,BarChart and ScatterChart. 直角坐标系类型图表的基类,如折线图LineChart,柱状图BarChart,散点图ScatterChart都属于这类型的图表。 不可用直接将CoordinateChart绑定到GameObject上。 More...

Inheritance diagram for XCharts.CoordinateChart:

Public Member Functions

override void ClearData ()
 Remove all data from series,legend and axis. It just emptying all of serie's data without emptying the list of series. 清空所有图例,系列和坐标轴类目数据。系列中指示清空系列中的数据,会保留系列列表。 More...
 
override void RemoveData ()
 Remove all data from series,legend and axis. The series list is also cleared. 清空所有图例,系列和坐标轴类目数据。系列的列表也会被清空。 More...
 
void ClearAxisData ()
 Remove all data of Axes. 清除所有x轴和y轴的类目数据。 More...
 
void AddXAxisData (string category, int xAxisIndex=0)
 Add a category data to xAxis. 添加一个类目数据到指定的x轴。 More...
 
void UpdateXAxisData (int index, string category, int xAxisIndex=0)
 Update category data. 更新X轴类目数据。 More...
 
void AddXAxisIcon (Sprite icon, int xAxisIndex=0)
 Add an icon to xAxis. 添加一个图标到指定的x轴。 More...
 
void UdpateXAxisIcon (int index, Sprite icon, int xAxisIndex=0)
 Update xAxis icon. 更新X轴图标。 More...
 
void AddYAxisData (string category, int yAxisIndex=0)
 Add a category data to yAxis. 添加一个类目数据到指定的y轴。 More...
 
void UpdateYAxisData (int index, string category, int yAxisIndex=0)
 Update category data. 更新Y轴类目数据。 More...
 
void AddYAxisIcon (Sprite icon, int yAxisIndex=0)
 Add an icon to yAxis. 添加一个图标到指定的y轴。 More...
 
void UpdateYAxisIcon (int index, Sprite icon, int yAxisIndex=0)
 更新Y轴图标。 More...
 
bool IsValue ()
 reutrn true when all the show axis is Value type. 纯数值坐标轴(数值轴或对数轴)。 More...
 
bool IsCategory ()
 纯类目轴。 More...
 
bool IsInGrid (Grid grid, Vector2 local)
 坐标是否在坐标轴内。 More...
 
bool IsInGrid (Grid grid, Vector3 local)
 
bool IsInGrid (Grid grid, float x, float y)
 
bool IsInAnyGrid (Vector2 local)
 
Grid GetGrid (Vector2 local)
 
void RefreshDataZoom ()
 在下一帧刷新DataZoom More...
 
void RefreshAxisMinMaxValue ()
 立即刷新数值坐标轴的最大最小值 More...
 
Vector3 ClampInGrid (Grid grid, Vector3 pos)
 
void CovertXYAxis (int index)
 转换X轴和Y轴的配置 More...
 
void UpdateCoordinate ()
 更新坐标系原点和宽高 More...
 
void SetMaxCache (int maxCache)
 设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。 More...
 
Grid GetGrid (int index)
 
XAxis GetXAxis (int index)
 
YAxis GetYAxis (int index)
 
override void OnDataZoomRangeChanged (DataZoom dataZoom)
 
bool IsAnyYAxisIsCategory ()
 
void Internal_RefreshLabelPosition (Serie serie, SerieData serieData, SerieLabel serieLabel, Vector3 pos, bool IsNeedCheckPosition, bool isYAxis)
 
void Internal_CheckClipAndDrawPolygon (VertexHelper vh, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, Color32 color, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawPolygon (VertexHelper vh, Vector3 p, float radius, Color32 color, bool clip, bool vertical, Grid grid)
 
void Internal_CheckClipAndDrawPolygon (VertexHelper vh, Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, Color32 startColor, Color32 toColor, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawPolygon (VertexHelper vh, ref Vector3 p1, ref Vector3 p2, ref Vector3 p3, ref Vector3 p4, Color32 startColor, Color32 toColor, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawTriangle (VertexHelper vh, Vector3 p1, Vector3 p2, Vector3 p3, Color32 color, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawTriangle (VertexHelper vh, Vector3 p1, Vector3 p2, Vector3 p3, Color32 color, Color32 color2, Color32 color3, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawLine (VertexHelper vh, Vector3 p1, Vector3 p2, float size, Color32 color, bool clip, Grid grid)
 
void Internal_CheckClipAndDrawSymbol (VertexHelper vh, SerieSymbolType type, float symbolSize, float tickness, Vector3 pos, Color32 color, Color32 toColor, Color32 backgroundColor, float gap, bool clip, float[] cornerRadius, Grid grid, Vector3 startPos)
 
void Internal_CheckClipAndDrawZebraLine (VertexHelper vh, Vector3 p1, Vector3 p2, float size, float zebraWidth, float zebraGap, Color32 color, Color32 toColor, bool clip, Grid grid)
 
Grid GetAxisGridOrDefault (Axis axis)
 
Grid GetDataZoomGridOrDefault (DataZoom dataZoom)
 
Grid GetSerieGridOrDefault (Serie serie)
 
XAxis GetSerieXAxisOrDefault (Serie serie)
 
YAxis GetSerieYAxisOrDefault (Serie serie)
 
float GetXAxisOnZeroOffset (XAxis axis)
 
float GetYAxisOnZeroOffset (YAxis axis)
 
YAxis GetRelatedYAxis (XAxis axis)
 
XAxis GetRelatedXAxis (YAxis axis)
 
float Internal_CheckBarAnimation (Serie serie, int dataIndex, float barHig, out bool isBarEnd)
 
float Internal_GetBarGap (SerieType type)
 
double Internal_GetBarSameStackTotalValue (string stack, int dataIndex, SerieType type)
 
float Internal_GetBarTotalWidth (float categoryWidth, float gap, SerieType type)
 
int Internal_GetBarIndex (Serie currSerie, SerieType type)
 

Protected Member Functions

override void InitComponent ()
 
override void Update ()
 
override void DrawPainterBase (VertexHelper vh)
 
override void DrawBackground (VertexHelper vh)
 
void DrawClip (VertexHelper vh)
 
override void DrawPainterSerie (VertexHelper vh, Serie serie)
 
override void DrawPainterTop (VertexHelper vh)
 
override void CheckTootipArea (Vector2 local, bool isActivedOther)
 
virtual void UpdateTooltipValue (Vector2 local)
 
override void UpdateTooltip ()
 
void UpdateAxisTooltipLabel (int axisIndex, Axis axis)
 
virtual void InitAxisRuntimeData (Axis axis)
 
virtual void CheckMinMaxValue ()
 
virtual void GetSeriesMinMaxValue (Axis axis, int axisIndex, out double tempMinValue, out double tempMaxValue)
 
void UpdateAxisLabelText (Axis axis)
 
virtual void OnCoordinateChanged ()
 
override void OnSizeChanged ()
 
void DrawXTooltipIndicator (VertexHelper vh)
 
void DrawYTooltipIndicator (VertexHelper vh)
 
virtual void DrawLabelBackground (VertexHelper vh)
 
override void OnRefreshLabel ()
 
Color32 GetXLerpColor (Color32 areaColor, Color32 areaToColor, Vector3 pos, Grid grid)
 
Color32 GetYLerpColor (Color32 areaColor, Color32 areaToColor, Vector3 pos, Grid grid)
 
void UpdateSerieGridIndex ()
 
void DrawYBarSerie (VertexHelper vh, Serie serie, int colorIndex)
 
void DrawXBarSerie (VertexHelper vh, Serie serie, int colorIndex)
 
void DrawCandlestickSerie (VertexHelper vh, int colorIndex, Serie serie)
 
void DrawHeatmapSerie (VertexHelper vh, int colorIndex, Serie serie)
 
void DrawLinePoint (VertexHelper vh, Serie serie)
 
void DrawLineArrow (VertexHelper vh, Serie serie)
 
void DrawXLineSerie (VertexHelper vh, Serie serie, int colorIndex)
 
void DrawYLineSerie (VertexHelper vh, Serie serie, int colorIndex)
 
void DrawScatterSerie (VertexHelper vh, int colorIndex, Serie serie)
 

Protected Attributes

StringBuilder sb = new StringBuilder(100)
 
Action< PointerEventData, int > m_OnPointerClickBar
 

Properties

Gridgrid [get]
 grid component. 网格组件。 More...
 
List< Gridgrids [get]
 
List< XAxisxAxes [get]
 the x Axes,xAxes[0] is the first x axis, xAxes[1] is the second x axis. 两个x轴。 More...
 
List< YAxisyAxes [get]
 the y Axes, yAxes[0] is the first y axis, yAxes[1] is the second y axis. 两个y轴。 More...
 
XAxisxAxis0 [get]
 X轴(下) More...
 
XAxisxAxis1 [get]
 X轴(上) More...
 
YAxisyAxis0 [get]
 Y轴(左) More...
 
YAxisyAxis1 [get]
 Y轴(右) More...
 

Detailed Description

The basic class of rectangular coordinate chart,such as LineChart,BarChart and ScatterChart. 直角坐标系类型图表的基类,如折线图LineChart,柱状图BarChart,散点图ScatterChart都属于这类型的图表。 不可用直接将CoordinateChart绑定到GameObject上。

Definition at line 18 of file CoordinateChart_API.cs.

Member Function Documentation

◆ AddXAxisData()

void XCharts.CoordinateChart.AddXAxisData ( string  category,
int  xAxisIndex = 0 
)
inline

Add a category data to xAxis. 添加一个类目数据到指定的x轴。

Parameters
categorythe category data
xAxisIndexwhich xAxis should category add to

Definition at line 101 of file CoordinateChart_API.cs.

102  {
103  var xAxis = GetXAxis(xAxisIndex);
104  if (xAxis != null)
105  {
106  xAxis.AddData(category);
107  }
108  }

◆ AddXAxisIcon()

void XCharts.CoordinateChart.AddXAxisIcon ( Sprite  icon,
int  xAxisIndex = 0 
)
inline

Add an icon to xAxis. 添加一个图标到指定的x轴。

Parameters
icon
xAxisIndex

Definition at line 132 of file CoordinateChart_API.cs.

133  {
134  var xAxis = GetXAxis(xAxisIndex);
135  if (xAxis != null)
136  {
137  xAxis.AddIcon(icon);
138  }
139  }

◆ AddYAxisData()

void XCharts.CoordinateChart.AddYAxisData ( string  category,
int  yAxisIndex = 0 
)
inline

Add a category data to yAxis. 添加一个类目数据到指定的y轴。

Parameters
categorythe category data
yAxisIndexwhich yAxis should category add to

Definition at line 163 of file CoordinateChart_API.cs.

164  {
165  var yAxis = GetYAxis(yAxisIndex);
166  if (yAxis != null)
167  {
168  yAxis.AddData(category);
169  }
170  }

◆ AddYAxisIcon()

void XCharts.CoordinateChart.AddYAxisIcon ( Sprite  icon,
int  yAxisIndex = 0 
)
inline

Add an icon to yAxis. 添加一个图标到指定的y轴。

Parameters
icon
yAxisIndex

Definition at line 194 of file CoordinateChart_API.cs.

195  {
196  var yAxis = GetYAxis(yAxisIndex);
197  if (yAxis != null)
198  {
199  yAxis.AddIcon(icon);
200  }
201  }

◆ ClearAxisData()

void XCharts.CoordinateChart.ClearAxisData ( )
inline

Remove all data of Axes. 清除所有x轴和y轴的类目数据。

Definition at line 81 of file CoordinateChart_API.cs.

82  {
83  foreach (var axis in m_XAxes)
84  {
85  axis.data.Clear();
86  axis.SetAllDirty();
87  }
88  foreach (var axis in m_YAxes)
89  {
90  axis.data.Clear();
91  axis.SetAllDirty();
92  }
93  }

◆ ClearData()

override void XCharts.CoordinateChart.ClearData ( )
inline

Remove all data from series,legend and axis. It just emptying all of serie's data without emptying the list of series. 清空所有图例,系列和坐标轴类目数据。系列中指示清空系列中的数据,会保留系列列表。

Definition at line 60 of file CoordinateChart_API.cs.

61  {
62  base.ClearData();
63  ClearAxisData();
64  }

◆ CovertXYAxis()

void XCharts.CoordinateChart.CovertXYAxis ( int  index)
inline

转换X轴和Y轴的配置

Parameters
index坐标轴索引,0或1

Definition at line 334 of file CoordinateChart_API.cs.

335  {
336  if (index >= 0 && index <= 1)
337  {
338  var xAxis = m_XAxes[index];
339  var yAxis = m_YAxes[index];
340  var tempX = m_XAxes[index].Clone();
341  xAxis.Copy(m_YAxes[index]);
342  yAxis.Copy(tempX);
343  xAxis.runtimeZeroXOffset = 0;
344  xAxis.runtimeZeroYOffset = 0;
345  yAxis.runtimeZeroXOffset = 0;
346  yAxis.runtimeZeroYOffset = 0;
347  xAxis.runtimeMinValue = 0;
348  xAxis.runtimeMaxValue = 0;
349  yAxis.runtimeMinValue = 0;
350  yAxis.runtimeMaxValue = 0;
351  RefreshChart();
352  }
353  }

◆ IsCategory()

bool XCharts.CoordinateChart.IsCategory ( )
inline

纯类目轴。

Definition at line 238 of file CoordinateChart_API.cs.

239  {
240  foreach (var axis in m_XAxes)
241  {
242  if (axis.show && !axis.IsCategory()) return false;
243  }
244  foreach (var axis in m_YAxes)
245  {
246  if (axis.show && !axis.IsCategory()) return false;
247  }
248  return true;
249  }

◆ IsInGrid()

bool XCharts.CoordinateChart.IsInGrid ( Grid  grid,
Vector2  local 
)
inline

坐标是否在坐标轴内。

Definition at line 254 of file CoordinateChart_API.cs.

255  {
256  return IsInGrid(grid, local.x, local.y);
257  }

◆ IsValue()

bool XCharts.CoordinateChart.IsValue ( )
inline

reutrn true when all the show axis is Value type. 纯数值坐标轴(数值轴或对数轴)。

Definition at line 222 of file CoordinateChart_API.cs.

223  {
224  foreach (var axis in m_XAxes)
225  {
226  if (axis.show && !axis.IsValue() && !axis.IsLog()) return false;
227  }
228  foreach (var axis in m_YAxes)
229  {
230  if (axis.show && !axis.IsValue() && !axis.IsLog()) return false;
231  }
232  return true;
233  }

◆ RefreshAxisMinMaxValue()

void XCharts.CoordinateChart.RefreshAxisMinMaxValue ( )
inline

立即刷新数值坐标轴的最大最小值

Definition at line 311 of file CoordinateChart_API.cs.

312  {
313  CheckMinMaxValue();
314  }

◆ RefreshDataZoom()

void XCharts.CoordinateChart.RefreshDataZoom ( )
inline

在下一帧刷新DataZoom

Definition at line 297 of file CoordinateChart_API.cs.

298  {
299  foreach (var handler in m_ComponentHandlers)
300  {
301  if (handler is DataZoomHandler)
302  {
303  (handler as DataZoomHandler).RefreshDataZoomLabel();
304  }
305  }
306  }

◆ RemoveData()

override void XCharts.CoordinateChart.RemoveData ( )
inline

Remove all data from series,legend and axis. The series list is also cleared. 清空所有图例,系列和坐标轴类目数据。系列的列表也会被清空。

Definition at line 71 of file CoordinateChart_API.cs.

72  {
73  base.RemoveData();
74  ClearAxisData();
75  }

◆ SetMaxCache()

void XCharts.CoordinateChart.SetMaxCache ( int  maxCache)
inline

设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。

Definition at line 373 of file CoordinateChart_API.cs.

374  {
375  foreach (var serie in m_Series.list) serie.maxCache = maxCache;
376  foreach (var axis in m_XAxes) axis.maxCache = maxCache;
377  foreach (var axis in m_YAxes) axis.maxCache = maxCache;
378  }

◆ UdpateXAxisIcon()

void XCharts.CoordinateChart.UdpateXAxisIcon ( int  index,
Sprite  icon,
int  xAxisIndex = 0 
)
inline

Update xAxis icon. 更新X轴图标。

Parameters
index
icon
xAxisIndex

Definition at line 148 of file CoordinateChart_API.cs.

149  {
150  var xAxis = GetXAxis(xAxisIndex);
151  if (xAxis != null)
152  {
153  xAxis.UpdateIcon(index, icon);
154  }
155  }

◆ UpdateCoordinate()

void XCharts.CoordinateChart.UpdateCoordinate ( )
inline

更新坐标系原点和宽高

Definition at line 358 of file CoordinateChart_API.cs.

359  {
360  foreach (var grid in m_Grids)
361  {
362  grid.UpdateRuntimeData(m_ChartX, m_ChartY, m_ChartWidth, m_ChartHeight);
363  }
364  foreach (var dataZoom in m_DataZooms)
365  {
366  dataZoom.UpdateRuntimeData(m_ChartX, m_ChartY, m_ChartWidth, m_ChartHeight);
367  }
368  }

◆ UpdateXAxisData()

void XCharts.CoordinateChart.UpdateXAxisData ( int  index,
string  category,
int  xAxisIndex = 0 
)
inline

Update category data. 更新X轴类目数据。

Parameters
indexthe index of category data
category
xAxisIndexwhich xAxis index to update to

Definition at line 117 of file CoordinateChart_API.cs.

118  {
119  var xAxis = GetXAxis(xAxisIndex);
120  if (xAxis != null)
121  {
122  xAxis.UpdateData(index, category);
123  }
124  }

◆ UpdateYAxisData()

void XCharts.CoordinateChart.UpdateYAxisData ( int  index,
string  category,
int  yAxisIndex = 0 
)
inline

Update category data. 更新Y轴类目数据。

Parameters
indexthe index of category data
category
yAxisIndexwhich yAxis index to update to

Definition at line 179 of file CoordinateChart_API.cs.

180  {
181  var yAxis = GetYAxis(yAxisIndex);
182  if (yAxis != null)
183  {
184  yAxis.UpdateData(index, category);
185  }
186  }

◆ UpdateYAxisIcon()

void XCharts.CoordinateChart.UpdateYAxisIcon ( int  index,
Sprite  icon,
int  yAxisIndex = 0 
)
inline

更新Y轴图标。

Parameters
index
icon
yAxisIndex

Definition at line 209 of file CoordinateChart_API.cs.

210  {
211  var yAxis = GetYAxis(yAxisIndex);
212  if (yAxis != null)
213  {
214  yAxis.UpdateIcon(index, icon);
215  }
216  }

Property Documentation

◆ grid

Grid? XCharts.CoordinateChart.grid
get

grid component. 网格组件。

Definition at line 24 of file CoordinateChart_API.cs.

24 { get { return m_Grids.Count > 0 ? m_Grids[0] : null; } }

◆ xAxes

List<XAxis> XCharts.CoordinateChart.xAxes
get

the x Axes,xAxes[0] is the first x axis, xAxes[1] is the second x axis. 两个x轴。

Definition at line 30 of file CoordinateChart_API.cs.

30 { get { return m_XAxes; } }

◆ xAxis0

XAxis? XCharts.CoordinateChart.xAxis0
get

X轴(下)

Definition at line 40 of file CoordinateChart_API.cs.

40 { get { return m_XAxes.Count > 0 ? m_XAxes[0] : null; } }

◆ xAxis1

XAxis? XCharts.CoordinateChart.xAxis1
get

X轴(上)

Definition at line 44 of file CoordinateChart_API.cs.

44 { get { return m_XAxes.Count > 1 ? m_XAxes[1] : null; } }

◆ yAxes

List<YAxis> XCharts.CoordinateChart.yAxes
get

the y Axes, yAxes[0] is the first y axis, yAxes[1] is the second y axis. 两个y轴。

Definition at line 35 of file CoordinateChart_API.cs.

35 { get { return m_YAxes; } }

◆ yAxis0

YAxis? XCharts.CoordinateChart.yAxis0
get

Y轴(左)

Definition at line 48 of file CoordinateChart_API.cs.

48 { get { return m_YAxes.Count > 0 ? m_YAxes[0] : null; } }

◆ yAxis1

YAxis? XCharts.CoordinateChart.yAxis1
get

Y轴(右)

Definition at line 52 of file CoordinateChart_API.cs.

52 { get { return m_YAxes.Count > 1 ? m_YAxes[1] : null; } }

The documentation for this class was generated from the following files:
XCharts.CoordinateChart.ClearAxisData
void ClearAxisData()
Remove all data of Axes. 清除所有x轴和y轴的类目数据。
Definition: CoordinateChart_API.cs:81
XCharts.CoordinateChart.IsInGrid
bool IsInGrid(Grid grid, Vector2 local)
坐标是否在坐标轴内。
Definition: CoordinateChart_API.cs:254
XCharts.CoordinateChart.grid
Grid? grid
grid component. 网格组件。
Definition: CoordinateChart_API.cs:24