AirControl  1.3.0
Open Source, Modular, and Extensible Flight Simulator For Deep Learning Research
BaseChart_API.cs
1 /************************************************/
2 /* */
3 /* Copyright (c) 2018 - 2021 monitor1394 */
4 /* https://github.com/monitor1394 */
5 /* */
6 /************************************************/
7 
8 using UnityEngine;
9 using System.Collections.Generic;
10 using System;
11 using UnityEngine.UI;
12 using UnityEngine.EventSystems;
13 using System.Text;
14 
15 namespace XCharts
16 {
21  public partial class BaseChart
22  {
26  public string chartName
27  {
28  get { return m_ChartName; }
29  set
30  {
31  if (!string.IsNullOrEmpty(value) && XChartsMgr.Instance.ContainsChart(value))
32  {
33  Debug.LogError("chartName repeated:" + value);
34  }
35  else
36  {
37  m_ChartName = value;
38  }
39  }
40  }
44  public ChartTheme theme { get { return m_Theme; } set { m_Theme = value; } }
49  public Title title { get { return m_Titles.Count > 0 ? m_Titles[0] : null; } }
50  public List<Title> titles { get { return m_Titles; } }
55  public Legend legend { get { return m_Legends.Count > 0 ? m_Legends[0] : null; } }
56  public List<Legend> legends { get { return m_Legends; } }
61  public Tooltip tooltip { get { return m_Tooltips.Count > 0 ? m_Tooltips[0] : null; } }
66  public Series series { get { return m_Series; } }
71  public Settings settings { get { return m_Settings; } }
76  public DataZoom dataZoom { get { return m_DataZooms.Count > 0 ? m_DataZooms[0] : null; } }
77  public List<DataZoom> dataZooms { get { return m_DataZooms; } }
82  public VisualMap visualMap { get { return m_VisualMaps.Count > 0 ? m_VisualMaps[0] : null; } }
83  public List<VisualMap> visualMaps { get { return m_VisualMaps; } }
88  public float chartX { get { return m_ChartX; } }
93  public float chartY { get { return m_ChartY; } }
98  public float chartWidth { get { return m_ChartWidth; } }
103  public float chartHeight { get { return m_ChartHeight; } }
104  public Vector2 chartMinAnchor { get { return m_ChartMinAnchor; } }
105  public Vector2 chartMaxAnchor { get { return m_ChartMaxAnchor; } }
106  public Vector2 chartPivot { get { return m_ChartPivot; } }
107  public Vector2 chartSizeDelta { get { return m_ChartSizeDelta; } }
112  public Vector3 chartPosition { get { return m_ChartPosition; } }
113  public Rect chartRect { get { return m_ChartRect; } }
117  public Action<VertexHelper> onCustomDraw { set { m_OnCustomDrawBaseCallback = value; } }
121  public Action<VertexHelper, Serie> onCustomDrawBeforeSerie { set { m_OnCustomDrawSerieBeforeCallback = value; } }
125  public Action<VertexHelper, Serie> onCustomDrawAfterSerie { set { m_OnCustomDrawSerieAfterCallback = value; } }
129  public Action<VertexHelper> onCustomDrawTop { set { m_OnCustomDrawTopCallback = value; } }
134  public Action<PointerEventData, int, int> onPointerClickPie { set { m_OnPointerClickPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerClickPie; } }
135 
140  public void RefreshChart()
141  {
142  m_RefreshChart = true;
143  if (m_Painter) m_Painter.Refresh();
144  }
145 
151  public virtual void ClearData()
152  {
153  m_Series.ClearData();
154  foreach (var legend in m_Legends) legend.ClearData();
155  tooltip.ClearValue();
156  m_CheckAnimation = false;
157  m_ReinitLabel = true;
158  RefreshChart();
159  }
160 
166  public virtual void RemoveData()
167  {
168  foreach (var legend in m_Legends) legend.ClearData();
169  foreach (var radar in m_Radars) radar.indicatorList.Clear();
170  m_Series.RemoveAll();
171  tooltip.ClearValue();
172  m_CheckAnimation = false;
173  m_ReinitLabel = true;
174  m_SerieLabelRoot = null;
175  RefreshChart();
176  }
177 
183  public virtual void RemoveData(string serieName)
184  {
185  m_Series.RemoveSerie(serieName);
186  foreach (var legend in m_Legends) legend.RemoveData(serieName);
187  m_SerieLabelRoot = null;
188  RefreshChart();
189  }
190 
199  public virtual Serie AddSerie(SerieType type, string serieName = null, bool show = true, bool addToHead = false)
200  {
201  return m_Series.AddSerie(type, serieName, show, addToHead);
202  }
203 
212  public virtual Serie AddSerie(string serieType, string serieName = null, bool show = true, bool addToHead = false)
213  {
214  var type = SerieType.Custom;
215  var list = Enum.GetNames(typeof(SerieType));
216  foreach (var t in list)
217  {
218  if (t.Equals(serieType)) type = (SerieType)Enum.Parse(typeof(SerieType), t);
219  }
220  return AddSerie(type, serieName, show, addToHead);
221  }
222 
223  public virtual Serie InsertSerie(int index, SerieType serieType, string serieName = null, bool show = true)
224  {
225  return m_Series.InsertSerie(index, serieType, serieName, show);
226  }
227 
237  public virtual SerieData AddData(string serieName, double data, string dataName = null)
238  {
239  var serieData = m_Series.AddData(serieName, data, dataName);
240  if (serieData != null)
241  {
242  var serie = m_Series.GetSerie(serieName);
243  if (SerieHelper.GetSerieLabel(serie, serieData).show)
244  {
245  RefreshLabel();
246  }
247  RefreshPainter(serie);
248  }
249  return serieData;
250  }
251 
260  public virtual SerieData AddData(int serieIndex, double data, string dataName = null)
261  {
262  var serieData = m_Series.AddData(serieIndex, data, dataName);
263  if (serieData != null)
264  {
265  var serie = m_Series.GetSerie(serieIndex);
266  if (SerieHelper.GetSerieLabel(serie, serieData).show)
267  {
268  RefreshLabel();
269  }
270  RefreshPainter(serie);
271  }
272  return serieData;
273  }
274 
283  public virtual SerieData AddData(string serieName, List<double> multidimensionalData, string dataName = null)
284  {
285  var serieData = m_Series.AddData(serieName, multidimensionalData, dataName);
286  if (serieData != null)
287  {
288  var serie = m_Series.GetSerie(serieName);
289  if (SerieHelper.GetSerieLabel(serie, serieData).show)
290  {
291  RefreshLabel();
292  }
293  RefreshPainter(serie);
294  }
295  return serieData;
296  }
297 
306  public virtual SerieData AddData(int serieIndex, List<double> multidimensionalData, string dataName = null)
307  {
308  var serieData = m_Series.AddData(serieIndex, multidimensionalData, dataName);
309  if (serieData != null)
310  {
311  var serie = m_Series.GetSerie(serieIndex);
312  if (SerieHelper.GetSerieLabel(serie, serieData).show)
313  {
314  RefreshLabel();
315  }
316  RefreshPainter(serie);
317  }
318  return serieData;
319  }
320 
330  public virtual SerieData AddData(string serieName, double xValue, double yValue, string dataName = null)
331  {
332  var serieData = m_Series.AddXYData(serieName, xValue, yValue, dataName);
333  if (serieData != null)
334  {
335  var serie = m_Series.GetSerie(serieName);
336  if (SerieHelper.GetSerieLabel(serie, serieData).show)
337  {
338  RefreshLabel();
339  }
340  RefreshPainter(serie);
341  }
342  return serieData;
343  }
344 
354  public virtual SerieData AddData(int serieIndex, double xValue, double yValue, string dataName = null)
355  {
356  var serieData = m_Series.AddXYData(serieIndex, xValue, yValue, dataName);
357  if (serieData != null)
358  {
359  var serie = m_Series.GetSerie(serieIndex);
360  if (SerieHelper.GetSerieLabel(serie, serieData).show)
361  {
362  RefreshLabel();
363  }
364  RefreshPainter(serie);
365  }
366  return serieData;
367  }
368  public virtual SerieData AddData(int serieIndex, double open, double close, double lowest, double heighest, string dataName = null)
369  {
370  var serieData = m_Series.AddData(serieIndex, open, close, lowest, heighest, dataName);
371  if (serieData != null)
372  {
373  var serie = m_Series.GetSerie(serieIndex);
374  if (SerieHelper.GetSerieLabel(serie, serieData).show)
375  {
376  RefreshLabel();
377  }
378  RefreshPainter(serie);
379  }
380  return serieData;
381  }
382 
390  public virtual bool UpdateData(string serieName, int dataIndex, double value)
391  {
392  if (m_Series.UpdateData(serieName, dataIndex, value))
393  {
394  RefreshPainter(m_Series.GetSerie(serieName));
395  return true;
396  }
397  return false;
398  }
399 
407  public virtual bool UpdateData(int serieIndex, int dataIndex, double value)
408  {
409  if (m_Series.UpdateData(serieIndex, dataIndex, value))
410  {
411  RefreshPainter(m_Series.GetSerie(serieIndex));
412  return true;
413  }
414  return false;
415  }
416 
423  public virtual bool UpdateData(string serieName, int dataIndex, List<double> multidimensionalData)
424  {
425  if (m_Series.UpdateData(serieName, dataIndex, multidimensionalData))
426  {
427  RefreshPainter(m_Series.GetSerie(serieName));
428  return true;
429  }
430  return false;
431  }
432 
439  public virtual bool UpdateData(int serieIndex, int dataIndex, List<double> multidimensionalData)
440  {
441  if (m_Series.UpdateData(serieIndex, dataIndex, multidimensionalData))
442  {
443  RefreshPainter(m_Series.GetSerie(serieIndex));
444  return true;
445  }
446  return false;
447  }
448 
456  public virtual bool UpdateData(string serieName, int dataIndex, int dimension, double value)
457  {
458  if (m_Series.UpdateData(serieName, dataIndex, dimension, value))
459  {
460  RefreshPainter(m_Series.GetSerie(serieName));
461  return true;
462  }
463  return false;
464  }
465 
473  public virtual bool UpdateData(int serieIndex, int dataIndex, int dimension, double value)
474  {
475  if (m_Series.UpdateData(serieIndex, dataIndex, dimension, value))
476  {
477  RefreshPainter(m_Series.GetSerie(serieIndex));
478  return true;
479  }
480  return false;
481  }
482 
490  public virtual bool UpdateDataName(string serieName, int dataIndex, string dataName)
491  {
492  return m_Series.UpdateDataName(serieName, dataIndex, dataName);
493  }
494 
502  public virtual bool UpdateDataName(int serieIndex, int dataIndex, string dataName)
503  {
504  return m_Series.UpdateDataName(serieIndex, dataIndex, dataName);
505  }
506 
513  public virtual void SetActive(string serieName, bool active)
514  {
515  var serie = m_Series.GetSerie(serieName);
516  if (serie != null)
517  {
518  SetActive(serie.index, active);
519  }
520  }
521 
528  public virtual void SetActive(int serieIndex, bool active)
529  {
530  m_Series.SetActive(serieIndex, active);
531  var serie = m_Series.GetSerie(serieIndex);
532  if (serie != null && !string.IsNullOrEmpty(serie.name))
533  {
534  UpdateLegendColor(serie.name, active);
535  }
536  }
537 
538  public virtual void UpdateLegendColor(string legendName, bool active)
539  {
540  var legendIndex = m_LegendRealShowName.IndexOf(legendName);
541  if (legendIndex >= 0)
542  {
543  foreach (var legend in m_Legends)
544  {
545  var iconColor = LegendHelper.GetIconColor(this, legendIndex, legendName, active);
546  var contentColor = LegendHelper.GetContentColor(legendIndex, legend, m_Theme, active);
547  legend.UpdateButtonColor(legendName, iconColor);
548  legend.UpdateContentColor(legendName, contentColor);
549  }
550  }
551  }
552 
559  public virtual bool IsActive(string serieName)
560  {
561  return m_Series.IsActive(serieName);
562  }
563 
570  public virtual bool IsActive(int serieIndex)
571  {
572  return m_Series.IsActive(serieIndex);
573  }
574 
581  public virtual bool IsActiveByLegend(string legendName)
582  {
583  foreach (var serie in m_Series.list)
584  {
585  if (serie.show && legendName.Equals(serie.name))
586  {
587  return true;
588  }
589  else
590  {
591  foreach (var serieData in serie.data)
592  {
593  if (serieData.show && legendName.Equals(serieData.name))
594  {
595  return true;
596  }
597  }
598  }
599 
600  }
601  return false;
602  }
603 
607  public void RefreshLabel()
608  {
609  m_ReinitLabel = true;
610  m_SerieLabelRoot = null;
611  }
612 
616  public void RefreshTooltip()
617  {
618  InitTooltip();
619  }
620 
626  public bool UpdateTheme(Theme theme)
627  {
628  if (theme == Theme.Custom)
629  {
630  Debug.LogError("UpdateTheme: not support switch to Custom theme.");
631  return false;
632  }
633  m_Theme.theme = theme;
634  return true;
635  }
636 
643  {
644  m_Theme.CopyTheme(theme);
645  SetAllComponentDirty();
646 #if UNITY_EDITOR
647  UnityEditor.EditorUtility.SetDirty(this);
648 #endif
649  }
650 
656  public void AnimationEnable(bool flag)
657  {
658  foreach (var serie in m_Series.list) serie.AnimationEnable(flag);
659  }
660 
665  public void AnimationFadeIn()
666  {
667  foreach (var serie in m_Series.list) serie.AnimationFadeIn();
668  }
669 
674  public void AnimationFadeOut()
675  {
676  foreach (var serie in m_Series.list) serie.AnimationFadeOut();
677  }
678 
683  public void AnimationPause()
684  {
685  foreach (var serie in m_Series.list) serie.AnimationPause();
686  }
687 
692  public void AnimationResume()
693  {
694  foreach (var serie in m_Series.list) serie.AnimationResume();
695  }
696 
701  public void AnimationReset()
702  {
703  foreach (var serie in m_Series.list) serie.AnimationReset();
704  }
705 
712  public void ClickLegendButton(int legendIndex, string legendName, bool show)
713  {
714  OnLegendButtonClick(legendIndex, legendName, show);
715  RefreshChart();
716  }
717 
723  public bool IsInChart(Vector2 local)
724  {
725  return IsInChart(local.x, local.y);
726  }
727 
728  public bool IsInChart(float x, float y)
729  {
730  if (x < m_ChartX || x > m_ChartX + m_ChartWidth ||
731  y < m_ChartY || y > m_ChartY + m_ChartHeight)
732  {
733  return false;
734  }
735  return true;
736  }
737 
738  public void ClampInChart(ref Vector3 pos)
739  {
740  if (!IsInChart(pos.x, pos.y))
741  {
742  if (pos.x < m_ChartX) pos.x = m_ChartX;
743  if (pos.x > m_ChartX + m_ChartWidth) pos.x = m_ChartX + m_ChartWidth;
744  if (pos.y < m_ChartY) pos.y = m_ChartY;
745  if (pos.y > m_ChartY + m_ChartHeight) pos.y = m_ChartY + m_ChartHeight;
746  }
747  }
748 
749  public Vector3 GetTitlePosition(Title title)
750  {
752  }
753 
754  public bool ContainsSerie(SerieType serieType)
755  {
756  return SeriesHelper.ContainsSerie(m_Series, serieType);
757  }
758 
759  public virtual bool AddDefaultCustomSerie(string serieName, int dataCount = 5)
760  {
761  return false;
762  }
763 
764  public virtual string[] GetCustomSerieInspectorShowFileds()
765  {
766  return null;
767  }
768  public virtual string[][] GetCustomSerieInspectorCustomFileds()
769  {
770  return null;
771  }
772  public virtual string[] GetCustomChartInspectorShowFileds()
773  {
774  return null;
775  }
776 
777  public virtual string GetCustomSerieTypeName()
778  {
779  return null;
780  }
781 
782  public virtual bool GetCustomSerieDataNameForColor()
783  {
784  return false;
785  }
786 
787  public int GetLegendRealShowNameIndex(string name)
788  {
789  return m_LegendRealShowName.IndexOf(name);
790  }
791 
792  public virtual void InitCustomSerieTooltip(ref StringBuilder stringBuilder, Serie serie, int index)
793  {
794  }
795 
800  public void SetBasePainterMaterial(Material material)
801  {
802  settings.basePainterMaterial = material;
803  if (m_Painter != null)
804  {
805  m_Painter.material = material;
806  }
807  }
808 
813  public void SetSeriePainterMaterial(Material material)
814  {
815  settings.basePainterMaterial = material;
816  if (m_PainterList != null)
817  {
818  foreach (var painter in m_PainterList)
819  painter.material = material;
820  }
821  }
822 
827  public void SetTopPainterMaterial(Material material)
828  {
829  settings.topPainterMaterial = material;
830  if (m_PainterTop != null)
831  {
832  m_PainterTop.material = material;
833  }
834  }
835  }
836 }
XCharts.BaseChart.AnimationResume
void AnimationResume()
Stop play animation. 继续动画。
Definition: BaseChart_API.cs:692
XCharts.Tooltip
Tooltip component. 提示框组件。
Definition: Tooltip.cs:19
XCharts.Location.GetPosition
Vector3 GetPosition(float chartWidth, float chartHeight)
返回在坐标系中的具体位置
Definition: Location.cs:283
XCharts.BaseChart.ClearData
virtual void ClearData()
Remove all series and legend data. It just emptying all of serie's data without emptying the list of ...
Definition: BaseChart_API.cs:151
XCharts.BaseChart.SetBasePainterMaterial
void SetBasePainterMaterial(Material material)
设置Base Painter的材质球
Definition: BaseChart_API.cs:800
XCharts.Legend.UpdateButtonColor
void UpdateButtonColor(string name, Color color)
Update the legend button color. 更新图例按钮颜色。
Definition: Legend.cs:402
XCharts.Title.location
Location location
The location of title component. 标题显示位置。
Definition: Title.cs:81
XCharts.BaseChart.UpdateData
virtual bool UpdateData(string serieName, int dataIndex, int dimension, double value)
更新指定系列指定索引指定维数的数据。维数从0开始。
Definition: BaseChart_API.cs:456
XCharts.VisualMap
VisualMap component. Mapping data to visual elements such as colors. 视觉映射组件。用于进行『视觉编码』,也就是将数据映射到视觉元素(...
Definition: VisualMap.cs:21
XCharts.Theme
Theme
主题
Definition: ChartTheme.cs:21
XCharts.Series.AddData
SerieData AddData(string serieName, double value, string dataName=null)
添加一个数据到指定系列的维度Y数据中
Definition: Series.cs:324
XCharts.BaseChart.AddData
virtual SerieData AddData(int serieIndex, double xValue, double yValue, string dataName=null)
Add a (x,y) data to serie. 添加(x,y)数据到指定系列中。
Definition: BaseChart_API.cs:354
XCharts.BaseChart.AddData
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. 添加一个数据到指定的系列中。
Definition: BaseChart_API.cs:237
XCharts.BaseChart.AnimationEnable
void AnimationEnable(bool flag)
Whether series animation enabel. 启用或关闭起始动画。
Definition: BaseChart_API.cs:656
XCharts.DataZoom
DataZoom component is used for zooming a specific area, which enables user to investigate data in det...
Definition: DataZoom.cs:24
XCharts.Series.RemoveAll
void RemoveAll()
Remove all serie from series. 移除所有系列。
Definition: Series.cs:260
XCharts.BaseChart.ClickLegendButton
void ClickLegendButton(int legendIndex, string legendName, bool show)
点击图例按钮
Definition: BaseChart_API.cs:712
XCharts.Series.AddSerie
Serie AddSerie(SerieType type, string serieName, bool show=true, bool addToHead=false)
添加一个系列到列表中。
Definition: Series.cs:273
XCharts.BaseChart.chartX
float chartX
The x of chart. 图表的X
Definition: BaseChart_API.cs:88
XCharts.SerieType
SerieType
the type of serie. 系列类型。
Definition: Serie.cs:19
XCharts.Series.SetActive
void SetActive(string name, bool active)
设置指定系列是否显示
Definition: Series.cs:645
XCharts.Legend.ClearData
void ClearData()
Clear legend data. 清空。
Definition: Legend.cs:301
XCharts.Title
Title component, including main title and subtitle. 标题组件,包含主标题和副标题。
Definition: Title.cs:18
XCharts.BaseChart.UpdateTheme
void UpdateTheme(ChartTheme theme)
Update chart theme info. 切换图表主题。
Definition: BaseChart_API.cs:642
XCharts.BaseChart.IsActive
virtual bool IsActive(int serieIndex)
Whether serie is activated. 获取指定系列是否显示。
Definition: BaseChart_API.cs:570
XCharts.BaseChart.RefreshTooltip
void RefreshTooltip()
刷新Tooltip组件。
Definition: BaseChart_API.cs:616
XCharts.BaseChart.tooltip
Tooltip? tooltip
The tooltip setting of chart. 提示框组件
Definition: BaseChart_API.cs:61
XCharts.BaseChart.AddSerie
virtual Serie AddSerie(string serieType, string serieName=null, bool show=true, bool addToHead=false)
Add a serie to serie list. 通过字符串类型的serieType添加一个系列到系列列表中。如果serieType不是已定义的SerieType类型,则设置为Custom类型。
Definition: BaseChart_API.cs:212
XCharts.BaseChart.UpdateTheme
bool UpdateTheme(Theme theme)
Update chart theme. 切换内置主题。
Definition: BaseChart_API.cs:626
XCharts.BaseChart.UpdateDataName
virtual bool UpdateDataName(int serieIndex, int dataIndex, string dataName)
Update serie data name. 更新指定系列中的指定索引数据名称。
Definition: BaseChart_API.cs:502
XCharts.BaseChart.UpdateData
virtual bool UpdateData(int serieIndex, int dataIndex, int dimension, double value)
更新指定系列指定索引指定维数的数据。维数从0开始。
Definition: BaseChart_API.cs:473
XCharts.BaseChart.UpdateDataName
virtual bool UpdateDataName(string serieName, int dataIndex, string dataName)
Update serie data name. 更新指定系列中的指定索引数据名称。
Definition: BaseChart_API.cs:490
XCharts.BaseChart.IsInChart
bool IsInChart(Vector2 local)
坐标是否在图表范围内
Definition: BaseChart_API.cs:723
XCharts.BaseChart.dataZoom
DataZoom? dataZoom
dataZoom component. 区域缩放组件。
Definition: BaseChart_API.cs:76
XCharts.BaseChart.settings
Settings settings
Global parameter setting component. 全局设置组件。
Definition: BaseChart_API.cs:71
XCharts.BaseChart.UpdateData
virtual bool UpdateData(int serieIndex, int dataIndex, double value)
Update serie data by serie index. 更新指定系列中的指定索引数据。
Definition: BaseChart_API.cs:407
XCharts.BaseChart.SetActive
virtual void SetActive(int serieIndex, bool active)
Whether to show serie. 设置指定系列是否显示。
Definition: BaseChart_API.cs:528
XCharts.BaseChart.RefreshChart
void RefreshChart()
Redraw chart in next frame. 在下一帧刷新图表。
Definition: BaseChart_API.cs:140
XCharts.Legend
Legend component.The legend component shows different sets of tags, colors, and names....
Definition: Legend.cs:20
XCharts
Definition: RewardChart.cs:14
XCharts.BaseChart.SetActive
virtual void SetActive(string serieName, bool active)
Whether to show serie. 设置指定系列是否显示。
Definition: BaseChart_API.cs:513
XCharts.Series.UpdateDataName
bool UpdateDataName(string serieName, int dataIndex, string dataName)
更新指定系列的数据项名称
Definition: Series.cs:473
XCharts.BaseChart.IsActive
virtual bool IsActive(string serieName)
Whether serie is activated. 获取指定系列是否显示。
Definition: BaseChart_API.cs:559
XCharts.ChartTheme.theme
Theme theme
the theme of chart. 主题类型。
Definition: ChartTheme.cs:93
XCharts.BaseChart.AddData
virtual SerieData AddData(string serieName, List< double > multidimensionalData, string dataName=null)
Add an arbitray dimension data to serie,such as (x,y,z,...). 添加多维数据(x,y,z...)到指定的系列中。
Definition: BaseChart_API.cs:283
XCharts.BaseChart.onCustomDrawTop
Action< VertexHelper > onCustomDrawTop
自定义Top绘制回调。在绘制Tooltip前调用。
Definition: BaseChart_API.cs:129
XCharts.BaseChart.chartY
float chartY
The y of chart. 图表的Y
Definition: BaseChart_API.cs:93
XCharts.BaseChart.AddData
virtual SerieData AddData(string serieName, double xValue, double yValue, string dataName=null)
Add a (x,y) data to serie. 添加(x,y)数据到指定系列中。
Definition: BaseChart_API.cs:330
XCharts.BaseChart.UpdateData
virtual bool UpdateData(string serieName, int dataIndex, double value)
Update serie data by serie name. 更新指定系列中的指定索引数据。
Definition: BaseChart_API.cs:390
XCharts.Series.ClearData
void ClearData()
清空所有系列的数据
Definition: Series.cs:104
XCharts.Series.GetSerie
Serie GetSerie(string name)
获得指定系列名的第一个系列
Definition: Series.cs:148
XCharts.Series.list
List< Serie > list
the list of serie 系列列表。
Definition: Series.cs:28
XCharts.BaseChart.AnimationFadeOut
void AnimationFadeOut()
fadeIn animation. 开始渐出动画。
Definition: BaseChart_API.cs:674
XCharts.BaseChart.series
Series series
The series setting of chart. 系列列表
Definition: BaseChart_API.cs:66
XCharts.BaseChart.SetSeriePainterMaterial
void SetSeriePainterMaterial(Material material)
设置Serie Painter的材质球
Definition: BaseChart_API.cs:813
XCharts.Serie
系列。每个系列通过 type 决定自己的图表类型。
Definition: Serie.cs:261
XCharts.Series
the list of series. 系列列表。每个系列通过 type 决定自己的图表类型。
Definition: Series.cs:19
XCharts.BaseChart.onCustomDrawAfterSerie
Action< VertexHelper, Serie > onCustomDrawAfterSerie
自定义Serie绘制回调。在每个Serie绘制完后调用。
Definition: BaseChart_API.cs:125
XCharts.Series.UpdateData
bool UpdateData(string serieName, int dataIndex, double value)
更新指定系列的维度Y数据
Definition: Series.cs:457
XCharts.BaseChart.AddData
virtual SerieData AddData(int serieIndex, double data, string dataName=null)
Add a data to serie. 添加一个数据到指定的系列中。
Definition: BaseChart_API.cs:260
XCharts.BaseChart.onCustomDrawBeforeSerie
Action< VertexHelper, Serie > onCustomDrawBeforeSerie
自定义Serie绘制回调。在每个Serie绘制完前调用。
Definition: BaseChart_API.cs:121
XCharts.BaseChart.chartHeight
float chartHeight
The height of chart. 图表的高
Definition: BaseChart_API.cs:103
XCharts.BaseChart.AddSerie
virtual Serie AddSerie(SerieType type, string serieName=null, bool show=true, bool addToHead=false)
Add a serie to serie list. 添加一个系列到系列列表中。
Definition: BaseChart_API.cs:199
XCharts.ChartTheme
Theme. 主题相关配置。
Definition: ChartTheme.cs:46
XCharts.BaseChart.RefreshLabel
void RefreshLabel()
刷新文本标签Label,重新初始化,当有改动Label参数时手动调用改接口
Definition: BaseChart_API.cs:607
XCharts.Settings.topPainterMaterial
Material topPainterMaterial
Top Pointer 材质球,设置后会影响Tooltip等。
Definition: Settings.cs:69
XCharts.BaseChart.chartWidth
float chartWidth
The width of chart. 图表的宽
Definition: BaseChart_API.cs:98
XCharts.BaseChart.RemoveData
virtual void RemoveData(string serieName)
Remove legend and serie by name. 清除指定系列名称的数据。
Definition: BaseChart_API.cs:183
XCharts.BaseChart.legend
Legend? legend
The legend setting of chart. 图例组件
Definition: BaseChart_API.cs:55
XCharts.Series.AddXYData
SerieData AddXYData(string serieName, double xValue, double yValue, string dataName=null)
添加(x,y)数据到指定的系列中
Definition: Series.cs:423
XCharts.XChartsMgr
Definition: XChartsMgr.cs:34
XCharts.SerieSymbolType.Rect
@ Rect
正方形。可通过设置itemStyle的cornerRadius变成圆角矩形。
XCharts.BaseChart.AddData
virtual SerieData AddData(int serieIndex, List< double > multidimensionalData, string dataName=null)
Add an arbitray dimension data to serie,such as (x,y,z,...). 添加多维数据(x,y,z...)到指定的系列中。
Definition: BaseChart_API.cs:306
XCharts.BaseChart.UpdateData
virtual bool UpdateData(string serieName, int dataIndex, List< double > multidimensionalData)
更新指定系列指定索引的数据项的多维数据。
Definition: BaseChart_API.cs:423
XCharts.BaseChart.UpdateData
virtual bool UpdateData(int serieIndex, int dataIndex, List< double > multidimensionalData)
更新指定系列指定索引的数据项的多维数据。
Definition: BaseChart_API.cs:439
XCharts.Legend.RemoveData
void RemoveData(string name)
Removes the legend with the specified name. 移除指定名字的图例。
Definition: Legend.cs:323
XCharts.BaseChart.onCustomDraw
Action< VertexHelper > onCustomDraw
自定义绘制回调。在绘制Serie前调用。
Definition: BaseChart_API.cs:117
XCharts.Settings.basePainterMaterial
Material basePainterMaterial
Base Pointer 材质球,设置后会影响Axis等。
Definition: Settings.cs:53
XCharts.BaseChart.SetTopPainterMaterial
void SetTopPainterMaterial(Material material)
设置Top Painter的材质球
Definition: BaseChart_API.cs:827
XCharts.BaseChart.chartName
string chartName
The name of chart.
Definition: BaseChart_API.cs:27
XCharts.Series.RemoveSerie
bool RemoveSerie(string serieName)
Remove serie from series. 移除指定名字的系列。
Definition: Series.cs:231
XCharts.Legend.UpdateContentColor
void UpdateContentColor(string name, Color color)
Update the text color of legend. 更新图例文字颜色。
Definition: Legend.cs:416
XCharts.BaseChart.onPointerClickPie
Action< PointerEventData, int, int > onPointerClickPie
the callback function of click pie area. 点击饼图区域回调。参数:PointerEventData,SerieIndex,SerieDataIndex
Definition: BaseChart_API.cs:134
XCharts.BaseChart
The base class of all charts. 所有Chart的基类。
Definition: BaseChart_API.cs:21
XCharts.BaseChart.title
Title? title
The title setting of chart. 标题组件
Definition: BaseChart_API.cs:49
XCharts.BaseChart.AnimationFadeIn
void AnimationFadeIn()
fadeIn animation. 开始渐入动画。
Definition: BaseChart_API.cs:665
XCharts.BaseChart.IsActiveByLegend
virtual bool IsActiveByLegend(string legendName)
Whether serie is activated. 获得指定图例名字的系列是否显示。
Definition: BaseChart_API.cs:581
XCharts.BaseChart.AnimationPause
void AnimationPause()
Pause animation. 暂停动画。
Definition: BaseChart_API.cs:683
XCharts.Series.IsActive
bool IsActive(string name)
指定系列是否显示
Definition: Series.cs:623
XCharts.Settings
Global parameter setting component. The default value can be used in general, and can be adjusted whe...
Definition: Settings.cs:18
XCharts.BaseChart.visualMap
VisualMap? visualMap
visualMap component. 视觉映射组件。
Definition: BaseChart_API.cs:82
XCharts.BaseChart.RemoveData
virtual void RemoveData()
Remove all data from series and legend. The series list is also cleared. 清除所有系列和图例数据,系列的列表也会被清除。
Definition: BaseChart_API.cs:166
XCharts.BaseChart.theme
ChartTheme theme
The theme.
Definition: BaseChart_API.cs:44
XCharts.BaseChart.chartPosition
Vector3 chartPosition
The position of chart. 图表的左下角起始坐标。
Definition: BaseChart_API.cs:112
XCharts.BaseChart.AnimationReset
void AnimationReset()
Reset animation. 重置动画。
Definition: BaseChart_API.cs:701
XCharts.SerieData
A data item of serie. 系列中的一个数据项。可存储数据名和1-n维的数据。
Definition: SerieData.cs:19