diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf624b2..2d5a34f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,8 @@ ## master +* (2022.09.25) 修复`API`文档中部分接口没有导出的问题 +* (2022.09.24) 优化`FunnelChart` * (2022.09.23) 优化`ParallelChart` * (2022.09.22) 增加`SaveAsImage()`接口保存图表到图片 * (2022.09.21) 修复`InsertSerie()`接口不刷新图表的问题 diff --git a/Documentation/XChartsAPI-EN.md b/Documentation/XChartsAPI-EN.md index 931cd18f..dc8d9f4f 100644 --- a/Documentation/XChartsAPI-EN.md +++ b/Documentation/XChartsAPI-EN.md @@ -153,6 +153,8 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver |public method|description| |--|--| | `AddChartComponent()` |public MainComponent AddChartComponent(Type type)
| +| `AddChartComponent()` |public T AddChartComponent() where T : MainComponent
| +| `AddChartComponentWhenNoExist()` |public T AddChartComponentWhenNoExist() where T : MainComponent
| | `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)
Add a (time,y) data to serie. | | `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)
Add a data to serie. | | `AddData()` |public SerieData AddData(int serieIndex, double indexOrTimestamp, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)
| @@ -163,6 +165,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `AddData()` |public SerieData AddData(string serieName, double indexOrTimestamp, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)
| | `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)
Add a (x,y) data to serie. | | `AddData()` |public SerieData AddData(string serieName, List multidimensionalData, string dataName = null, string dataId = null)
Add an arbitray dimension data to serie,such as (x,y,z,...). | +| `AddSerie()` |public T AddSerie(string serieName = null, bool show = true, bool addToHead = false) where T : Serie
| | `AddXAxisData()` |public void AddXAxisData(string category, int xAxisIndex = 0)
Add a category data to xAxis. | | `AddXAxisIcon()` |public void AddXAxisIcon(Sprite icon, int xAxisIndex = 0)
Add an icon to xAxis. | | `AddYAxisData()` |public void AddYAxisData(string category, int yAxisIndex = 0)
Add a category data to yAxis. | @@ -175,17 +178,22 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `AnimationResume()` |public void AnimationResume()
Stop play animation. | | `CanAddChartComponent()` |public bool CanAddChartComponent(Type type)
| | `CanAddSerie()` |public bool CanAddSerie(Type type)
| +| `CanAddSerie()` |public bool CanAddSerie() where T : Serie
| | `CanMultipleComponent()` |public bool CanMultipleComponent(Type type)
| | `ClampInChart()` |public void ClampInChart(ref Vector3 pos)
| | `ClampInGrid()` |public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)
| | `ClearData()` |public virtual void ClearData()
Clear all components and series data. Note: serie only empties the data and does not remove serie. | | `ClickLegendButton()` |public void ClickLegendButton(int legendIndex, string legendName, bool show)
点击图例按钮 | | `CovertSerie()` |public bool CovertSerie(Serie serie, Type type)
| +| `CovertSerie()` |public bool CovertSerie(Serie serie) where T : Serie
| | `CovertXYAxis()` |public void CovertXYAxis(int index)
转换X轴和Y轴的配置 | | `GenerateDefaultSerieName()` |public string GenerateDefaultSerieName()
| | `GetAllSerieDataCount()` |public int GetAllSerieDataCount()
| | `GetChartBackgroundColor()` |public Color32 GetChartBackgroundColor()
| +| `GetChartComponent()` |public T GetChartComponent(int index = 0) where T : MainComponent
| | `GetChartComponentNum()` |public int GetChartComponentNum(Type type)
| +| `GetChartComponentNum()` |public int GetChartComponentNum() where T : MainComponent
| +| `GetChartComponents()` |public List GetChartComponents() where T : MainComponent
| | `GetData()` |public double GetData(int serieIndex, int dataIndex, int dimension = 1)
| | `GetData()` |public double GetData(string serieName, int dataIndex, int dimension = 1)
| | `GetDataZoomOfAxis()` |public DataZoom GetDataZoomOfAxis(Axis axis)
| @@ -197,10 +205,19 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)
| | `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)
| | `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)
| +| `GetOrAddChartComponent()` |public T GetOrAddChartComponent() where T : MainComponent
| | `GetPainter()` |public Painter GetPainter(int index)
| | `GetSerie()` |public Serie GetSerie(int serieIndex)
| | `GetSerie()` |public Serie GetSerie(string serieName)
| +| `GetSerie()` |public T GetSerie() where T : Serie
| +| `GetSerie()` |public T GetSerie(int serieIndex) where T : Serie
| +| `GetSerieBarGap()` |public float GetSerieBarGap() where T : Serie
| +| `GetSerieBarRealCount()` |public int GetSerieBarRealCount() where T : Serie
| +| `GetSerieIndexIfStack()` |public int GetSerieIndexIfStack(Serie currSerie) where T : Serie
| +| `GetSerieSameStackTotalValue()` |public double GetSerieSameStackTotalValue(string stack, int dataIndex) where T : Serie
| | `GetSeriesMinMaxValue()` |public virtual void GetSeriesMinMaxValue(Axis axis, int axisIndex, out double tempMinValue, out double tempMaxValue)
| +| `GetSerieTotalGap()` |public float GetSerieTotalGap(float categoryWidth, float gap, int index) where T : Serie
| +| `GetSerieTotalWidth()` |public float GetSerieTotalWidth(float categoryWidth, float gap, int realBarCount) where T : Serie
| | `GetTitlePosition()` |public Vector3 GetTitlePosition(Title title)
| | `GetVisualMapOfSerie()` |public VisualMap GetVisualMapOfSerie(Serie serie)
| | `GetXDataZoomOfSerie()` |public DataZoom GetXDataZoomOfSerie(Serie serie)
| @@ -209,8 +226,11 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `HasChartComponent()` |public bool HasChartComponent(Type type)
| | `HasChartComponent()` |public bool HasChartComponent()
| | `HasSerie()` |public bool HasSerie(Type type)
| +| `HasSerie()` |public bool HasSerie() where T : Serie
| | `Init()` |public void Init(bool defaultChart = true)
| +| `InitAxisRuntimeData()` |public virtual void InitAxisRuntimeData(Axis axis) { }
| | `InsertSerie()` |public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)
| +| `InsertSerie()` |public T InsertSerie(int index, string serieName = null, bool show = true) where T : Serie
| | `Internal_CheckAnimation()` |public void Internal_CheckAnimation()
| | `IsActiveByLegend()` |public virtual bool IsActiveByLegend(string legendName)
Whether serie is activated. | | `IsAllAxisCategory()` |public bool IsAllAxisCategory()
纯类目轴。 | @@ -241,6 +261,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `RefreshChart()` |public void RefreshChart(int serieIndex)
Redraw chart serie in next frame. | | `RefreshChart()` |public void RefreshChart(Serie serie)
Redraw chart serie in next frame. | | `RefreshDataZoom()` |public void RefreshDataZoom()
在下一帧刷新DataZoom | +| `RefreshGraph()` |public override void RefreshGraph()
| | `RefreshPainter()` |public void RefreshPainter(int index)
| | `RefreshPainter()` |public void RefreshPainter(Serie serie)
| | `RefreshTopPainter()` |public void RefreshTopPainter()
| @@ -257,8 +278,10 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `RemoveSerie()` |public void RemoveSerie(int serieIndex)
| | `RemoveSerie()` |public void RemoveSerie(Serie serie)
| | `RemoveSerie()` |public void RemoveSerie(string serieName)
| +| `RemoveSerie()` |public void RemoveSerie() where T : Serie
| | `ReplaceSerie()` |public bool ReplaceSerie(Serie oldSerie, Serie newSerie)
| | `ResetDataIndex()` |public bool ResetDataIndex(int serieIndex)
重置serie的数据项索引。避免数据项索引异常。 | +| `SaveAsImage()` |public void SaveAsImage(string imageType = "png", string savePath = "")
保存图表为图片。 | | `SetBasePainterMaterial()` |public void SetBasePainterMaterial(Material material)
设置Base Painter的材质球 | | `SetMaxCache()` |public void SetMaxCache(int maxCache)
设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。 | | `SetPainterActive()` |public void SetPainterActive(int index, bool flag)
| @@ -269,6 +292,8 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `SetTopPainterMaterial()` |public void SetTopPainterMaterial(Material material)
设置Top Painter的材质球 | | `SetUpperPainterMaterial()` |public void SetUpperPainterMaterial(Material material)
设置Upper Painter的材质球 | | `TryAddChartComponent()` |public bool TryAddChartComponent(Type type)
| +| `TryAddChartComponent()` |public bool TryAddChartComponent() where T : MainComponent
| +| `TryAddChartComponent()` |public bool TryAddChartComponent(out T component) where T : MainComponent
| | `TryGetChartComponent()` |public bool TryGetChartComponent(out T component, int index = 0)
| | `UdpateXAxisIcon()` |public void UdpateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)
Update xAxis icon. | | `UpdateData()` |public bool UpdateData(int serieIndex, int dataIndex, double value)
Update serie data by serie index. | @@ -304,7 +329,7 @@ Inherits or Implemented: [MaskableGraphic](#MaskableGraphic),[IPointerDownHandle | `OnScroll()` |public virtual void OnScroll(PointerEventData eventData)
| | `RebuildChartObject()` |public void RebuildChartObject()
移除并重新创建所有图表的Object。 | | `RefreshAllComponent()` |public void RefreshAllComponent()
| -| `RefreshGraph()` |public void RefreshGraph()
Redraw graph in next frame. | +| `RefreshGraph()` |public virtual void RefreshGraph()
Redraw graph in next frame. | | `ScreenPointToChartPoint()` |public bool ScreenPointToChartPoint(Vector2 screenPoint, out Vector2 chartPoint)
| | `SetPainterDirty()` |public void SetPainterDirty()
重新初始化Painter | | `SetSize()` |public virtual void SetSize(float width, float height)
设置图形的宽高(在非stretch pivot下才有效,其他情况需要自己调整RectTransform) | @@ -356,6 +381,8 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)
| | `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, double ceilRate)
| | `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)
| +| `GetOrAddComponent()` |public static T GetOrAddComponent(GameObject gameObject) where T : Component
| +| `GetOrAddComponent()` |public static T GetOrAddComponent(Transform transform) where T : Component
| | `GetPointList()` |public static void GetPointList(ref List posList, Vector3 sp, Vector3 ep, float k = 30f)
| | `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)
| | `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)
| @@ -382,6 +409,7 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `ParseStringFromString()` |public static List ParseStringFromString(string jsonData)
| | `RemoveComponent()` |public static void RemoveComponent(GameObject gameObject)
| | `RotateRound()` |public static Vector3 RotateRound(Vector3 position, Vector3 center, Vector3 axis, float angle)
| +| `SaveAsImage()` |public static Texture2D SaveAsImage(RectTransform rectTransform, Canvas canvas, string imageType = "png", string path = "")
| | `SetActive()` |public static void SetActive(GameObject gameObject, bool active)
| | `SetActive()` |public static void SetActive(Image image, bool active)
| | `SetActive()` |public static void SetActive(Text text, bool active)
| @@ -460,6 +488,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| +| `Contains()` |public bool Contains() where T : CoordSystem
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord)
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord, Type coord2)
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord, Type coord2, Type coord3)
| @@ -474,6 +503,7 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext) |public method|description| |--|--| | `UpdateDataZoomRuntimeStartEndValue()` |public static void UpdateDataZoomRuntimeStartEndValue(DataZoom dataZoom, Serie serie)
| +| `UpdateDataZoomRuntimeStartEndValue()` |public static void UpdateDataZoomRuntimeStartEndValue(BaseChart chart) where T : Serie
| ## `DateTimeUtil` @@ -617,6 +647,26 @@ Inherits or Implemented: [ListFor](#ListFor) ## `MainComponentHandler` +|public method|description| +|--|--| +| `CheckComponent()` |public virtual void CheckComponent(StringBuilder sb) { }
| +| `DrawBase()` |public virtual void DrawBase(VertexHelper vh) { }
| +| `DrawTop()` |public virtual void DrawTop(VertexHelper vh) { }
| +| `DrawUpper()` |public virtual void DrawUpper(VertexHelper vh) { }
| +| `InitComponent()` |public virtual void InitComponent() { }
| +| `OnBeginDrag()` |public virtual void OnBeginDrag(PointerEventData eventData) { }
| +| `OnDrag()` |public virtual void OnDrag(PointerEventData eventData) { }
| +| `OnEndDrag()` |public virtual void OnEndDrag(PointerEventData eventData) { }
| +| `OnPointerClick()` |public virtual void OnPointerClick(PointerEventData eventData) { }
| +| `OnPointerDown()` |public virtual void OnPointerDown(PointerEventData eventData) { }
| +| `OnPointerEnter()` |public virtual void OnPointerEnter(PointerEventData eventData) { }
| +| `OnPointerExit()` |public virtual void OnPointerExit(PointerEventData eventData) { }
| +| `OnPointerUp()` |public virtual void OnPointerUp(PointerEventData eventData) { }
| +| `OnScroll()` |public virtual void OnScroll(PointerEventData eventData) { }
| +| `OnSerieDataUpdate()` |public virtual void OnSerieDataUpdate(int serieIndex) { }
| +| `RemoveComponent()` |public virtual void RemoveComponent() { }
| +| `Update()` |public virtual void Update() { }
| + ## `MainComponentHandler` Inherits or Implemented: [MainComponentHandler](#MainComponentHandler) @@ -681,8 +731,10 @@ Inherits or Implemented: [BaseChart](#BaseChart) |public method|description| |--|--| +| `SetClass()` |public static bool SetClass(ref T currentValue, T newValue, bool notNull = false) where T : class
| | `SetColor()` |public static bool SetColor(ref Color currentValue, Color newValue)
| | `SetColor()` |public static bool SetColor(ref Color32 currentValue, Color32 newValue)
| +| `SetStruct()` |public static bool SetStruct(ref T currentValue, T newValue) where T : struct
| ## `RadarChart` @@ -724,6 +776,8 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `GetAllAssemblyTypes()` |public static IEnumerable GetAllAssemblyTypes()
| | `GetAllTypesDerivedFrom()` |public static IEnumerable GetAllTypesDerivedFrom(Type type)
| | `GetAllTypesDerivedFrom()` |public static IEnumerable GetAllTypesDerivedFrom()
| +| `GetAttribute()` |public static T GetAttribute(this MemberInfo type, bool check = true) where T : Attribute
| +| `GetAttribute()` |public static T GetAttribute(this Type type, bool check = true) where T : Attribute
| | `HasSubclass()` |public static bool HasSubclass(Type type)
| ## `ScatterChart` @@ -739,6 +793,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : Serie
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie)
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie, Type serie2)
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie, Type serie2, Type serie3)
| @@ -757,6 +812,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : ISerieExtraComponent
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)
| @@ -789,6 +845,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : ISerieExtraComponent
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute()
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute(Type type1)
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute(Type type1, Type type2)
| @@ -800,6 +857,31 @@ Inherits or Implemented: [Attribute](#Attribute) ## `SerieHandler` +|public method|description| +|--|--| +| `CheckComponent()` |public virtual void CheckComponent(StringBuilder sb) { }
| +| `DrawBase()` |public virtual void DrawBase(VertexHelper vh) { }
| +| `DrawSerie()` |public virtual void DrawSerie(VertexHelper vh) { }
| +| `DrawTop()` |public virtual void DrawTop(VertexHelper vh) { }
| +| `DrawUpper()` |public virtual void DrawUpper(VertexHelper vh) { }
| +| `InitComponent()` |public virtual void InitComponent() { }
| +| `OnBeginDrag()` |public virtual void OnBeginDrag(PointerEventData eventData) { }
| +| `OnDrag()` |public virtual void OnDrag(PointerEventData eventData) { }
| +| `OnEndDrag()` |public virtual void OnEndDrag(PointerEventData eventData) { }
| +| `OnLegendButtonClick()` |public virtual void OnLegendButtonClick(int index, string legendName, bool show) { }
| +| `OnLegendButtonEnter()` |public virtual void OnLegendButtonEnter(int index, string legendName) { }
| +| `OnLegendButtonExit()` |public virtual void OnLegendButtonExit(int index, string legendName) { }
| +| `OnPointerClick()` |public virtual void OnPointerClick(PointerEventData eventData) { }
| +| `OnPointerDown()` |public virtual void OnPointerDown(PointerEventData eventData) { }
| +| `OnPointerEnter()` |public virtual void OnPointerEnter(PointerEventData eventData) { }
| +| `OnPointerExit()` |public virtual void OnPointerExit(PointerEventData eventData) { }
| +| `OnPointerUp()` |public virtual void OnPointerUp(PointerEventData eventData) { }
| +| `OnScroll()` |public virtual void OnScroll(PointerEventData eventData) { }
| +| `RefreshLabelInternal()` |public virtual void RefreshLabelInternal() { }
| +| `RefreshLabelNextFrame()` |public virtual void RefreshLabelNextFrame() { }
| +| `RemoveComponent()` |public virtual void RemoveComponent() { }
| +| `Update()` |public virtual void Update() { }
| + ## `SerieHandler` Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#Serie) @@ -833,6 +915,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| +| `CloneSerie()` |public static T CloneSerie(Serie serie) where T : Serie
| | `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)
| | `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)
| | `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)
| @@ -902,7 +985,10 @@ Inherits or Implemented: [Attribute](#Attribute) | `GetStackSeries()` |public static void GetStackSeries(List series, ref Dictionary> stackSeries)
获得堆叠系列列表 | | `IsAnyClipSerie()` |public static bool IsAnyClipSerie(List series)
是否有需裁剪的serie。 | | `IsLegalLegendName()` |public static bool IsLegalLegendName(string name)
| +| `IsPercentStack()` |public static bool IsPercentStack(List series) where T : Serie
是否时百分比堆叠 | +| `IsPercentStack()` |public static bool IsPercentStack(List series, string stackName) where T : Serie
是否时百分比堆叠 | | `IsStack()` |public static bool IsStack(List series)
是否由数据堆叠 | +| `IsStack()` |public static bool IsStack(List series, string stackName) where T : Serie
是否堆叠 | | `UpdateSerieNameList()` |public static void UpdateSerieNameList(BaseChart chart, ref List serieNameList)
获得所有系列名,不包含空名字。 | | `UpdateStackDataList()` |public static void UpdateStackDataList(List series, Serie currSerie, DataZoom dataZoom, List> dataList)
| diff --git a/Documentation/XChartsAPI-ZH.md b/Documentation/XChartsAPI-ZH.md index 878e8c08..d4b73194 100644 --- a/Documentation/XChartsAPI-ZH.md +++ b/Documentation/XChartsAPI-ZH.md @@ -153,6 +153,8 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver |public method|description| |--|--| | `AddChartComponent()` |public MainComponent AddChartComponent(Type type)
| +| `AddChartComponent()` |public T AddChartComponent() where T : MainComponent
| +| `AddChartComponentWhenNoExist()` |public T AddChartComponentWhenNoExist() where T : MainComponent
| | `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)
添加(time,y)数据到指定的系列中。 | | `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)
添加一个数据到指定的系列中。 | | `AddData()` |public SerieData AddData(int serieIndex, double indexOrTimestamp, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)
| @@ -163,6 +165,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `AddData()` |public SerieData AddData(string serieName, double indexOrTimestamp, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)
| | `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)
添加(x,y)数据到指定系列中。 | | `AddData()` |public SerieData AddData(string serieName, List multidimensionalData, string dataName = null, string dataId = null)
添加多维数据(x,y,z...)到指定的系列中。 | +| `AddSerie()` |public T AddSerie(string serieName = null, bool show = true, bool addToHead = false) where T : Serie
| | `AddXAxisData()` |public void AddXAxisData(string category, int xAxisIndex = 0)
添加一个类目数据到指定的x轴。 | | `AddXAxisIcon()` |public void AddXAxisIcon(Sprite icon, int xAxisIndex = 0)
添加一个图标到指定的x轴。 | | `AddYAxisData()` |public void AddYAxisData(string category, int yAxisIndex = 0)
添加一个类目数据到指定的y轴。 | @@ -175,17 +178,22 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `AnimationResume()` |public void AnimationResume()
继续动画。 | | `CanAddChartComponent()` |public bool CanAddChartComponent(Type type)
| | `CanAddSerie()` |public bool CanAddSerie(Type type)
| +| `CanAddSerie()` |public bool CanAddSerie() where T : Serie
| | `CanMultipleComponent()` |public bool CanMultipleComponent(Type type)
| | `ClampInChart()` |public void ClampInChart(ref Vector3 pos)
| | `ClampInGrid()` |public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)
| | `ClearData()` |public virtual void ClearData()
清空所有组件和Serie的数据。注意:Serie只是清空数据,不会移除Serie。 | | `ClickLegendButton()` |public void ClickLegendButton(int legendIndex, string legendName, bool show)
点击图例按钮 | | `CovertSerie()` |public bool CovertSerie(Serie serie, Type type)
| +| `CovertSerie()` |public bool CovertSerie(Serie serie) where T : Serie
| | `CovertXYAxis()` |public void CovertXYAxis(int index)
转换X轴和Y轴的配置 | | `GenerateDefaultSerieName()` |public string GenerateDefaultSerieName()
| | `GetAllSerieDataCount()` |public int GetAllSerieDataCount()
| | `GetChartBackgroundColor()` |public Color32 GetChartBackgroundColor()
| +| `GetChartComponent()` |public T GetChartComponent(int index = 0) where T : MainComponent
| | `GetChartComponentNum()` |public int GetChartComponentNum(Type type)
| +| `GetChartComponentNum()` |public int GetChartComponentNum() where T : MainComponent
| +| `GetChartComponents()` |public List GetChartComponents() where T : MainComponent
| | `GetData()` |public double GetData(int serieIndex, int dataIndex, int dimension = 1)
| | `GetData()` |public double GetData(string serieName, int dataIndex, int dimension = 1)
| | `GetDataZoomOfAxis()` |public DataZoom GetDataZoomOfAxis(Axis axis)
| @@ -197,10 +205,19 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `GetItemColor()` |public Color32 GetItemColor(Serie serie, SerieData serieData, int colorIndex)
| | `GetLegendRealShowNameColor()` |public Color32 GetLegendRealShowNameColor(string name)
| | `GetLegendRealShowNameIndex()` |public int GetLegendRealShowNameIndex(string name)
| +| `GetOrAddChartComponent()` |public T GetOrAddChartComponent() where T : MainComponent
| | `GetPainter()` |public Painter GetPainter(int index)
| | `GetSerie()` |public Serie GetSerie(int serieIndex)
| | `GetSerie()` |public Serie GetSerie(string serieName)
| +| `GetSerie()` |public T GetSerie() where T : Serie
| +| `GetSerie()` |public T GetSerie(int serieIndex) where T : Serie
| +| `GetSerieBarGap()` |public float GetSerieBarGap() where T : Serie
| +| `GetSerieBarRealCount()` |public int GetSerieBarRealCount() where T : Serie
| +| `GetSerieIndexIfStack()` |public int GetSerieIndexIfStack(Serie currSerie) where T : Serie
| +| `GetSerieSameStackTotalValue()` |public double GetSerieSameStackTotalValue(string stack, int dataIndex) where T : Serie
| | `GetSeriesMinMaxValue()` |public virtual void GetSeriesMinMaxValue(Axis axis, int axisIndex, out double tempMinValue, out double tempMaxValue)
| +| `GetSerieTotalGap()` |public float GetSerieTotalGap(float categoryWidth, float gap, int index) where T : Serie
| +| `GetSerieTotalWidth()` |public float GetSerieTotalWidth(float categoryWidth, float gap, int realBarCount) where T : Serie
| | `GetTitlePosition()` |public Vector3 GetTitlePosition(Title title)
| | `GetVisualMapOfSerie()` |public VisualMap GetVisualMapOfSerie(Serie serie)
| | `GetXDataZoomOfSerie()` |public DataZoom GetXDataZoomOfSerie(Serie serie)
| @@ -209,8 +226,11 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `HasChartComponent()` |public bool HasChartComponent(Type type)
| | `HasChartComponent()` |public bool HasChartComponent()
| | `HasSerie()` |public bool HasSerie(Type type)
| +| `HasSerie()` |public bool HasSerie() where T : Serie
| | `Init()` |public void Init(bool defaultChart = true)
| +| `InitAxisRuntimeData()` |public virtual void InitAxisRuntimeData(Axis axis) { }
| | `InsertSerie()` |public void InsertSerie(Serie serie, int index = -1, bool addToHead = false)
| +| `InsertSerie()` |public T InsertSerie(int index, string serieName = null, bool show = true) where T : Serie
| | `Internal_CheckAnimation()` |public void Internal_CheckAnimation()
| | `IsActiveByLegend()` |public virtual bool IsActiveByLegend(string legendName)
获得指定图例名字的系列是否显示。 | | `IsAllAxisCategory()` |public bool IsAllAxisCategory()
纯类目轴。 | @@ -241,6 +261,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `RefreshChart()` |public void RefreshChart(int serieIndex)
在下一帧刷新图表的指定serie。 | | `RefreshChart()` |public void RefreshChart(Serie serie)
在下一帧刷新图表的指定serie。 | | `RefreshDataZoom()` |public void RefreshDataZoom()
在下一帧刷新DataZoom | +| `RefreshGraph()` |public override void RefreshGraph()
| | `RefreshPainter()` |public void RefreshPainter(int index)
| | `RefreshPainter()` |public void RefreshPainter(Serie serie)
| | `RefreshTopPainter()` |public void RefreshTopPainter()
| @@ -257,8 +278,10 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `RemoveSerie()` |public void RemoveSerie(int serieIndex)
| | `RemoveSerie()` |public void RemoveSerie(Serie serie)
| | `RemoveSerie()` |public void RemoveSerie(string serieName)
| +| `RemoveSerie()` |public void RemoveSerie() where T : Serie
| | `ReplaceSerie()` |public bool ReplaceSerie(Serie oldSerie, Serie newSerie)
| | `ResetDataIndex()` |public bool ResetDataIndex(int serieIndex)
重置serie的数据项索引。避免数据项索引异常。 | +| `SaveAsImage()` |public void SaveAsImage(string imageType = "png", string savePath = "")
保存图表为图片。 | | `SetBasePainterMaterial()` |public void SetBasePainterMaterial(Material material)
设置Base Painter的材质球 | | `SetMaxCache()` |public void SetMaxCache(int maxCache)
设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。 | | `SetPainterActive()` |public void SetPainterActive(int index, bool flag)
| @@ -269,6 +292,8 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver | `SetTopPainterMaterial()` |public void SetTopPainterMaterial(Material material)
设置Top Painter的材质球 | | `SetUpperPainterMaterial()` |public void SetUpperPainterMaterial(Material material)
设置Upper Painter的材质球 | | `TryAddChartComponent()` |public bool TryAddChartComponent(Type type)
| +| `TryAddChartComponent()` |public bool TryAddChartComponent() where T : MainComponent
| +| `TryAddChartComponent()` |public bool TryAddChartComponent(out T component) where T : MainComponent
| | `TryGetChartComponent()` |public bool TryGetChartComponent(out T component, int index = 0)
| | `UdpateXAxisIcon()` |public void UdpateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)
更新X轴图标。 | | `UpdateData()` |public bool UpdateData(int serieIndex, int dataIndex, double value)
更新指定系列中的指定索引数据。 | @@ -304,7 +329,7 @@ Inherits or Implemented: [MaskableGraphic](#MaskableGraphic),[IPointerDownHandle | `OnScroll()` |public virtual void OnScroll(PointerEventData eventData)
| | `RebuildChartObject()` |public void RebuildChartObject()
移除并重新创建所有图表的Object。 | | `RefreshAllComponent()` |public void RefreshAllComponent()
| -| `RefreshGraph()` |public void RefreshGraph()
在下一帧刷新图形。 | +| `RefreshGraph()` |public virtual void RefreshGraph()
在下一帧刷新图形。 | | `ScreenPointToChartPoint()` |public bool ScreenPointToChartPoint(Vector2 screenPoint, out Vector2 chartPoint)
| | `SetPainterDirty()` |public void SetPainterDirty()
重新初始化Painter | | `SetSize()` |public virtual void SetSize(float width, float height)
设置图形的宽高(在非stretch pivot下才有效,其他情况需要自己调整RectTransform) | @@ -356,6 +381,8 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)
| | `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, double ceilRate)
| | `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)
| +| `GetOrAddComponent()` |public static T GetOrAddComponent(GameObject gameObject) where T : Component
| +| `GetOrAddComponent()` |public static T GetOrAddComponent(Transform transform) where T : Component
| | `GetPointList()` |public static void GetPointList(ref List posList, Vector3 sp, Vector3 ep, float k = 30f)
| | `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)
| | `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)
| @@ -382,6 +409,7 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `ParseStringFromString()` |public static List ParseStringFromString(string jsonData)
| | `RemoveComponent()` |public static void RemoveComponent(GameObject gameObject)
| | `RotateRound()` |public static Vector3 RotateRound(Vector3 position, Vector3 center, Vector3 axis, float angle)
| +| `SaveAsImage()` |public static Texture2D SaveAsImage(RectTransform rectTransform, Canvas canvas, string imageType = "png", string path = "")
| | `SetActive()` |public static void SetActive(GameObject gameObject, bool active)
| | `SetActive()` |public static void SetActive(Image image, bool active)
| | `SetActive()` |public static void SetActive(Text text, bool active)
| @@ -460,6 +488,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| +| `Contains()` |public bool Contains() where T : CoordSystem
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord)
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord, Type coord2)
| | `CoordOptionsAttribute()` |public CoordOptionsAttribute(Type coord, Type coord2, Type coord3)
| @@ -474,6 +503,7 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext) |public method|description| |--|--| | `UpdateDataZoomRuntimeStartEndValue()` |public static void UpdateDataZoomRuntimeStartEndValue(DataZoom dataZoom, Serie serie)
| +| `UpdateDataZoomRuntimeStartEndValue()` |public static void UpdateDataZoomRuntimeStartEndValue(BaseChart chart) where T : Serie
| ## `DateTimeUtil` @@ -617,6 +647,26 @@ Inherits or Implemented: [ListFor](#ListFor) ## `MainComponentHandler` +|public method|description| +|--|--| +| `CheckComponent()` |public virtual void CheckComponent(StringBuilder sb) { }
| +| `DrawBase()` |public virtual void DrawBase(VertexHelper vh) { }
| +| `DrawTop()` |public virtual void DrawTop(VertexHelper vh) { }
| +| `DrawUpper()` |public virtual void DrawUpper(VertexHelper vh) { }
| +| `InitComponent()` |public virtual void InitComponent() { }
| +| `OnBeginDrag()` |public virtual void OnBeginDrag(PointerEventData eventData) { }
| +| `OnDrag()` |public virtual void OnDrag(PointerEventData eventData) { }
| +| `OnEndDrag()` |public virtual void OnEndDrag(PointerEventData eventData) { }
| +| `OnPointerClick()` |public virtual void OnPointerClick(PointerEventData eventData) { }
| +| `OnPointerDown()` |public virtual void OnPointerDown(PointerEventData eventData) { }
| +| `OnPointerEnter()` |public virtual void OnPointerEnter(PointerEventData eventData) { }
| +| `OnPointerExit()` |public virtual void OnPointerExit(PointerEventData eventData) { }
| +| `OnPointerUp()` |public virtual void OnPointerUp(PointerEventData eventData) { }
| +| `OnScroll()` |public virtual void OnScroll(PointerEventData eventData) { }
| +| `OnSerieDataUpdate()` |public virtual void OnSerieDataUpdate(int serieIndex) { }
| +| `RemoveComponent()` |public virtual void RemoveComponent() { }
| +| `Update()` |public virtual void Update() { }
| + ## `MainComponentHandler` Inherits or Implemented: [MainComponentHandler](#MainComponentHandler) @@ -681,8 +731,10 @@ Inherits or Implemented: [BaseChart](#BaseChart) |public method|description| |--|--| +| `SetClass()` |public static bool SetClass(ref T currentValue, T newValue, bool notNull = false) where T : class
| | `SetColor()` |public static bool SetColor(ref Color currentValue, Color newValue)
| | `SetColor()` |public static bool SetColor(ref Color32 currentValue, Color32 newValue)
| +| `SetStruct()` |public static bool SetStruct(ref T currentValue, T newValue) where T : struct
| ## `RadarChart` @@ -724,6 +776,8 @@ Inherits or Implemented: [BaseChart](#BaseChart) | `GetAllAssemblyTypes()` |public static IEnumerable GetAllAssemblyTypes()
| | `GetAllTypesDerivedFrom()` |public static IEnumerable GetAllTypesDerivedFrom(Type type)
| | `GetAllTypesDerivedFrom()` |public static IEnumerable GetAllTypesDerivedFrom()
| +| `GetAttribute()` |public static T GetAttribute(this MemberInfo type, bool check = true) where T : Attribute
| +| `GetAttribute()` |public static T GetAttribute(this Type type, bool check = true) where T : Attribute
| | `HasSubclass()` |public static bool HasSubclass(Type type)
| ## `ScatterChart` @@ -739,6 +793,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : Serie
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie)
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie, Type serie2)
| | `SerieConvertAttribute()` |public SerieConvertAttribute(Type serie, Type serie2, Type serie3)
| @@ -757,6 +812,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : ISerieExtraComponent
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)
| | `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)
| @@ -789,6 +845,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| | `Contains()` |public bool Contains(Type type)
| +| `Contains()` |public bool Contains() where T : ISerieExtraComponent
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute()
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute(Type type1)
| | `SerieExtraComponentAttribute()` |public SerieExtraComponentAttribute(Type type1, Type type2)
| @@ -800,6 +857,31 @@ Inherits or Implemented: [Attribute](#Attribute) ## `SerieHandler` +|public method|description| +|--|--| +| `CheckComponent()` |public virtual void CheckComponent(StringBuilder sb) { }
| +| `DrawBase()` |public virtual void DrawBase(VertexHelper vh) { }
| +| `DrawSerie()` |public virtual void DrawSerie(VertexHelper vh) { }
| +| `DrawTop()` |public virtual void DrawTop(VertexHelper vh) { }
| +| `DrawUpper()` |public virtual void DrawUpper(VertexHelper vh) { }
| +| `InitComponent()` |public virtual void InitComponent() { }
| +| `OnBeginDrag()` |public virtual void OnBeginDrag(PointerEventData eventData) { }
| +| `OnDrag()` |public virtual void OnDrag(PointerEventData eventData) { }
| +| `OnEndDrag()` |public virtual void OnEndDrag(PointerEventData eventData) { }
| +| `OnLegendButtonClick()` |public virtual void OnLegendButtonClick(int index, string legendName, bool show) { }
| +| `OnLegendButtonEnter()` |public virtual void OnLegendButtonEnter(int index, string legendName) { }
| +| `OnLegendButtonExit()` |public virtual void OnLegendButtonExit(int index, string legendName) { }
| +| `OnPointerClick()` |public virtual void OnPointerClick(PointerEventData eventData) { }
| +| `OnPointerDown()` |public virtual void OnPointerDown(PointerEventData eventData) { }
| +| `OnPointerEnter()` |public virtual void OnPointerEnter(PointerEventData eventData) { }
| +| `OnPointerExit()` |public virtual void OnPointerExit(PointerEventData eventData) { }
| +| `OnPointerUp()` |public virtual void OnPointerUp(PointerEventData eventData) { }
| +| `OnScroll()` |public virtual void OnScroll(PointerEventData eventData) { }
| +| `RefreshLabelInternal()` |public virtual void RefreshLabelInternal() { }
| +| `RefreshLabelNextFrame()` |public virtual void RefreshLabelNextFrame() { }
| +| `RemoveComponent()` |public virtual void RemoveComponent() { }
| +| `Update()` |public virtual void Update() { }
| + ## `SerieHandler` Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#Serie) @@ -833,6 +915,7 @@ Inherits or Implemented: [Attribute](#Attribute) |public method|description| |--|--| +| `CloneSerie()` |public static T CloneSerie(Serie serie) where T : Serie
| | `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)
| | `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)
| | `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)
| @@ -902,7 +985,10 @@ Inherits or Implemented: [Attribute](#Attribute) | `GetStackSeries()` |public static void GetStackSeries(List series, ref Dictionary> stackSeries)
获得堆叠系列列表 | | `IsAnyClipSerie()` |public static bool IsAnyClipSerie(List series)
是否有需裁剪的serie。 | | `IsLegalLegendName()` |public static bool IsLegalLegendName(string name)
| +| `IsPercentStack()` |public static bool IsPercentStack(List series) where T : Serie
是否时百分比堆叠 | +| `IsPercentStack()` |public static bool IsPercentStack(List series, string stackName) where T : Serie
是否时百分比堆叠 | | `IsStack()` |public static bool IsStack(List series)
是否由数据堆叠 | +| `IsStack()` |public static bool IsStack(List series, string stackName) where T : Serie
是否堆叠 | | `UpdateSerieNameList()` |public static void UpdateSerieNameList(BaseChart chart, ref List serieNameList)
获得所有系列名,不包含空名字。 | | `UpdateStackDataList()` |public static void UpdateStackDataList(List series, Serie currSerie, DataZoom dataZoom, List> dataList)
| diff --git a/Documentation/XChartsConfiguration-EN.md b/Documentation/XChartsConfiguration-EN.md index 676e15dd..d43693a8 100644 --- a/Documentation/XChartsConfiguration-EN.md +++ b/Documentation/XChartsConfiguration-EN.md @@ -1009,7 +1009,7 @@ Polar coordinate can be used in scatter and line chart. Every polar coordinate h |--|--|--|--| |`show`|true||Whether to show the polor component. |`center`|||The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate. When value between 0 and 1 represents a percentage relative to the chart. -|`radius`|0.35f||the radius of polar. +|`radius`|||the radius of polar. |`backgroundColor`|||Background color of polar, which is transparent by default. ## `Radar` diff --git a/Documentation/XChartsConfiguration-ZH.md b/Documentation/XChartsConfiguration-ZH.md index 8abb88b2..af9a78cd 100644 --- a/Documentation/XChartsConfiguration-ZH.md +++ b/Documentation/XChartsConfiguration-ZH.md @@ -1009,7 +1009,7 @@ Inherits or Implemented: [CoordSystem](#CoordSystem),[ISerieContainer](#ISerieCo |--|--|--|--| |`show`|true||是否显示极坐标。 |`center`|||极坐标的中心点。数组的第一项是横坐标,第二项是纵坐标。 当值为0-1之间时表示百分比,设置成百分比时第一项是相对于容器宽度,第二项是相对于容器高度。 -|`radius`|0.35f||极坐标的半径。 +|`radius`|||半径。radius[0]表示内径,radius[1]表示外径。 |`backgroundColor`|||极坐标的背景色,默认透明。 ## `Radar`