Files
XCharts/Documentation/XChartsAPI.md

114 lines
6.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# XCharts API
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)
## `BaseChart`
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
* `BaseChart.series`:系列列表`Series`
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.customDrawCallback`:自定义绘制回调函数。
* `BaseChart.SetSize(float width, float height)`:设置图表的大小。
* `BaseChart.ClearData()`:清除所有数据,系列列表会保留,只是移除列表中系列的数据。
* `BaseChart.RemoveData()`:清除所有系列和图例数据,系列列表也会被清除。
* `BaseChart.RemoveData(string serieName)`:清除指定系列名称的数据。
* `BaseChart.AddSerie(SerieType type, string serieName = null, bool show = true)`:添加一个系列到系列列表中。
* `BaseChart.AddData(string serieName, float data, string dataName = null)`:添加一个数据到指定的系列中。
* `BaseChart.AddData(int serieIndex, float data, string dataName = null)`:添加一个数据到指定的系列中。
* `BaseChart.AddData(string serieName, List<float> multidimensionalData, string dataName = null)`:添加多维数据`x,y,z...`到指定的系列中。
* `BaseChart.AddData(int serieIndex, List<float> multidimensionalData, string dataName = null)`:添加多维数据`x,y,z...`到指定的系列中。
* `BaseChart.AddData(string serieName, float xValue, float yValue, string dataName)`:添加`x,y`数据到指定系列中。
* `BaseChart.AddData(int serieIndex, float xValue, float yValue, string dataName = null)`:添加`x,y`数据到指定系列中。
* `BaseChart.UpdateData(string serieName,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(int serieIndex,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateDataName(string serieName,int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.UpdateDataName(int serieIndex, int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.SetActive(string serieName, bool active)`:设置指定系列是否显示。
* `BaseChart.SetActive(int serieIndex, bool active)`:设置指定系列是否显示。
* `BaseChart.IsActive(string serieName)`:获取指定系列是否显示。
* `BaseChart.IsActive(int serieIndex)`:获取指定系列是否显示。
* `BaseChart.IsActiveByLegend(string legendName)`:获得指定图例名字的系列是否显示。
* `BaseChart.RefreshChart()`:在下一帧刷新图表。
* `BaseChart.RefreshLabel()`:在下一帧刷新文本标签。
* `BaseChart.RefreshTooltip()`:立即刷新`Tooltip`组件。
* `BaseChart.UpdateTheme(Theme theme)`:切换图表主题。
* `BaseChart.AnimationEnable(bool flag)`:启用或关闭动画。
* `BaseChart.AnimationFadeIn()`:渐入动画。
* `BaseChart.AnimationFadeOut()`:渐出动画。
* `BaseChart.AnimationPause()`:暂停动画。
* `BaseChart.AnimationResume()`:继续动画。
* `BaseChart.AnimationReset()`:重置动画。
* `BaseChart.ClickLegendButton(int legendIndex, string legendName, bool show)`:点击图例按钮。
## `CoordinateChart`
* `CoordinateChart.grid`:网格组件 `Grid`
* `CoordinateChart.xAxises`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxises`:左右两个 `Y` 轴组件 `YAxis`
* `CoordianteChart.xAxis0`X轴
* `CoordianteChart.xAxis1`X轴
* `CoordianteChart.xAxis0`Y轴
* `CoordianteChart.yAxis1`Y轴
* `CoordinateChart.dataZoom`:区域缩放组件 `DataZoom`
* `CoordinateChart.coordinateX`:坐标系的左下角坐标 `X`
* `CoordinateChart.coordinateY`:坐标系的左下角坐标 `Y`
* `CoordinateChart.coordinateWidth`:坐标系的宽。
* `CoordinateChart.coordinateHeight`:坐标系的高。
* `CoordinateChart.ClearAxisData()`清除所有x轴和y轴的类目数据。
* `CoordinateChart.AddXAxisData(string category, int xAxisIndex = 0)`:添加一个类目数据到指定的 `X` 轴。
* `CoordinateChart.AddYAxisData(string category, int yAxisIndex = 0)`:添加一个类目数据到指定的 `Y` 轴。
* `CoordinateChart.IsValue()`:是否是纯数值坐标。
* `CoordinateChart.RefreshDataZoom()`在下一帧刷新DataZoom组件。
* `CoordinateChart.RefreshAxisMinMaxValue()`:立即刷新数值坐标轴的最大最小值(更新坐标轴标签并触发重绘)。
## `LineChart`
* 继承 `BaseChart`
* 继承自 `CoordinateChart`
## `BarChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `PieChart`
* 继承自 `BaseChart`
## `RadarChart`
* 继承自 `BaseChart`
* `RadarChart.radars`:雷达坐标系组件列表 `Radar`
* `RadarChart.RemoveRadar()`:移除所有雷达坐标系组件。
* `RadarChart.AddRadar(Radar radar)`:添加雷达坐标系组件。
* `RadarChart.AddRadar(Radar.Shape shape, Vector2 center, float radius, int splitNumber = 5,float lineWidth = 0.6f, bool showIndicator = true, bool showSplitArea = true)`:添加雷达坐标系组件。
* `RadarChart.AddIndicator(int radarIndex, string name, float min, float max)`:添加指示器。
* `RadarChart.UpdateIndicator(int radarIndex, int indicatorIndex, string name, float min, float max)`:更新指示器。
* `RadarChart.GetRadar(int radarIndex)`:获得指定索引的雷达坐标系组件。
* `RadarChart.GetIndicator(int radarIndex, int indicatorIndex)`:获得指定雷达坐标系组件指定索引的指示器。
## `ScatterChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `HeatmapChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)