Merge branch 'master' into 3.0

This commit is contained in:
monitor1394
2023-06-09 08:05:20 +08:00
52 changed files with 2502 additions and 524 deletions

View File

@@ -35,8 +35,15 @@ slug: /api
- [GridCoordContext](#gridcoordcontext)
- [HeatmapChart](#heatmapchart)
- [IgnoreDoc](#ignoredoc)
- [INeedSerieContainer](#ineedseriecontainer)
- [InputHelper](#inputhelper)
- [InteractData](#interactdata)
- [IPropertyChanged](#ipropertychanged)
- [ISerieComponent](#iseriecomponent)
- [ISerieContainer](#iseriecontainer)
- [ISerieDataComponent](#iseriedatacomponent)
- [ISimplifiedSerie](#isimplifiedserie)
- [IUpdateRuntimeData](#iupdateruntimedata)
- [LayerHelper](#layerhelper)
- [LegendContext](#legendcontext)
- [LegendHelper](#legendhelper)
@@ -106,6 +113,8 @@ slug: /api
## AnimationStyleHelper
> XCharts.Runtime.AnimationStyleHelper
|public method|since|description|
|--|--|--|
|CheckDataAnimation()||public static float CheckDataAnimation(BaseChart chart, Serie serie, int dataIndex, float destProgress, float startPorgress = 0)|
@@ -115,14 +124,16 @@ slug: /api
## AxisContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.AxisContext : [MainComponentContext](#maincomponentcontext)
## AxisHandler<T>
Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
> XCharts.AxisHandler<T> : [MainComponentHandler](#maincomponenthandler)
## AxisHelper
> XCharts.Runtime.AxisHelper
|public method|since|description|
|--|--|--|
|AdjustCircleLabelPos()||public static void AdjustCircleLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)|
@@ -149,11 +160,11 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
## BarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.BarChart : [BaseChart](#basechart)
## BaseChart
Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver](#iserializationcallbackreceiver)
> XCharts.Runtime.BaseChart : [BaseGraph](#basegraph),[ISerializationCallbackReceiver](https://docs.unity3d.com/ScriptReference/30_search.html?q=iserializationcallbackreceiver) / Subclasses: [BarChart](#barchart),[CandlestickChart](#candlestickchart),[HeatmapChart](#heatmapchart),[LineChart](#linechart),[ParallelChart](#parallelchart),[PieChart](#piechart),[PolarChart](#polarchart),[RadarChart](#radarchart),[RingChart](#ringchart),[ScatterChart](#scatterchart),[SimplifiedBarChart](#simplifiedbarchart),[SimplifiedCandlestickChart](#simplifiedcandlestickchart),[SimplifiedLineChart](#simplifiedlinechart)
|public method|since|description|
|--|--|--|
@@ -204,6 +215,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
|CanAddChartComponent()||public bool CanAddChartComponent(Type type)|
|CanAddSerie()||public bool CanAddSerie(Type type)|
|CanAddSerie<T>()||public bool CanAddSerie<T>() where T : Serie|
|CancelTooltip()|v3.7.0|public void CancelTooltip()<br/>cancel tooltip. |
|CanMultipleComponent()||public bool CanMultipleComponent(Type type)|
|ClampInChart()||public void ClampInChart(ref Vector3 pos)|
|ClampInGrid()||public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)|
@@ -319,6 +331,8 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
|SetSeriePainterMaterial()||public void SetSeriePainterMaterial(Material material)<br/>设置Serie Painter的材质球 |
|SetTopPainterMaterial()||public void SetTopPainterMaterial(Material material)<br/>设置Top Painter的材质球 |
|SetUpperPainterMaterial()||public void SetUpperPainterMaterial(Material material)<br/>设置Upper Painter的材质球 |
|TriggerTooltip()|v3.7.0|public bool TriggerTooltip(int dataIndex)<br/>trigger tooltip by data index. |
|TriggerTooltip()|v3.7.0|public bool TriggerTooltip(Vector3 localPosition)<br/>trigger tooltip by chart local position. |
|TryAddChartComponent()||public bool TryAddChartComponent(Type type)|
|TryAddChartComponent&lt;T&gt;()||public bool TryAddChartComponent&lt;T&gt;() where T : MainComponent|
|TryAddChartComponent&lt;T&gt;()||public bool TryAddChartComponent&lt;T&gt;(out T component) where T : MainComponent|
@@ -341,7 +355,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
## BaseGraph
Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandler](#ipointerdownhandler),[IPointerUpHandler](#ipointeruphandler),[](#)
> XCharts.Runtime.BaseGraph : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent)
|public method|since|description|
|--|--|--|
@@ -355,6 +369,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandle
|onPointerUp||public Action&lt;PointerEventData, BaseGraph&gt; onPointerUp<br/>鼠标弹起回调。 |
|onScroll||public Action&lt;PointerEventData, BaseGraph&gt; onScroll<br/>鼠标滚动回调。 |
|CheckWarning()||public string CheckWarning()<br/>检测警告信息。 |
|LocalPointToScreenPoint()|v3.7.0|public Vector2 LocalPointToScreenPoint(Vector2 localPoint)<br/>chart local point to screen point. |
|LocalPointToWorldPoint()|v3.7.0|public Vector2 LocalPointToWorldPoint(Vector2 localPoint)<br/>chart local point to world point. |
|OnBeginDrag()||public virtual void OnBeginDrag(PointerEventData eventData)|
|OnDrag()||public virtual void OnDrag(PointerEventData eventData)|
|OnEndDrag()||public virtual void OnEndDrag(PointerEventData eventData)|
@@ -374,10 +390,12 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandle
## CandlestickChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.CandlestickChart : [BaseChart](#basechart)
## ChartCached
> XCharts.Runtime.ChartCached
|public method|since|description|
|--|--|--|
|ColorToDotStr()||public static string ColorToDotStr(Color color)|
@@ -389,10 +407,16 @@ Inherits or Implemented: [BaseChart](#basechart)
## ChartConst
> XCharts.Runtime.ChartConst
## ChartDrawer
> XCharts.Runtime.ChartDrawer
## ChartHelper
> XCharts.Runtime.ChartHelper
|public method|since|description|
|--|--|--|
|ActiveAllObject()||public static void ActiveAllObject(Transform parent, bool active, string match = null)|
@@ -416,8 +440,10 @@ Inherits or Implemented: [BaseChart](#basechart)
|GetFullName()||public static string GetFullName(Transform transform)|
|GetHighlightColor()||public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)|
|GetLastValue()||public static Vector3 GetLastValue(List&lt;Vector3&gt; list)|
|GetMaxCeilRate()||public static double GetMaxCeilRate(double value, double ceilRate)|
|GetMaxDivisibleValue()||public static double GetMaxDivisibleValue(double max, double ceilRate)|
|GetMaxLogValue()||public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)|
|GetMinCeilRate()||public static double GetMinCeilRate(double value, double ceilRate)|
|GetMinDivisibleValue()||public static double GetMinDivisibleValue(double min, double ceilRate)|
|GetMinLogValue()||public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)|
|GetOrAddComponent&lt;T&gt;()||public static T GetOrAddComponent&lt;T&gt;(GameObject gameObject) where T : Component|
@@ -458,7 +484,7 @@ Inherits or Implemented: [BaseChart](#basechart)
## ChartLabel
Inherits or Implemented: [Image](#image)
> XCharts.Runtime.ChartLabel : [Image](https://docs.unity3d.com/ScriptReference/30_search.html?q=image)
|public method|since|description|
|--|--|--|
@@ -487,12 +513,16 @@ Inherits or Implemented: [Image](#image)
## ChartObject
> XCharts.Runtime.ChartObject
|public method|since|description|
|--|--|--|
|Destroy()||public virtual void Destroy()|
## CheckHelper
> XCharts.Runtime.CheckHelper
|public method|since|description|
|--|--|--|
|CheckChart()||public static string CheckChart(BaseChart chart)|
@@ -500,13 +530,15 @@ Inherits or Implemented: [Image](#image)
## ColorUtil
> XCharts.Runtime.ColorUtil
|public method|since|description|
|--|--|--|
|GetColor()||public static Color32 GetColor(string hexColorStr)<br/>Convert the html string to color. |
## ComponentHandlerAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.ComponentHandlerAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -515,6 +547,8 @@ Inherits or Implemented: [Attribute](#attribute)
## ComponentHelper
> XCharts.Runtime.ComponentHelper
|public method|since|description|
|--|--|--|
|GetAngleAxis()||public static AngleAxis GetAngleAxis(List&lt;MainComponent&gt; components, int polarIndex)|
@@ -525,7 +559,7 @@ Inherits or Implemented: [Attribute](#attribute)
## CoordOptionsAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.CoordOptionsAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -537,10 +571,12 @@ Inherits or Implemented: [Attribute](#attribute)
## DataZoomContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.DataZoomContext : [MainComponentContext](#maincomponentcontext)
## DataZoomHelper
> XCharts.Runtime.DataZoomHelper
|public method|since|description|
|--|--|--|
|UpdateDataZoomRuntimeStartEndValue()||public static void UpdateDataZoomRuntimeStartEndValue(DataZoom dataZoom, Serie serie)|
@@ -548,6 +584,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## DateTimeUtil
> XCharts.Runtime.DateTimeUtil
|public method|since|description|
|--|--|--|
|GetDateTime()||public static DateTime GetDateTime(int timestamp)|
@@ -556,7 +594,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## DefaultAnimationAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.DefaultAnimationAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -564,6 +602,8 @@ Inherits or Implemented: [Attribute](#attribute)
## DefineSymbolsUtil
> XCharts.Runtime.DefineSymbolsUtil
|public method|since|description|
|--|--|--|
|AddGlobalDefine()||public static void AddGlobalDefine(string symbol)|
@@ -571,6 +611,8 @@ Inherits or Implemented: [Attribute](#attribute)
## FormatterHelper
> XCharts.Runtime.FormatterHelper
|public method|since|description|
|--|--|--|
|NeedFormat()||public static bool NeedFormat(string content)|
@@ -581,22 +623,28 @@ Inherits or Implemented: [Attribute](#attribute)
## GridCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.GridCoordContext : [MainComponentContext](#maincomponentcontext)
## HeatmapChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.HeatmapChart : [BaseChart](#basechart)
## IgnoreDoc
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.IgnoreDoc : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
|IgnoreDoc()||public IgnoreDoc()|
## INeedSerieContainer
> XCharts.Runtime.INeedSerieContainer / Subclasses: [Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Radar](#radar),[BaseScatter](#basescatter)
## InputHelper
> XCharts.Runtime.InputHelper
|public method|since|description|
|--|--|--|
|GetKeyDown()||public static bool GetKeyDown(KeyCode keyCode)|
@@ -604,6 +652,8 @@ Inherits or Implemented: [Attribute](#attribute)
## InteractData
> XCharts.Runtime.InteractData
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
@@ -618,8 +668,37 @@ Inherits or Implemented: [Attribute](#attribute)
|TryGetValue()||public bool TryGetValue(ref float value, ref bool interacting, float animationDuration = 250)|
|TryGetValueAndColor()||public bool TryGetValueAndColor(ref float value, ref Color32 color, ref Color32 toColor, ref bool interacting, float animationDuration = 250)|
## IPropertyChanged
> XCharts.Runtime.IPropertyChanged / Subclasses: [Location](#location),[Comment](#comment),[Legend](#legend),[Title](#title)
属性变更接口
## ISerieComponent
> XCharts.Runtime.ISerieComponent / Subclasses: [AreaStyle](#areastyle),[ImageStyle](#imagestyle),[LineArrow](#linearrow),[LabelLine](#labelline),[LabelStyle](#labelstyle),[BlurStyle](#blurstyle),[EmphasisStyle](#emphasisstyle),[SelectStyle](#selectstyle),[TitleStyle](#titlestyle)
The interface for serie component.
## ISerieContainer
> XCharts.Runtime.ISerieContainer / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
## ISerieDataComponent
> XCharts.Runtime.ISerieDataComponent / Subclasses: [AreaStyle](#areastyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[LineStyle](#linestyle),[SerieSymbol](#seriesymbol),[LabelLine](#labelline),[LabelStyle](#labelstyle),[BlurStyle](#blurstyle),[EmphasisStyle](#emphasisstyle),[SelectStyle](#selectstyle),[TitleStyle](#titlestyle)
The interface for serie data component.
## ISimplifiedSerie
> XCharts.Runtime.ISimplifiedSerie / Subclasses: [SimplifiedBar](#simplifiedbar),[SimplifiedCandlestick](#simplifiedcandlestick),[SimplifiedLine](#simplifiedline)
## IUpdateRuntimeData
> XCharts.Runtime.IUpdateRuntimeData / Subclasses: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord)
## LayerHelper
> XCharts.Runtime.LayerHelper
|public method|since|description|
|--|--|--|
|IsFixedWidthHeight()||public static bool IsFixedWidthHeight(RectTransform rt)|
@@ -627,10 +706,12 @@ Inherits or Implemented: [Attribute](#attribute)
## LegendContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.LegendContext : [MainComponentContext](#maincomponentcontext)
## LegendHelper
> XCharts.Runtime.LegendHelper
|public method|since|description|
|--|--|--|
|CheckDataHighlighted()||public static bool CheckDataHighlighted(Serie serie, string legendName, bool heighlight)|
@@ -642,6 +723,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## LegendItem
> XCharts.Runtime.LegendItem
|public method|since|description|
|--|--|--|
|GetIconColor()||public Color GetIconColor()|
@@ -665,11 +748,11 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## LineChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.LineChart : [BaseChart](#basechart)
## ListFor
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.ListFor : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute) / Subclasses: [ListForComponent](#listforcomponent),[ListForSerie](#listforserie)
|public method|since|description|
|--|--|--|
@@ -677,7 +760,7 @@ Inherits or Implemented: [Attribute](#attribute)
## ListForComponent
Inherits or Implemented: [ListFor](#listfor)
> XCharts.Runtime.ListForComponent : [ListFor](#listfor)
|public method|since|description|
|--|--|--|
@@ -685,7 +768,7 @@ Inherits or Implemented: [ListFor](#listfor)
## ListForSerie
Inherits or Implemented: [ListFor](#listfor)
> XCharts.Runtime.ListForSerie : [ListFor](#listfor)
|public method|since|description|
|--|--|--|
@@ -693,8 +776,12 @@ Inherits or Implemented: [ListFor](#listfor)
## MainComponentContext
> XCharts.Runtime.MainComponentContext / Subclasses: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
## MainComponentHandler
> XCharts.Runtime.MainComponentHandler / Subclasses: [AxisHandler&lt;T&gt;](#axishandlert),[MainComponentHandler&lt;T&gt;](#maincomponenthandlert)
|public method|since|description|
|--|--|--|
|CheckComponent()||public virtual void CheckComponent(StringBuilder sb) { }|
@@ -717,10 +804,12 @@ Inherits or Implemented: [ListFor](#listfor)
## MainComponentHandler&lt;T&gt;
Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
> XCharts.Runtime.MainComponentHandler&lt;T&gt; : [MainComponentHandler](#maincomponenthandler)
## MathUtil
> XCharts.Runtime.MathUtil
|public method|since|description|
|--|--|--|
|Abs()||public static double Abs(double d)|
@@ -733,7 +822,7 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
## ObjectPool&lt;T&gt; where T
Inherits or Implemented: [new()](#new())
> XCharts.Runtime.ObjectPool&lt;T&gt; where T : [new()](#new())
|public method|since|description|
|--|--|--|
@@ -745,7 +834,7 @@ Inherits or Implemented: [new()](#new())
## Painter
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XCharts.Runtime.Painter : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
|public method|since|description|
|--|--|--|
@@ -757,26 +846,28 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## ParallelChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.ParallelChart : [BaseChart](#basechart)
## ParallelCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.ParallelCoordContext : [MainComponentContext](#maincomponentcontext)
## PieChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.PieChart : [BaseChart](#basechart)
## PolarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.PolarChart : [BaseChart](#basechart)
## PolarCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.PolarCoordContext : [MainComponentContext](#maincomponentcontext)
## PropertyUtil
> XCharts.Runtime.PropertyUtil
|public method|since|description|
|--|--|--|
|SetClass&lt;T&gt;()||public static bool SetClass&lt;T&gt;(ref T currentValue, T newValue, bool notNull = false) where T : class|
@@ -786,14 +877,16 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## RadarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.RadarChart : [BaseChart](#basechart)
## RadarCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.RadarCoordContext : [MainComponentContext](#maincomponentcontext)
## ReflectionUtil
> XCharts.Runtime.ReflectionUtil
|public method|since|description|
|--|--|--|
|DeepCloneSerializeField()||public static object DeepCloneSerializeField(object obj)|
@@ -805,7 +898,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## RequireChartComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.RequireChartComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -815,10 +908,12 @@ Inherits or Implemented: [Attribute](#attribute)
## RingChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.RingChart : [BaseChart](#basechart)
## RuntimeUtil
> XCharts.Runtime.RuntimeUtil
|public method|since|description|
|--|--|--|
|GetAllAssemblyTypes()||public static IEnumerable&lt;Type&gt; GetAllAssemblyTypes()|
@@ -830,11 +925,12 @@ Inherits or Implemented: [BaseChart](#basechart)
## ScatterChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.ScatterChart : [BaseChart](#basechart)
## SerieComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
The attribute for serie component.
|public method|since|description|
|--|--|--|
@@ -851,9 +947,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieContext
> XCharts.Runtime.SerieContext
## SerieConvertAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieConvertAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
The attribute for which serie types can be converted to.
|public method|since|description|
|--|--|--|
@@ -866,7 +965,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieDataComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieDataComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
The attribute for serie data component.
|public method|since|description|
|--|--|--|
@@ -883,13 +983,15 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieDataContext
> XCharts.Runtime.SerieDataContext
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
## SerieDataExtraFieldAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieDataExtraFieldAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -905,12 +1007,17 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieEventData
> XCharts.Runtime.SerieEventData
the data of serie event.
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
## SerieEventDataPool
> XCharts.Runtime.SerieEventDataPool
|public method|since|description|
|--|--|--|
|Get()||public static SerieEventData Get(Vector3 pos, int serieIndex, int dataIndex, int dimension, double value)|
@@ -918,6 +1025,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieHandler
> XCharts.Runtime.SerieHandler
|public method|since|description|
|--|--|--|
|CheckComponent()||public virtual void CheckComponent(StringBuilder sb) { }|
@@ -944,9 +1053,13 @@ Inherits or Implemented: [Attribute](#attribute)
|Update()||public virtual void Update() { }|
|UpdateSerieContext()||public virtual void UpdateSerieContext() { }|
## SerieHandler where T
> .SerieHandler where T / Subclasses: [SerieHandler&lt;T&gt;](#seriehandlert)
## SerieHandler&lt;T&gt;
Inherits or Implemented: [SerieHandler where T](#seriehandler where t),[Serie](#serie)
> XCharts.Runtime.SerieHandler&lt;T&gt; : [SerieHandler where T](#seriehandler where t),[Serie](#serie)
|public method|since|description|
|--|--|--|
@@ -971,7 +1084,7 @@ Inherits or Implemented: [SerieHandler where T](#seriehandler where t),[Serie](#
## SerieHandlerAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieHandlerAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -980,6 +1093,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieHelper
> XCharts.Runtime.SerieHelper
|public method|since|description|
|--|--|--|
|CloneSerie&lt;T&gt;()||public static T CloneSerie&lt;T&gt;(Serie serie) where T : Serie|
@@ -1022,6 +1137,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieLabelHelper
> XCharts.Runtime.SerieLabelHelper
|public method|since|description|
|--|--|--|
|AvoidLabelOverlap()||public static void AvoidLabelOverlap(Serie serie, ComponentTheme theme)|
@@ -1033,6 +1150,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieLabelPool
> XCharts.Runtime.SerieLabelPool
|public method|since|description|
|--|--|--|
|ClearAll()||public static void ClearAll()|
@@ -1041,8 +1160,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieParams
> XCharts.Runtime.SerieParams
## SeriesHelper
> XCharts.Runtime.SeriesHelper
|public method|since|description|
|--|--|--|
|GetLastStackSerie()||public static Serie GetLastStackSerie(List&lt;Serie&gt; series, Serie serie)<br/>获得上一个同堆叠且显示的serie。 |
@@ -1061,19 +1184,19 @@ Inherits or Implemented: [Attribute](#attribute)
## SimplifiedBarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedBarChart : [BaseChart](#basechart)
## SimplifiedCandlestickChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedCandlestickChart : [BaseChart](#basechart)
## SimplifiedLineChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedLineChart : [BaseChart](#basechart)
## Since
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.Since : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -1081,6 +1204,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SVG
> XUGL.SVG
|public method|since|description|
|--|--|--|
|DrawPath()||public static void DrawPath(VertexHelper vh, string path)|
@@ -1089,10 +1214,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SVGImage
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XCharts.Runtime.SVGImage : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## SVGPath
> XUGL.SVGPath
|public method|since|description|
|--|--|--|
|AddSegment()||public void AddSegment(SVGPathSeg seg)|
@@ -1101,16 +1228,24 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## SVGPathSeg
> XUGL.SVGPathSeg
|public method|since|description|
|--|--|--|
|SVGPathSeg()||public SVGPathSeg(SVGPathSegType type)|
## TooltipContext
> XCharts.Runtime.TooltipContext
## TooltipData
> XCharts.Runtime.TooltipData
## TooltipHelper
> XCharts.Runtime.TooltipHelper
|public method|since|description|
|--|--|--|
|GetItemNumericFormatter()||public static string GetItemNumericFormatter(Tooltip tooltip, Serie serie, SerieData serieData)|
@@ -1120,6 +1255,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## TooltipView
> XCharts.Runtime.TooltipView
|public method|since|description|
|--|--|--|
|CreateView()||public static TooltipView CreateView(Tooltip tooltip, ThemeStyle theme, Transform parent)|
@@ -1132,8 +1269,13 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## TooltipViewItem
> XCharts.Runtime.TooltipViewItem
## UGL
> XUGL.UGL
UGUI Graphics Library.
|public method|since|description|
|--|--|--|
|DrawDiamond()||public static void DrawDiamond(VertexHelper vh, Vector3 center, float size, Color32 color)<br/>Draw a diamond. 画菱形(钻石形状) |
@@ -1155,10 +1297,12 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## UGLExample
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XUGL.UGLExample : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## UGLHelper
> XUGL.UGLHelper
|public method|since|description|
|--|--|--|
|GetAngle360()||public static float GetAngle360(Vector2 from, Vector2 to)<br/>获得0-360的角度12点钟方向为0度 |
@@ -1166,6 +1310,7 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
|GetBezier2()||public static Vector3 GetBezier2(float t, Vector3 sp, Vector3 p1, Vector3 p2, Vector3 ep)|
|GetBezierList()||public static List&lt;Vector3&gt; GetBezierList(Vector3 sp, Vector3 ep, int segment, Vector3 cp)|
|GetDire()||public static Vector3 GetDire(float angle, bool isDegree = false)|
|GetIntersection()||public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref List&lt;Vector3&gt; intersection)<br/>获得两直线的交点 |
|GetIntersection()||public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref Vector3 intersection)<br/>获得两直线的交点 |
|GetPos()||public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)|
|GetVertialDire()||public static Vector3 GetVertialDire(Vector3 dire)|
@@ -1186,7 +1331,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## UIComponent
Inherits or Implemented: [BaseGraph](#basegraph)
> XCharts.Runtime.UIComponent : [BaseGraph](#basegraph)
UI组件基类。
|public method|since|description|
|--|--|--|
@@ -1194,16 +1340,21 @@ Inherits or Implemented: [BaseGraph](#basegraph)
## UIHelper
> XCharts.Runtime.UIHelper
UI帮助类。
|public method|since|description|
|--|--|--|
|GetBackgroundColor()||public static Color32 GetBackgroundColor(UIComponent component)|
## VisualMapContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.VisualMapContext : [MainComponentContext](#maincomponentcontext)
## VisualMapHelper
> XCharts.Runtime.VisualMapHelper
|public method|since|description|
|--|--|--|
|AutoSetLineMinMax()||public static void AutoSetLineMinMax(VisualMap visualMap, Serie serie, bool isY, Axis axis, Axis relativedAxis)|
@@ -1215,6 +1366,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## XChartsMgr
> XCharts.Runtime.XChartsMgr
|public method|since|description|
|--|--|--|
|AddChart()||public static void AddChart(BaseChart chart)|
@@ -1230,7 +1383,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## XCResourceImporterWindow
Inherits or Implemented: [UnityEditor.EditorWindow](#unityeditor.editorwindow)
> XCharts.Runtime.XCResourceImporterWindow : [UnityEditor.EditorWindow](https://docs.unity3d.com/ScriptReference/30_search.html?q=unityeditor.editorwindow)
|public method|since|description|
|--|--|--|
@@ -1238,6 +1391,8 @@ Inherits or Implemented: [UnityEditor.EditorWindow](#unityeditor.editorwindow)
## XCThemeMgr
> XCharts.Runtime.XCThemeMgr
|public method|since|description|
|--|--|--|
|AddTheme()||public static void AddTheme(Theme theme)|

View File

@@ -2,6 +2,7 @@
# 更新日志
[master](#master)
[v3.7.0](#v370)
[v3.6.0](#v360)
[v3.5.0](#v350)
[v3.4.0](#v340)
@@ -61,6 +62,34 @@
## master
## v3.7.0
Highlights:
* Added `HelpDoc` official website help document redirection
* Added support for `Clip` for `Line`
* Optimize the range Settings of `Axis`
* Other optimizations and fixes
Log details:
* (2022.06.08) Release v3.7.0
* (2023.06.04) Added `HelpDoc` help document skip
* (2023.05.30) Fix to Serie name with `_` line causing `Legend` to not fire (#252) (by __svr2kos2__)
* (2023.05.10) Added `MinMaxAuto` range type for `Axis`
* (2023.05.10) Added support for `Clip` for `Line`
* (2023.05.04) Fixed `Axis` setting` CeilRate `not taking effect in range -1 to 1
* (2023.05.04) Optimizes MinMax type range calculations for Axis
* (2023.05.04) Fix to AxisLabel displaying `Label` formatting incorrectly when the data is all floating point numbers less than 1
* (2023.05.04) Fix to `Theme` being reset after modifying default theme parameters
* (2023.05.04) Added `Warning` when `Symbol` selects `Custom` type
* (2023.04.15) Fix to `DataZoom` may be abnormal in multiple charts (#252)
* (2023.04.14) Fix to `Tooltip` may be abnormal when there is only one data
* (2023.04.14) added `BaseChart`s `TriggerTooltip()` interface to try to trigger `ToolTip`
* (2023.04.12) Optimizes` RadarCood `setting` startAngle `with text following the adjustment position
* (2023.04.12) Added `Radar` support for wildcard `{b}`
* (2023.04.11) Fixed an issue where Inspector could be abnormal when dynamically adding components
## v3.6.0
* (2023.04.01) Release `v3.6.0` version

File diff suppressed because it is too large Load Diff

View File

@@ -35,8 +35,15 @@ slug: /api
- [GridCoordContext](#gridcoordcontext)
- [HeatmapChart](#heatmapchart)
- [IgnoreDoc](#ignoredoc)
- [INeedSerieContainer](#ineedseriecontainer)
- [InputHelper](#inputhelper)
- [InteractData](#interactdata)
- [IPropertyChanged](#ipropertychanged)
- [ISerieComponent](#iseriecomponent)
- [ISerieContainer](#iseriecontainer)
- [ISerieDataComponent](#iseriedatacomponent)
- [ISimplifiedSerie](#isimplifiedserie)
- [IUpdateRuntimeData](#iupdateruntimedata)
- [LayerHelper](#layerhelper)
- [LegendContext](#legendcontext)
- [LegendHelper](#legendhelper)
@@ -106,6 +113,8 @@ slug: /api
## AnimationStyleHelper
> XCharts.Runtime.AnimationStyleHelper
|public method|since|description|
|--|--|--|
|CheckDataAnimation()||public static float CheckDataAnimation(BaseChart chart, Serie serie, int dataIndex, float destProgress, float startPorgress = 0)|
@@ -115,14 +124,16 @@ slug: /api
## AxisContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.AxisContext : [MainComponentContext](#maincomponentcontext)
## AxisHandler&lt;T&gt;
Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
> XCharts.AxisHandler&lt;T&gt; : [MainComponentHandler](#maincomponenthandler)
## AxisHelper
> XCharts.Runtime.AxisHelper
|public method|since|description|
|--|--|--|
|AdjustCircleLabelPos()||public static void AdjustCircleLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)|
@@ -149,11 +160,11 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
## BarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.BarChart : [BaseChart](#basechart)
## BaseChart
Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver](#iserializationcallbackreceiver)
> XCharts.Runtime.BaseChart : [BaseGraph](#basegraph),[ISerializationCallbackReceiver](https://docs.unity3d.com/ScriptReference/30_search.html?q=iserializationcallbackreceiver) / Subclasses: [BarChart](#barchart),[CandlestickChart](#candlestickchart),[HeatmapChart](#heatmapchart),[LineChart](#linechart),[ParallelChart](#parallelchart),[PieChart](#piechart),[PolarChart](#polarchart),[RadarChart](#radarchart),[RingChart](#ringchart),[ScatterChart](#scatterchart),[SimplifiedBarChart](#simplifiedbarchart),[SimplifiedCandlestickChart](#simplifiedcandlestickchart),[SimplifiedLineChart](#simplifiedlinechart)
|public method|since|description|
|--|--|--|
@@ -204,6 +215,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
|CanAddChartComponent()||public bool CanAddChartComponent(Type type)|
|CanAddSerie()||public bool CanAddSerie(Type type)|
|CanAddSerie&lt;T&gt;()||public bool CanAddSerie&lt;T&gt;() where T : Serie|
|CancelTooltip()|v3.7.0|public void CancelTooltip()<br/>取消Tooltip. |
|CanMultipleComponent()||public bool CanMultipleComponent(Type type)|
|ClampInChart()||public void ClampInChart(ref Vector3 pos)|
|ClampInGrid()||public Vector3 ClampInGrid(GridCoord grid, Vector3 pos)|
@@ -319,6 +331,8 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
|SetSeriePainterMaterial()||public void SetSeriePainterMaterial(Material material)<br/>设置Serie Painter的材质球 |
|SetTopPainterMaterial()||public void SetTopPainterMaterial(Material material)<br/>设置Top Painter的材质球 |
|SetUpperPainterMaterial()||public void SetUpperPainterMaterial(Material material)<br/>设置Upper Painter的材质球 |
|TriggerTooltip()|v3.7.0|public bool TriggerTooltip(int dataIndex)<br/>尝试触发指定数据项的Tooltip. |
|TriggerTooltip()|v3.7.0|public bool TriggerTooltip(Vector3 localPosition)<br/>在指定的位置尝试触发Tooltip. |
|TryAddChartComponent()||public bool TryAddChartComponent(Type type)|
|TryAddChartComponent&lt;T&gt;()||public bool TryAddChartComponent&lt;T&gt;() where T : MainComponent|
|TryAddChartComponent&lt;T&gt;()||public bool TryAddChartComponent&lt;T&gt;(out T component) where T : MainComponent|
@@ -341,7 +355,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver
## BaseGraph
Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandler](#ipointerdownhandler),[IPointerUpHandler](#ipointeruphandler),[](#)
> XCharts.Runtime.BaseGraph : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent)
|public method|since|description|
|--|--|--|
@@ -355,6 +369,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandle
|onPointerUp||public Action&lt;PointerEventData, BaseGraph&gt; onPointerUp<br/>鼠标弹起回调。 |
|onScroll||public Action&lt;PointerEventData, BaseGraph&gt; onScroll<br/>鼠标滚动回调。 |
|CheckWarning()||public string CheckWarning()<br/>检测警告信息。 |
|LocalPointToScreenPoint()|v3.7.0|public Vector2 LocalPointToScreenPoint(Vector2 localPoint)<br/>图表内坐标转屏幕坐标。 |
|LocalPointToWorldPoint()|v3.7.0|public Vector2 LocalPointToWorldPoint(Vector2 localPoint)<br/>图表内坐标转世界坐标。 |
|OnBeginDrag()||public virtual void OnBeginDrag(PointerEventData eventData)|
|OnDrag()||public virtual void OnDrag(PointerEventData eventData)|
|OnEndDrag()||public virtual void OnEndDrag(PointerEventData eventData)|
@@ -374,10 +390,12 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic),[IPointerDownHandle
## CandlestickChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.CandlestickChart : [BaseChart](#basechart)
## ChartCached
> XCharts.Runtime.ChartCached
|public method|since|description|
|--|--|--|
|ColorToDotStr()||public static string ColorToDotStr(Color color)|
@@ -389,10 +407,16 @@ Inherits or Implemented: [BaseChart](#basechart)
## ChartConst
> XCharts.Runtime.ChartConst
## ChartDrawer
> XCharts.Runtime.ChartDrawer
## ChartHelper
> XCharts.Runtime.ChartHelper
|public method|since|description|
|--|--|--|
|ActiveAllObject()||public static void ActiveAllObject(Transform parent, bool active, string match = null)|
@@ -416,8 +440,10 @@ Inherits or Implemented: [BaseChart](#basechart)
|GetFullName()||public static string GetFullName(Transform transform)|
|GetHighlightColor()||public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)|
|GetLastValue()||public static Vector3 GetLastValue(List&lt;Vector3&gt; list)|
|GetMaxCeilRate()||public static double GetMaxCeilRate(double value, double ceilRate)|
|GetMaxDivisibleValue()||public static double GetMaxDivisibleValue(double max, double ceilRate)|
|GetMaxLogValue()||public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)|
|GetMinCeilRate()||public static double GetMinCeilRate(double value, double ceilRate)|
|GetMinDivisibleValue()||public static double GetMinDivisibleValue(double min, double ceilRate)|
|GetMinLogValue()||public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)|
|GetOrAddComponent&lt;T&gt;()||public static T GetOrAddComponent&lt;T&gt;(GameObject gameObject) where T : Component|
@@ -458,7 +484,7 @@ Inherits or Implemented: [BaseChart](#basechart)
## ChartLabel
Inherits or Implemented: [Image](#image)
> XCharts.Runtime.ChartLabel : [Image](https://docs.unity3d.com/ScriptReference/30_search.html?q=image)
|public method|since|description|
|--|--|--|
@@ -487,12 +513,16 @@ Inherits or Implemented: [Image](#image)
## ChartObject
> XCharts.Runtime.ChartObject
|public method|since|description|
|--|--|--|
|Destroy()||public virtual void Destroy()|
## CheckHelper
> XCharts.Runtime.CheckHelper
|public method|since|description|
|--|--|--|
|CheckChart()||public static string CheckChart(BaseChart chart)|
@@ -500,13 +530,15 @@ Inherits or Implemented: [Image](#image)
## ColorUtil
> XCharts.Runtime.ColorUtil
|public method|since|description|
|--|--|--|
|GetColor()||public static Color32 GetColor(string hexColorStr)<br/>将字符串颜色值转成Color。 |
## ComponentHandlerAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.ComponentHandlerAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -515,6 +547,8 @@ Inherits or Implemented: [Attribute](#attribute)
## ComponentHelper
> XCharts.Runtime.ComponentHelper
|public method|since|description|
|--|--|--|
|GetAngleAxis()||public static AngleAxis GetAngleAxis(List&lt;MainComponent&gt; components, int polarIndex)|
@@ -525,7 +559,7 @@ Inherits or Implemented: [Attribute](#attribute)
## CoordOptionsAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.CoordOptionsAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -537,10 +571,12 @@ Inherits or Implemented: [Attribute](#attribute)
## DataZoomContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.DataZoomContext : [MainComponentContext](#maincomponentcontext)
## DataZoomHelper
> XCharts.Runtime.DataZoomHelper
|public method|since|description|
|--|--|--|
|UpdateDataZoomRuntimeStartEndValue()||public static void UpdateDataZoomRuntimeStartEndValue(DataZoom dataZoom, Serie serie)|
@@ -548,6 +584,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## DateTimeUtil
> XCharts.Runtime.DateTimeUtil
|public method|since|description|
|--|--|--|
|GetDateTime()||public static DateTime GetDateTime(int timestamp)|
@@ -556,7 +594,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## DefaultAnimationAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.DefaultAnimationAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -564,6 +602,8 @@ Inherits or Implemented: [Attribute](#attribute)
## DefineSymbolsUtil
> XCharts.Runtime.DefineSymbolsUtil
|public method|since|description|
|--|--|--|
|AddGlobalDefine()||public static void AddGlobalDefine(string symbol)|
@@ -571,6 +611,8 @@ Inherits or Implemented: [Attribute](#attribute)
## FormatterHelper
> XCharts.Runtime.FormatterHelper
|public method|since|description|
|--|--|--|
|NeedFormat()||public static bool NeedFormat(string content)|
@@ -581,22 +623,28 @@ Inherits or Implemented: [Attribute](#attribute)
## GridCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.GridCoordContext : [MainComponentContext](#maincomponentcontext)
## HeatmapChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.HeatmapChart : [BaseChart](#basechart)
## IgnoreDoc
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.IgnoreDoc : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
|IgnoreDoc()||public IgnoreDoc()|
## INeedSerieContainer
> XCharts.Runtime.INeedSerieContainer / Subclasses: [Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Radar](#radar),[BaseScatter](#basescatter)
## InputHelper
> XCharts.Runtime.InputHelper
|public method|since|description|
|--|--|--|
|GetKeyDown()||public static bool GetKeyDown(KeyCode keyCode)|
@@ -604,6 +652,8 @@ Inherits or Implemented: [Attribute](#attribute)
## InteractData
> XCharts.Runtime.InteractData
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
@@ -618,8 +668,37 @@ Inherits or Implemented: [Attribute](#attribute)
|TryGetValue()||public bool TryGetValue(ref float value, ref bool interacting, float animationDuration = 250)|
|TryGetValueAndColor()||public bool TryGetValueAndColor(ref float value, ref Color32 color, ref Color32 toColor, ref bool interacting, float animationDuration = 250)|
## IPropertyChanged
> XCharts.Runtime.IPropertyChanged / Subclasses: [Location](#location),[Comment](#comment),[Legend](#legend),[Title](#title)
属性变更接口
## ISerieComponent
> XCharts.Runtime.ISerieComponent / Subclasses: [AreaStyle](#areastyle),[ImageStyle](#imagestyle),[LineArrow](#linearrow),[LabelLine](#labelline),[LabelStyle](#labelstyle),[BlurStyle](#blurstyle),[EmphasisStyle](#emphasisstyle),[SelectStyle](#selectstyle),[TitleStyle](#titlestyle)
可用于Serie的组件。
## ISerieContainer
> XCharts.Runtime.ISerieContainer / Subclasses: [RadarCoord](#radarcoord),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord),[PolarCoord](#polarcoord)
## ISerieDataComponent
> XCharts.Runtime.ISerieDataComponent / Subclasses: [AreaStyle](#areastyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[LineStyle](#linestyle),[SerieSymbol](#seriesymbol),[LabelLine](#labelline),[LabelStyle](#labelstyle),[BlurStyle](#blurstyle),[EmphasisStyle](#emphasisstyle),[SelectStyle](#selectstyle),[TitleStyle](#titlestyle)
可用于SerieData的组件。
## ISimplifiedSerie
> XCharts.Runtime.ISimplifiedSerie / Subclasses: [SimplifiedBar](#simplifiedbar),[SimplifiedCandlestick](#simplifiedcandlestick),[SimplifiedLine](#simplifiedline)
## IUpdateRuntimeData
> XCharts.Runtime.IUpdateRuntimeData / Subclasses: [SingleAxis](#singleaxis),[DataZoom](#datazoom),[CalendarCoord](#calendarcoord),[GridCoord](#gridcoord),[ParallelCoord](#parallelcoord)
## LayerHelper
> XCharts.Runtime.LayerHelper
|public method|since|description|
|--|--|--|
|IsFixedWidthHeight()||public static bool IsFixedWidthHeight(RectTransform rt)|
@@ -627,10 +706,12 @@ Inherits or Implemented: [Attribute](#attribute)
## LegendContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.LegendContext : [MainComponentContext](#maincomponentcontext)
## LegendHelper
> XCharts.Runtime.LegendHelper
|public method|since|description|
|--|--|--|
|CheckDataHighlighted()||public static bool CheckDataHighlighted(Serie serie, string legendName, bool heighlight)|
@@ -642,6 +723,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## LegendItem
> XCharts.Runtime.LegendItem
|public method|since|description|
|--|--|--|
|GetIconColor()||public Color GetIconColor()|
@@ -665,11 +748,11 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## LineChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.LineChart : [BaseChart](#basechart)
## ListFor
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.ListFor : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute) / Subclasses: [ListForComponent](#listforcomponent),[ListForSerie](#listforserie)
|public method|since|description|
|--|--|--|
@@ -677,7 +760,7 @@ Inherits or Implemented: [Attribute](#attribute)
## ListForComponent
Inherits or Implemented: [ListFor](#listfor)
> XCharts.Runtime.ListForComponent : [ListFor](#listfor)
|public method|since|description|
|--|--|--|
@@ -685,7 +768,7 @@ Inherits or Implemented: [ListFor](#listfor)
## ListForSerie
Inherits or Implemented: [ListFor](#listfor)
> XCharts.Runtime.ListForSerie : [ListFor](#listfor)
|public method|since|description|
|--|--|--|
@@ -693,8 +776,12 @@ Inherits or Implemented: [ListFor](#listfor)
## MainComponentContext
> XCharts.Runtime.MainComponentContext / Subclasses: [AxisContext](#axiscontext),[DataZoomContext](#datazoomcontext),[LegendContext](#legendcontext),[RadarCoordContext](#radarcoordcontext),[VisualMapContext](#visualmapcontext),[GridCoordContext](#gridcoordcontext),[ParallelCoordContext](#parallelcoordcontext),[PolarCoordContext](#polarcoordcontext)
## MainComponentHandler
> XCharts.Runtime.MainComponentHandler / Subclasses: [AxisHandler&lt;T&gt;](#axishandlert),[MainComponentHandler&lt;T&gt;](#maincomponenthandlert)
|public method|since|description|
|--|--|--|
|CheckComponent()||public virtual void CheckComponent(StringBuilder sb) { }|
@@ -717,10 +804,12 @@ Inherits or Implemented: [ListFor](#listfor)
## MainComponentHandler&lt;T&gt;
Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
> XCharts.Runtime.MainComponentHandler&lt;T&gt; : [MainComponentHandler](#maincomponenthandler)
## MathUtil
> XCharts.Runtime.MathUtil
|public method|since|description|
|--|--|--|
|Abs()||public static double Abs(double d)|
@@ -733,7 +822,7 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler)
## ObjectPool&lt;T&gt; where T
Inherits or Implemented: [new()](#new())
> XCharts.Runtime.ObjectPool&lt;T&gt; where T : [new()](#new())
|public method|since|description|
|--|--|--|
@@ -745,7 +834,7 @@ Inherits or Implemented: [new()](#new())
## Painter
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XCharts.Runtime.Painter : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
|public method|since|description|
|--|--|--|
@@ -757,26 +846,28 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## ParallelChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.ParallelChart : [BaseChart](#basechart)
## ParallelCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.ParallelCoordContext : [MainComponentContext](#maincomponentcontext)
## PieChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.PieChart : [BaseChart](#basechart)
## PolarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.PolarChart : [BaseChart](#basechart)
## PolarCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.PolarCoordContext : [MainComponentContext](#maincomponentcontext)
## PropertyUtil
> XCharts.Runtime.PropertyUtil
|public method|since|description|
|--|--|--|
|SetClass&lt;T&gt;()||public static bool SetClass&lt;T&gt;(ref T currentValue, T newValue, bool notNull = false) where T : class|
@@ -786,14 +877,16 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## RadarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.RadarChart : [BaseChart](#basechart)
## RadarCoordContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.RadarCoordContext : [MainComponentContext](#maincomponentcontext)
## ReflectionUtil
> XCharts.Runtime.ReflectionUtil
|public method|since|description|
|--|--|--|
|DeepCloneSerializeField()||public static object DeepCloneSerializeField(object obj)|
@@ -805,7 +898,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## RequireChartComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.RequireChartComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -815,10 +908,12 @@ Inherits or Implemented: [Attribute](#attribute)
## RingChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.RingChart : [BaseChart](#basechart)
## RuntimeUtil
> XCharts.Runtime.RuntimeUtil
|public method|since|description|
|--|--|--|
|GetAllAssemblyTypes()||public static IEnumerable&lt;Type&gt; GetAllAssemblyTypes()|
@@ -830,11 +925,12 @@ Inherits or Implemented: [BaseChart](#basechart)
## ScatterChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.ScatterChart : [BaseChart](#basechart)
## SerieComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
可添加到Serie的组件。
|public method|since|description|
|--|--|--|
@@ -851,9 +947,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieContext
> XCharts.Runtime.SerieContext
## SerieConvertAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieConvertAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
可转化为哪些Serie类型。
|public method|since|description|
|--|--|--|
@@ -866,7 +965,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieDataComponentAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieDataComponentAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
可添加到SerieData的组件。
|public method|since|description|
|--|--|--|
@@ -883,13 +983,15 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieDataContext
> XCharts.Runtime.SerieDataContext
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
## SerieDataExtraFieldAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieDataExtraFieldAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -905,12 +1007,17 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieEventData
> XCharts.Runtime.SerieEventData
serie事件的数据。
|public method|since|description|
|--|--|--|
|Reset()||public void Reset()|
## SerieEventDataPool
> XCharts.Runtime.SerieEventDataPool
|public method|since|description|
|--|--|--|
|Get()||public static SerieEventData Get(Vector3 pos, int serieIndex, int dataIndex, int dimension, double value)|
@@ -918,6 +1025,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieHandler
> XCharts.Runtime.SerieHandler
|public method|since|description|
|--|--|--|
|CheckComponent()||public virtual void CheckComponent(StringBuilder sb) { }|
@@ -944,9 +1053,13 @@ Inherits or Implemented: [Attribute](#attribute)
|Update()||public virtual void Update() { }|
|UpdateSerieContext()||public virtual void UpdateSerieContext() { }|
## SerieHandler where T
> .SerieHandler where T / Subclasses: [SerieHandler&lt;T&gt;](#seriehandlert)
## SerieHandler&lt;T&gt;
Inherits or Implemented: [SerieHandler where T](#seriehandler where t),[Serie](#serie)
> XCharts.Runtime.SerieHandler&lt;T&gt; : [SerieHandler where T](#seriehandler where t),[Serie](#serie)
|public method|since|description|
|--|--|--|
@@ -971,7 +1084,7 @@ Inherits or Implemented: [SerieHandler where T](#seriehandler where t),[Serie](#
## SerieHandlerAttribute
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.SerieHandlerAttribute : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -980,6 +1093,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieHelper
> XCharts.Runtime.SerieHelper
|public method|since|description|
|--|--|--|
|CloneSerie&lt;T&gt;()||public static T CloneSerie&lt;T&gt;(Serie serie) where T : Serie|
@@ -1022,6 +1137,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieLabelHelper
> XCharts.Runtime.SerieLabelHelper
|public method|since|description|
|--|--|--|
|AvoidLabelOverlap()||public static void AvoidLabelOverlap(Serie serie, ComponentTheme theme)|
@@ -1033,6 +1150,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieLabelPool
> XCharts.Runtime.SerieLabelPool
|public method|since|description|
|--|--|--|
|ClearAll()||public static void ClearAll()|
@@ -1041,8 +1160,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SerieParams
> XCharts.Runtime.SerieParams
## SeriesHelper
> XCharts.Runtime.SeriesHelper
|public method|since|description|
|--|--|--|
|GetLastStackSerie()||public static Serie GetLastStackSerie(List&lt;Serie&gt; series, Serie serie)<br/>获得上一个同堆叠且显示的serie。 |
@@ -1061,19 +1184,19 @@ Inherits or Implemented: [Attribute](#attribute)
## SimplifiedBarChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedBarChart : [BaseChart](#basechart)
## SimplifiedCandlestickChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedCandlestickChart : [BaseChart](#basechart)
## SimplifiedLineChart
Inherits or Implemented: [BaseChart](#basechart)
> XCharts.Runtime.SimplifiedLineChart : [BaseChart](#basechart)
## Since
Inherits or Implemented: [Attribute](#attribute)
> XCharts.Runtime.Since : [Attribute](https://docs.unity3d.com/ScriptReference/30_search.html?q=attribute)
|public method|since|description|
|--|--|--|
@@ -1081,6 +1204,8 @@ Inherits or Implemented: [Attribute](#attribute)
## SVG
> XUGL.SVG
|public method|since|description|
|--|--|--|
|DrawPath()||public static void DrawPath(VertexHelper vh, string path)|
@@ -1089,10 +1214,12 @@ Inherits or Implemented: [Attribute](#attribute)
## SVGImage
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XCharts.Runtime.SVGImage : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## SVGPath
> XUGL.SVGPath
|public method|since|description|
|--|--|--|
|AddSegment()||public void AddSegment(SVGPathSeg seg)|
@@ -1101,16 +1228,24 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## SVGPathSeg
> XUGL.SVGPathSeg
|public method|since|description|
|--|--|--|
|SVGPathSeg()||public SVGPathSeg(SVGPathSegType type)|
## TooltipContext
> XCharts.Runtime.TooltipContext
## TooltipData
> XCharts.Runtime.TooltipData
## TooltipHelper
> XCharts.Runtime.TooltipHelper
|public method|since|description|
|--|--|--|
|GetItemNumericFormatter()||public static string GetItemNumericFormatter(Tooltip tooltip, Serie serie, SerieData serieData)|
@@ -1120,6 +1255,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## TooltipView
> XCharts.Runtime.TooltipView
|public method|since|description|
|--|--|--|
|CreateView()||public static TooltipView CreateView(Tooltip tooltip, ThemeStyle theme, Transform parent)|
@@ -1132,8 +1269,13 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## TooltipViewItem
> XCharts.Runtime.TooltipViewItem
## UGL
> XUGL.UGL
UGUI 图形库
|public method|since|description|
|--|--|--|
|DrawDiamond()||public static void DrawDiamond(VertexHelper vh, Vector3 center, float size, Color32 color)<br/>Draw a diamond. 画菱形(钻石形状) |
@@ -1155,10 +1297,12 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## UGLExample
Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
> XUGL.UGLExample : [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic)
## UGLHelper
> XUGL.UGLHelper
|public method|since|description|
|--|--|--|
|GetAngle360()||public static float GetAngle360(Vector2 from, Vector2 to)<br/>获得0-360的角度12点钟方向为0度 |
@@ -1166,6 +1310,7 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
|GetBezier2()||public static Vector3 GetBezier2(float t, Vector3 sp, Vector3 p1, Vector3 p2, Vector3 ep)|
|GetBezierList()||public static List&lt;Vector3&gt; GetBezierList(Vector3 sp, Vector3 ep, int segment, Vector3 cp)|
|GetDire()||public static Vector3 GetDire(float angle, bool isDegree = false)|
|GetIntersection()||public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref List&lt;Vector3&gt; intersection)<br/>获得两直线的交点 |
|GetIntersection()||public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref Vector3 intersection)<br/>获得两直线的交点 |
|GetPos()||public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)|
|GetVertialDire()||public static Vector3 GetVertialDire(Vector3 dire)|
@@ -1186,7 +1331,8 @@ Inherits or Implemented: [MaskableGraphic](#maskablegraphic)
## UIComponent
Inherits or Implemented: [BaseGraph](#basegraph)
> XCharts.Runtime.UIComponent : [BaseGraph](#basegraph)
UI组件基类。
|public method|since|description|
|--|--|--|
@@ -1194,16 +1340,21 @@ Inherits or Implemented: [BaseGraph](#basegraph)
## UIHelper
> XCharts.Runtime.UIHelper
UI帮助类。
|public method|since|description|
|--|--|--|
|GetBackgroundColor()||public static Color32 GetBackgroundColor(UIComponent component)|
## VisualMapContext
Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
> XCharts.Runtime.VisualMapContext : [MainComponentContext](#maincomponentcontext)
## VisualMapHelper
> XCharts.Runtime.VisualMapHelper
|public method|since|description|
|--|--|--|
|AutoSetLineMinMax()||public static void AutoSetLineMinMax(VisualMap visualMap, Serie serie, bool isY, Axis axis, Axis relativedAxis)|
@@ -1215,6 +1366,8 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## XChartsMgr
> XCharts.Runtime.XChartsMgr
|public method|since|description|
|--|--|--|
|AddChart()||public static void AddChart(BaseChart chart)|
@@ -1230,7 +1383,7 @@ Inherits or Implemented: [MainComponentContext](#maincomponentcontext)
## XCResourceImporterWindow
Inherits or Implemented: [UnityEditor.EditorWindow](#unityeditor.editorwindow)
> XCharts.Runtime.XCResourceImporterWindow : [UnityEditor.EditorWindow](https://docs.unity3d.com/ScriptReference/30_search.html?q=unityeditor.editorwindow)
|public method|since|description|
|--|--|--|
@@ -1238,6 +1391,8 @@ Inherits or Implemented: [UnityEditor.EditorWindow](#unityeditor.editorwindow)
## XCThemeMgr
> XCharts.Runtime.XCThemeMgr
|public method|since|description|
|--|--|--|
|AddTheme()||public static void AddTheme(Theme theme)|

View File

@@ -6,7 +6,7 @@ slug: /changelog
# 更新日志
[master](#master)
[v3.6.0](#v360)
[v3.7.0](#v370)
[v3.5.0](#v350)
[v3.4.0](#v340)
[v3.3.0](#v330)
@@ -66,6 +66,34 @@ slug: /changelog
## master
## v3.7.0
版本要点:
* 增加`HelpDoc`官网帮助文档跳转
* 增加`Line``Clip`的支持
* 优化`Axis`的范围设置
* 其他优化和修复
日志详情:
* (2023.06.08) 发布`v3.7.0`版本
* (2023.06.04) 增加`HelpDoc`帮助文档跳转
* (2023.05.30) 修复`Serie`的名字带`_`线导致`Legend`无法触发的问题 (#259) (by __svr2kos2__)
* (2023.05.10) 增加`Axis``MinMaxAuto`范围类型
* (2023.05.10) 增加`Line``Clip`的支持
* (2023.05.04) 优化`Axis`在-1到1范围时设置`CeilRate`不生效的问题
* (2023.05.04) 优化`Axis``MinMax`类型范围计算
* (2023.05.04) 修复`AxisLabel`在数据都是小于1的浮点数时显示`Label`格式不对的问题
* (2023.05.04) 修复`Theme`在修改默认主题的参数后运行被重置的问题
* (2023.05.04) 增加`Symbol`选择`Custom`类型时的`Warning`提示
* (2023.04.15) 修复`DataZoom`在多个图表时可能异常的问题 (#252)
* (2023.04.14) 修复`Tooltip`在只有一个数据时可能异常的问题
* (2023.04.14) 增加`BaseChart``TriggerTooltip()`接口尝试触发`ToolTip`
* (2023.04.12) 优化`RadarCood`设置`startAngle`时文本也跟随调整位置
* (2023.04.12) 增加`Radar`对通配符`{b}`的支持
* (2023.04.11) 修复`Inspector`在动态添加组件时可能异常的问题
## v3.6.0
版本要点:

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,14 @@ slug: /tutorial01
# 教程5分钟上手 XCharts 3.0
> 本教程适用XCharts 3.x版本2.x版本请看 [教程5分钟上手XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/教程5分钟上手XCharts.md)
## 使用 XCharts 前需要掌握什么
- 会简单使用Unity
- 了解UGUI会使用UGUI
- 了解Unity的MonoBehavior脚本用法知道怎么挂脚本用代码操作脚本
## 获取和导入 XCharts
XCharts可通过以下任意一种方式导入到项目
@@ -211,6 +219,8 @@ xAxis.boundaryGap = true;
xAxis.type = Axis.AxisType.Category;
```
> 注:低版本没有`EnsureChartComponent()`接口时,用`GetOrAddChartComponent()`
### 改Serie的参数
对于新添加的Serie

View File

@@ -73,6 +73,14 @@ namespace XCharts.Editor
return prop.propertyPath + "_" + index;
}
protected void AddHelpBox(string message, MessageType type = MessageType.Warning, int line = 2)
{
var offset = EditorGUI.indentLevel * ChartEditorHelper.INDENT_WIDTH;
EditorGUI.HelpBox(new Rect(m_DrawRect.x + offset, m_DrawRect.y, m_DrawRect.width - offset, EditorGUIUtility.singleLineHeight * line), message, type);
for (int i = 0; i < line; i++)
AddSingleLineHeight();
}
protected void AddSingleLineHeight()
{
m_Heights[m_KeyName] += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;

View File

@@ -15,10 +15,11 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SymbolType.Custom)
{
AddHelpBox("Custom symbol only work in PictorialBar serie", MessageType.Warning);
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_Width");
@@ -27,7 +28,7 @@ namespace XCharts.Editor
}
PropertyField(prop, "m_Gap");
PropertyField(prop, "m_SizeType");
switch ((SymbolSizeType) prop.FindPropertyRelative("m_SizeType").enumValueIndex)
switch ((SymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
{
case SymbolSizeType.Custom:
PropertyField(prop, "m_Size");

View File

@@ -15,10 +15,11 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SymbolType.Custom)
{
AddHelpBox("Custom Symbol only work in PictorialBar serie", MessageType.Warning);
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_Width");

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
using UnityEngine.Assertions;
using XCharts.Runtime;
@@ -81,8 +82,9 @@ namespace XCharts.Editor
title,
editor.baseProperty,
editor.showProperty,
() => { ResetComponentEditor(id); },
() => { RemoveComponentEditor(id); }
() => { if (EditorUtility.DisplayDialog("", "Sure reset " + editor.component.GetType().Name + "?", "Yes", "Cancel")) ResetComponentEditor(id); },
() => { if (EditorUtility.DisplayDialog("", "Sure remove " + editor.component.GetType().Name + "?", "Yes", "Cancel")) RemoveComponentEditor(id); },
() => { Application.OpenURL("https://xcharts-team.github.io/docs/configuration/#" + editor.component.GetType().Name.ToLower()); }
);
if (displayContent)
{
@@ -102,7 +104,8 @@ namespace XCharts.Editor
editor.OnDisable();
m_Editors.Clear();
for (int i = 0; i < chart.components.Count; i++)
var count = Mathf.Min(chart.components.Count, m_ComponentsProperty.Count);
for (int i = 0; i < count; i++)
{
if (chart.components[i] != null)
{
@@ -119,7 +122,7 @@ namespace XCharts.Editor
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
editorType = typeof(MainComponentBaseEditor);
var editor = (MainComponentBaseEditor) Activator.CreateInstance(editorType);
var editor = (MainComponentBaseEditor)Activator.CreateInstance(editorType);
editor.Init(chart, component, property, m_BaseEditor);
if (index < 0)

View File

@@ -22,7 +22,7 @@ namespace XCharts.Editor
{
PropertyField("m_SmoothLimit");
}
//PropertyField("m_Clip");
PropertyField("m_Clip");
PropertyFiledMore(() =>
{
PropertyFieldLimitMin("m_MinShow", 0);

View File

@@ -52,7 +52,7 @@ namespace XCharts.Editor
public static void SecondField(Rect drawRect, SerializedProperty prop)
{
RectOffset offset = new RectOffset(-(int) EditorGUIUtility.labelWidth, 0, 0, 0);
RectOffset offset = new RectOffset(-(int)EditorGUIUtility.labelWidth, 0, 0, 0);
drawRect = offset.Add(drawRect);
EditorGUI.PropertyField(drawRect, prop, GUIContent.none);
drawRect = offset.Remove(drawRect);
@@ -180,8 +180,8 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Boolean)
{
if (!propEnable)
using(new EditorGUI.DisabledScope(true))
MakeBool(drawRect, prop);
using (new EditorGUI.DisabledScope(true))
MakeBool(drawRect, prop);
else
MakeBool(drawRect, prop);
if (prop2 != null && !moduleToggle[key])
@@ -444,7 +444,7 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue < minValue)
prop.floatValue = minValue;
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue < minValue)
prop.intValue = (int) minValue;
prop.intValue = (int)minValue;
var hig = EditorGUI.GetPropertyHeight(prop);
drawRect.y += hig;
heights[key] += hig;
@@ -459,7 +459,7 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue > maxValue)
prop.floatValue = maxValue;
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue > maxValue)
prop.intValue = (int) maxValue;
prop.intValue = (int)maxValue;
var hig = EditorGUI.GetPropertyHeight(prop);
drawRect.y += hig;
heights[key] += hig;
@@ -635,11 +635,13 @@ namespace XCharts.Editor
}
internal static bool DrawHeader(string title, SerializedProperty group, SerializedProperty activeField,
Action resetAction, Action removeAction)
Action resetAction, Action removeAction, Action docAction)
{
if (group == null) return false;
group.isExpanded = DrawHeader(title, group.isExpanded, false, activeField, null,
new HeaderMenuInfo("Reset", resetAction), new HeaderMenuInfo("Remove", removeAction));
new HeaderMenuInfo("Reset", resetAction),
new HeaderMenuInfo("Remove", removeAction),
new HeaderMenuInfo("HelpDoc", docAction));
return group.isExpanded;
}

View File

@@ -45,15 +45,15 @@
一款基于`UGUI`的功能强大、简单易用的数据可视化图表插件。支持`折线图``柱状图``饼图``雷达图``散点图``热力图``环形图``K线图``极坐标``平行坐标`等十多种内置图表,以及`3D饼图``3D柱图``3D金字塔``漏斗图``仪表盘``水位图``象形柱图``甘特图``矩形树图`等扩展图表。
[XCharts3.0 官方主页](https://xcharts-team.github.io)
[XCharts3.0 在线示例](https://xcharts-team.github.io/examples)
[XCharts3.0 官方主页](https://xcharts-team.github.io)
[XCharts3.0 在线示例](https://xcharts-team.github.io/examples)
[XCharts3.0 教程](Documentation~/zh/tutorial01.md)
[XCharts3.0 API](Documentation~/zh/api.md)
[XCharts3.0 问答](Documentation~/zh/faq.md)
[XCharts3.0 配置项手册](Documentation~/zh/configuration.md)
[XCharts3.0 更新日志](Documentation~/zh/changelog.md)
[XCharts3.0 订阅服务](Documentation~/zh/support.md)
[XCharts3.0 教程5分钟上手 XCharts](Documentation~/zh/tutorial01.md)
[XCharts3.0 API](Documentation~/zh/api.md)
[XCharts3.0 问答](Documentation~/zh/faq.md)
[XCharts3.0 配置项手册](Documentation~/zh/configuration.md)
[XCharts3.0 更新日志](Documentation~/zh/changelog.md)
[XCharts3.0 订阅服务](Documentation~/zh/support.md)
## 特性

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class BarChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class CandlestickChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -7,6 +7,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class HeatmapChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class LineChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -7,6 +7,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class ParallelChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class PieChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class PolarChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class RadarChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class RingChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class ScatterChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class SimplifiedBarChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class SimplifiedCandlestickChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -6,6 +6,7 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform))]
[DisallowMultipleComponent]
[HelpURL("https://xcharts-team.github.io/docs/configuration")]
public class SimplifiedLineChart : BaseChart
{
protected override void DefaultChart()

View File

@@ -59,7 +59,12 @@ namespace XCharts.Runtime
/// Customize the minimum and maximum.
/// |自定义最小值最大值。
/// </summary>
Custom
Custom,
/// <summary>
/// [since("v3.7.0")]minimum - maximum, automatically calculate the appropriate values.
/// |[since("v3.7.0")]最小值-最大值。自动计算合适的值。
/// </summary>
MinMaxAuto,
}
/// <summary>
/// the position of axis in grid.

View File

@@ -393,9 +393,16 @@ namespace XCharts.Runtime
break;
case Axis.AxisMinMaxType.MinMax:
if (ceilRate != 0)
{
minValue = ChartHelper.GetMinCeilRate(minValue, ceilRate);
maxValue = ChartHelper.GetMaxCeilRate(maxValue, ceilRate);
}
break;
minValue = ceilRate != 0 ? ChartHelper.GetMinDivisibleValue(minValue, ceilRate) : minValue;
maxValue = ceilRate != 0 ? ChartHelper.GetMaxDivisibleValue(maxValue, ceilRate) : maxValue;
case Axis.AxisMinMaxType.MinMaxAuto:
minValue = needFormat ? ChartHelper.GetMinDivisibleValue(minValue, ceilRate) : minValue;
maxValue = needFormat ? ChartHelper.GetMaxDivisibleValue(maxValue, ceilRate) : maxValue;
break;
}
}

View File

@@ -81,7 +81,7 @@ namespace XCharts.Runtime
[SerializeField] private RangeMode m_RangeMode;
[SerializeField] private float m_Start;
[SerializeField] private float m_End;
[SerializeField] private int m_MinShowNum = 1;
[SerializeField] private int m_MinShowNum = 2;
[Range(1f, 20f)]
[SerializeField] private float m_ScrollSensitivity = 1.1f;
[SerializeField] private Orient m_Orient = Orient.Horizonal;

View File

@@ -347,9 +347,13 @@ namespace XCharts.Runtime
public virtual string GetFormatterContent(int labelIndex, double value, double minValue, double maxValue, bool isLog = false)
{
var newNumericFormatter = numericFormatter;
if (string.IsNullOrEmpty(newNumericFormatter) && !isLog)
if (value == 0)
{
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "0" : "f" + MathUtil.GetPrecision(maxValue);
newNumericFormatter = "f0";
}
else if (string.IsNullOrEmpty(newNumericFormatter) && !isLog)
{
newNumericFormatter = MathUtil.IsInteger(maxValue) ? "f0" : "f" + MathUtil.GetPrecision(maxValue);
}
if (string.IsNullOrEmpty(m_Formatter))
{

View File

@@ -11,6 +11,7 @@ namespace XCharts.Runtime
internal sealed class LegendHandler : MainComponentHandler<Legend>
{
private static readonly string s_LegendObjectName = "legend";
private static readonly char[] s_NameSplit = new char[] { '_' };
public override void InitComponent()
{
@@ -48,7 +49,7 @@ namespace XCharts.Runtime
private void InitLegend(Legend legend)
{
legend.painter = null;
legend.refreshComponent = delegate()
legend.refreshComponent = delegate ()
{
legend.OnChanged();
var legendObject = ChartHelper.AddObject(s_LegendObjectName + legend.index, chart.transform, chart.chartMinAnchor,
@@ -99,7 +100,7 @@ namespace XCharts.Runtime
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerDown, (data) =>
{
if (data.selectedObject == null || legend.selectedMode == Legend.SelectedMode.None) return;
var temp = data.selectedObject.name.Split('_');
var temp = data.selectedObject.name.Split(s_NameSplit, 2);
string selectedName = temp[1];
int clickedIndex = int.Parse(temp[0]);
if (legend.selectedMode == Legend.SelectedMode.Multiple)
@@ -117,7 +118,7 @@ namespace XCharts.Runtime
{
for (int n = 0; n < btnList.Length; n++)
{
temp = btnList[n].name.Split('_');
temp = btnList[n].name.Split(s_NameSplit, 2);
selectedName = btnList[n].legendName;
var index = btnList[n].index;
OnLegendButtonClick(legend, n, selectedName, index == clickedIndex ? true : false);
@@ -128,7 +129,7 @@ namespace XCharts.Runtime
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerEnter, (data) =>
{
if (item.button == null) return;
var temp = item.button.name.Split('_');
var temp = item.button.name.Split(s_NameSplit, 2);
string selectedName = temp[1];
int index = int.Parse(temp[0]);
OnLegendButtonEnter(legend, index, selectedName);
@@ -136,7 +137,7 @@ namespace XCharts.Runtime
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerExit, (data) =>
{
if (item.button == null) return;
var temp = item.button.name.Split('_');
var temp = item.button.name.Split(s_NameSplit, 2);
string selectedName = temp[1];
int index = int.Parse(temp[0]);
OnLegendButtonExit(legend, index, selectedName);
@@ -268,4 +269,4 @@ namespace XCharts.Runtime
}
}
}
}
}

View File

@@ -383,6 +383,7 @@ namespace XCharts.Runtime
angle = 2 * Mathf.PI / indicatorNum * (index + 0.5f);
break;
}
angle += startAngle * Mathf.PI / 180;
var x = context.center.x + (context.radius + indicatorGap) * Mathf.Sin(angle);
var y = context.center.y + (context.radius + indicatorGap) * Mathf.Cos(angle);
return new Vector3(x, y);
@@ -429,6 +430,13 @@ namespace XCharts.Runtime
return indicatorList[indicatorIndex];
}
public string GetIndicatorName(int indicatorIndex)
{
var indicator = GetIndicator(indicatorIndex);
if (indicator == null) return string.Empty;
return indicator.name;
}
public override void ClearData()
{
indicatorList.Clear();

View File

@@ -34,7 +34,7 @@ namespace XCharts.Runtime
private void InitTooltip(Tooltip tooltip)
{
tooltip.painter = chart.m_PainterUpper;
tooltip.refreshComponent = delegate()
tooltip.refreshComponent = delegate ()
{
var objName = ChartCached.GetComponentObjectName(tooltip);
tooltip.gameObject = ChartHelper.AddObject(objName, chart.transform, chart.chartMinAnchor,
@@ -193,7 +193,7 @@ namespace XCharts.Runtime
if (axis.IsCategory())
{
var index = (int) axis.context.pointerValue;
var index = (int)axis.context.pointerValue;
var category = axis.GetData(index);
label.SetText(axis.indicatorLabel.GetFormatterContent(index, category));
}
@@ -241,7 +241,7 @@ namespace XCharts.Runtime
else if (container is PolarCoord)
{
var m_AngleAxis = ComponentHelper.GetAngleAxis(chart.components, container.index);
tooltip.context.angle = (float) m_AngleAxis.context.pointerValue;
tooltip.context.angle = (float)m_AngleAxis.context.pointerValue;
}
list.Add(serie);
if (!isTriggerAxis)
@@ -267,7 +267,7 @@ namespace XCharts.Runtime
if (isTriggerAxis)
{
serie.context.pointerEnter = true;
serie.context.pointerAxisDataIndexs.Add((int) yAxis.context.pointerValue);
serie.context.pointerAxisDataIndexs.Add((int)yAxis.context.pointerValue);
yAxis.context.axisTooltipValue = yAxis.context.pointerValue;
}
}
@@ -283,7 +283,7 @@ namespace XCharts.Runtime
{
if (isTriggerAxis)
{
var index = serie.context.dataZoomStartIndex + (int) xAxis.context.pointerValue;
var index = serie.context.dataZoomStartIndex + (int)xAxis.context.pointerValue;
serie.context.pointerEnter = true;
serie.context.pointerAxisDataIndexs.Add(index);
serie.context.pointerItemDataIndex = index;
@@ -344,7 +344,7 @@ namespace XCharts.Runtime
var serieData = serie.data[i];
serie.context.sortedData.Add(serieData);
}
serie.context.sortedData.Sort(delegate(SerieData a, SerieData b)
serie.context.sortedData.Sort(delegate (SerieData a, SerieData b)
{
return a.GetData(dimension).CompareTo(b.GetData(dimension));
});
@@ -355,7 +355,7 @@ namespace XCharts.Runtime
{
var serieData = data[i];
currValue = serieData.GetData(dimension);
if (i == 0)
if (i == 0 && i + 1 < dataCount)
{
nextValue = data[i + 1].GetData(dimension);
if (axisValue <= currValue + (nextValue - currValue) / 2)
@@ -372,7 +372,7 @@ namespace XCharts.Runtime
break;
}
}
else
else if (i + 1 < dataCount)
{
nextValue = data[i + 1].GetData(dimension);
if (axisValue > (currValue - (currValue - lastValue) / 2) && axisValue <= currValue + (nextValue - currValue) / 2)
@@ -497,7 +497,7 @@ namespace XCharts.Runtime
var axis = component as Axis;
if (axis.gridIndex == gridIndex && axis.IsCategory())
{
dataIndex = axis.context.dataZoomStartIndex + (int) axis.context.pointerValue;
dataIndex = axis.context.dataZoomStartIndex + (int)axis.context.pointerValue;
category = axis.GetData(dataIndex);
return true;
}
@@ -558,7 +558,7 @@ namespace XCharts.Runtime
case Tooltip.Type.Line:
float pX = grid.context.x;
pX += xAxis.IsCategory() ?
(float) (xAxis.context.pointerValue * splitWidth + (xAxis.boundaryGap ? splitWidth / 2 : 0)) :
(float)(xAxis.context.pointerValue * splitWidth + (xAxis.boundaryGap ? splitWidth / 2 : 0)) :
xAxis.GetDistance(xAxis.context.axisTooltipValue, grid.context.width);
if (pX < grid.context.x)
break;
@@ -577,15 +577,15 @@ namespace XCharts.Runtime
if (xAxis.IsCategory() && !double.IsInfinity(xAxis.context.pointerValue))
{
float tooltipSplitWid = splitWidth < 1 ? 1 : splitWidth;
pX = (float) (grid.context.x + splitWidth * xAxis.context.pointerValue -
pX = (float)(grid.context.x + splitWidth * xAxis.context.pointerValue -
(xAxis.boundaryGap ? 0 : splitWidth / 2));
if (pX < grid.context.x)
break;
float pY = grid.context.y + grid.context.height;
Vector3 p1 = chart.ClampInGrid(grid,new Vector3(pX, grid.context.y));
Vector3 p2 = chart.ClampInGrid(grid,new Vector3(pX, pY));
Vector3 p3 = chart.ClampInGrid(grid,new Vector3(pX + tooltipSplitWid, pY));
Vector3 p4 = chart.ClampInGrid(grid,new Vector3(pX + tooltipSplitWid, grid.context.y));
Vector3 p1 = chart.ClampInGrid(grid, new Vector3(pX, grid.context.y));
Vector3 p2 = chart.ClampInGrid(grid, new Vector3(pX, pY));
Vector3 p3 = chart.ClampInGrid(grid, new Vector3(pX + tooltipSplitWid, pY));
Vector3 p4 = chart.ClampInGrid(grid, new Vector3(pX + tooltipSplitWid, grid.context.y));
var areaColor = TooltipHelper.GetLineColor(tooltip, chart.theme.tooltip.areaColor);
UGL.DrawQuadrilateral(vh, p1, p2, p3, p4, areaColor);
}
@@ -622,7 +622,7 @@ namespace XCharts.Runtime
{
case Tooltip.Type.Corss:
case Tooltip.Type.Line:
float pY = (float) (grid.context.y + yAxis.context.pointerValue * splitWidth +
float pY = (float)(grid.context.y + yAxis.context.pointerValue * splitWidth +
(yAxis.boundaryGap ? splitWidth / 2 : 0));
if (pY < grid.context.y)
break;
@@ -642,7 +642,7 @@ namespace XCharts.Runtime
{
float tooltipSplitWid = splitWidth < 1 ? 1 : splitWidth;
float pX = grid.context.x + grid.context.width;
pY = (float) (grid.context.y + splitWidth * yAxis.context.pointerValue -
pY = (float)(grid.context.y + splitWidth * yAxis.context.pointerValue -
(yAxis.boundaryGap ? 0 : splitWidth / 2));
if (pY < grid.context.y)
break;

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using XUGL;
@@ -132,14 +133,48 @@ namespace XCharts.Runtime
return Contains(pos.x, pos.y);
}
[Since("v3.7.0")]
public bool Contains(Vector3 pos, bool isYAxis)
{
return isYAxis ? ContainsY(pos.y) : ContainsX(pos.x);
}
public bool Contains(float x, float y)
{
if (x < context.x - 1 || x > context.x + context.width + 1 ||
y < context.y - 1 || y > context.y + context.height + 1)
{
return false;
}
return true;
return ContainsX(x) && ContainsY(y);
}
[Since("v3.7.0")]
public bool ContainsX(float x)
{
return x >= context.x && x <= context.x + context.width;
}
[Since("v3.7.0")]
public bool ContainsY(float y)
{
return y >= context.y && y <= context.y + context.height;
}
[Since("v3.7.0")]
public void Clamp(ref Vector3 pos)
{
ClampX(ref pos);
ClampY(ref pos);
}
[Since("v3.7.0")]
public void ClampX(ref Vector3 pos)
{
if (pos.x < context.x) pos.x = context.x;
else if (pos.x > context.x + context.width) pos.x = context.x + context.width;
}
[Since("v3.7.0")]
public void ClampY(ref Vector3 pos)
{
if (pos.y < context.y) pos.y = context.y;
else if (pos.y > context.y + context.height) pos.y = context.y + context.height;
}
/// <summary>
@@ -151,10 +186,15 @@ namespace XCharts.Runtime
public bool BoundaryPoint(Vector3 sp, Vector3 ep, ref Vector3 point)
{
if (Contains(sp) && Contains(ep))
{
point = ep;
return false;
}
if (sp.x < context.x && ep.x < context.x)
return false;
if (sp.x > context.x + context.width && ep.x > context.x + context.width)
return false;
if (sp.y < context.y && ep.y < context.y)
return false;
if (sp.y > context.y + context.height && ep.y > context.y + context.height)
return false;
var lb = new Vector3(context.x, context.y);
var lt = new Vector3(context.x, context.y + context.height);
var rt = new Vector3(context.x + context.width, context.y + context.height);
@@ -169,5 +209,31 @@ namespace XCharts.Runtime
return true;
return false;
}
/// <summary>
/// 给定的线段和Grid边界的交点
/// </summary>
/// <param name="sp"></param>
/// <param name="ep"></param>
/// <returns></returns>
public bool BoundaryPoint(Vector3 sp, Vector3 ep, ref List<Vector3> point)
{
if (Contains(sp) && Contains(ep))
return false;
var lb = new Vector3(context.x, context.y);
var lt = new Vector3(context.x, context.y + context.height);
var rt = new Vector3(context.x + context.width, context.y + context.height);
var rb = new Vector3(context.x + context.width, context.y);
var flag = false;
if (UGLHelper.GetIntersection(sp, ep, lb, lt, ref point))
flag = true;
if (UGLHelper.GetIntersection(sp, ep, lt, rt, ref point))
flag = true;
if (UGLHelper.GetIntersection(sp, ep, lb, rb, ref point))
flag = true;
if (UGLHelper.GetIntersection(sp, ep, rb, rt, ref point))
flag = true;
return flag;
}
}
}

View File

@@ -667,5 +667,64 @@ namespace XCharts.Runtime
SerieHelper.GetItemColor(out color, out toColor, serie, null, m_Theme);
return color;
}
/// <summary>
/// trigger tooltip by data index.
/// |尝试触发指定数据项的Tooltip.
/// </summary>
/// <param name="dataIndex">数据项索引</param>
/// <returns></returns>
[Since("v3.7.0")]
public bool TriggerTooltip(int dataIndex)
{
var serie = GetSerie(0);
if (serie == null) return false;
var dataPoints = serie.context.dataPoints;
var dataPoint = Vector3.zero;
if (dataPoints.Count == 0)
{
if (serie.dataCount == 0) return false;
dataIndex = dataIndex % serie.dataCount;
var serieData = serie.GetSerieData(dataIndex);
if (serieData == null) return false;
dataPoint = serie.GetSerieData(dataIndex).context.position;
}
else
{
dataIndex = dataIndex % dataPoints.Count;
dataPoint = dataPoints[dataIndex];
}
return TriggerTooltip(dataPoint);
}
/// <summary>
/// trigger tooltip by chart local position.
/// |在指定的位置尝试触发Tooltip.
/// </summary>
/// <param name="localPosition"></param>
/// <returns></returns>
[Since("v3.7.0")]
public bool TriggerTooltip(Vector3 localPosition)
{
var screenPoint = LocalPointToScreenPoint(localPosition);
var eventData = new PointerEventData(EventSystem.current);
eventData.position = screenPoint;
OnPointerEnter(eventData);
return true;
}
/// <summary>
/// cancel tooltip.
/// |取消Tooltip.
/// </summary>
[Since("v3.7.0")]
public void CancelTooltip()
{
var tooltip = GetChartComponent<Tooltip>();
if (tooltip != null)
{
tooltip.SetActive(false);
}
}
}
}

View File

@@ -72,6 +72,7 @@ namespace XCharts.Runtime
CreateComponentHandler(component);
#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER
UnityEditor.EditorUtility.SetDirty(this);
OnBeforeSerialize();
#endif
return component;
}
@@ -88,6 +89,7 @@ namespace XCharts.Runtime
}
component.index = list.Count;
list.Add(component);
m_Components.Sort((a, b) => { return a.GetType().Name.CompareTo(b.GetType().Name); });
}
private void CheckAddRequireChartComponent(Type type)
@@ -179,6 +181,10 @@ namespace XCharts.Runtime
{
if (component.gameObject != null)
ChartHelper.SetActive(component.gameObject, false);
#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER
UnityEditor.EditorUtility.SetDirty(this);
OnBeforeSerialize();
#endif
InitComponentHandlers();
RefreshChart();
return true;

View File

@@ -11,7 +11,7 @@ namespace XCharts.Runtime
{
[AddComponentMenu("XCharts/EmptyChart", 10)]
[ExecuteInEditMode]
[RequireComponent(typeof(RectTransform),typeof(CanvasRenderer))]
[RequireComponent(typeof(RectTransform), typeof(CanvasRenderer))]
[DisallowMultipleComponent]
public partial class BaseChart : BaseGraph, ISerializationCallbackReceiver
{
@@ -131,7 +131,7 @@ namespace XCharts.Runtime
{
if (m_Settings == null)
m_Settings = Settings.DefaultSettings;
CheckTheme();
CheckTheme(true);
base.Awake();
InitComponentHandlers();
InitSerieHandlers();
@@ -244,12 +244,16 @@ namespace XCharts.Runtime
painter.SetActive(flag, m_DebugInfo.showAllChartObject);
}
protected virtual void CheckTheme()
protected virtual void CheckTheme(bool firstInit = false)
{
if (m_Theme.sharedTheme == null)
{
m_Theme.sharedTheme = XCThemeMgr.GetTheme(ThemeType.Default);
}
if (firstInit)
{
m_CheckTheme = m_Theme.themeType;
}
if (m_Theme.sharedTheme != null && m_CheckTheme != m_Theme.themeType)
{
m_CheckTheme = m_Theme.themeType;

View File

@@ -173,6 +173,32 @@ namespace XCharts.Runtime
return true;
}
/// <summary>
/// chart local point to screen point.
/// |图表内坐标转屏幕坐标。
/// </summary>
/// <param name="localPoint">图表内的坐标</param>
/// <returns>屏幕坐标</returns>
[Since("v3.7.0")]
public Vector2 LocalPointToScreenPoint(Vector2 localPoint)
{
var cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera;
var wordPoint = rectTransform.TransformPoint(localPoint);
return RectTransformUtility.WorldToScreenPoint(cam, wordPoint);
}
/// <summary>
/// chart local point to world point.
/// |图表内坐标转世界坐标。
/// </summary>
/// <param name="localPoint">图表内的坐标</param>
/// <returns>世界坐标</returns>
[Since("v3.7.0")]
public Vector2 LocalPointToWorldPoint(Vector2 localPoint)
{
return rectTransform.TransformPoint(localPoint);
}
/// <summary>
/// 保存图表为图片。
/// </summary>

View File

@@ -521,7 +521,7 @@ namespace XCharts.Runtime
{
Vector3 dir = (ep - sp).normalized;
float dist = Vector3.Distance(sp, ep);
int segment = (int) (dist / k);
int segment = (int)(dist / k);
posList.Clear();
posList.Add(sp);
for (int i = 1; i < segment; i++)
@@ -676,7 +676,7 @@ namespace XCharts.Runtime
{
Color color;
ColorUtility.TryParseHtmlString(hexColorStr, out color);
return (Color32) color;
return (Color32)color;
}
public static double GetMaxDivisibleValue(double max, double ceilRate)
@@ -685,15 +685,16 @@ namespace XCharts.Runtime
if (max > -1 && max < 1)
{
int count = 1;
int intvalue = (int) (max * Mathf.Pow(10, count));
int intvalue = (int)(max * Mathf.Pow(10, count));
while (intvalue == 0 && count < 12)
{
count++;
intvalue = (int) (max * Mathf.Pow(10, count));
intvalue = (int)(max * Mathf.Pow(10, count));
}
var pow = Mathf.Pow(10, count);
if (max > 0) return (int) ((max * pow + 1)) / pow;
else return (int) ((max * pow - 1)) / pow;
var value = max > 0 ? (int)((max * (pow + 1))) / pow :
(int)((max * (pow - 1))) / pow;
return GetMaxCeilRate(value, ceilRate);
}
if (ceilRate == 0)
{
@@ -723,27 +724,42 @@ namespace XCharts.Runtime
}
else
{
var mod = max % ceilRate;
int rate = (int) (max / ceilRate);
return mod == 0 ? max : (max < 0 ? rate : rate + 1) * ceilRate;
return GetMaxCeilRate(max, ceilRate);
}
}
public static double GetMaxCeilRate(double value, double ceilRate)
{
if (ceilRate == 0) return value;
var mod = value % ceilRate;
int rate = (int)(value / ceilRate);
return mod == 0 ? value : (value < 0 ? rate : rate + 1) * ceilRate;
}
public static double GetMinCeilRate(double value, double ceilRate)
{
if (ceilRate == 0) return value;
var mod = value % ceilRate;
int rate = (int)(value / ceilRate);
return mod == 0 ? value : (value < 0 ? rate - 1 : rate) * ceilRate;
}
public static double GetMinDivisibleValue(double min, double ceilRate)
{
if (min == 0) return 0;
if (min > -1 && min < 1)
{
int count = 1;
int intvalue = (int) (min * Mathf.Pow(10, count));
int intvalue = (int)(min * Mathf.Pow(10, count));
while (intvalue == 0 && count < 12)
{
count++;
intvalue = (int) (min * Mathf.Pow(10, count));
intvalue = (int)(min * Mathf.Pow(10, count));
}
var pow = Mathf.Pow(10, count);
if (min > 0) return (int) ((min * pow + 1)) / pow;
else return (int) ((min * pow - 1)) / pow;
var value = min > 0 ? ((int)(min * (pow - 1))) / pow :
((int)(min * (pow + 1))) / pow;
return GetMinCeilRate(value, ceilRate);
}
if (ceilRate == 0)
{
@@ -764,9 +780,7 @@ namespace XCharts.Runtime
}
else
{
var mod = min % ceilRate;
int rate = (int) (min / ceilRate);
return mod == 0 ? min : (min < 0 ? rate - 1 : rate) * ceilRate;
return GetMinCeilRate(min, ceilRate);
}
}
@@ -810,8 +824,6 @@ namespace XCharts.Runtime
return min;
}
public static void AddEventListener(GameObject obj, EventTriggerType type,
UnityEngine.Events.UnityAction<BaseEventData> call)
{
@@ -902,32 +914,32 @@ namespace XCharts.Runtime
{
if (color.a != 0 && opacity != 1)
{
color.a = (byte) (color.a * opacity);
color.a = (byte)(color.a * opacity);
}
}
public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)
{
var newColor = color;
newColor.r = (byte) (color.r * rate);
newColor.g = (byte) (color.g * rate);
newColor.b = (byte) (color.b * rate);
newColor.r = (byte)(color.r * rate);
newColor.g = (byte)(color.g * rate);
newColor.b = (byte)(color.b * rate);
return newColor;
}
public static Color32 GetBlurColor(Color32 color, float a = 0.3f)
{
var newColor = color;
newColor.a = (byte) (a * 255);
newColor.a = (byte)(a * 255);
return newColor;
}
public static Color32 GetSelectColor(Color32 color, float rate = 0.8f)
{
var newColor = color;
newColor.r = (byte) (color.r * rate);
newColor.g = (byte) (color.g * rate);
newColor.b = (byte) (color.b * rate);
newColor.r = (byte)(color.r * rate);
newColor.g = (byte)(color.g * rate);
newColor.b = (byte)(color.b * rate);
return newColor;
}
@@ -977,7 +989,7 @@ namespace XCharts.Runtime
var posX = pos.x + rectTransform.rect.xMin * canvas.scaleFactor;
var posY = pos.y + rectTransform.rect.yMin * canvas.scaleFactor;
var rect = new Rect(posX, posY, width, height);
var tex = new Texture2D((int) width, (int) height, TextureFormat.RGBA32, false);
var tex = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, false);
tex.ReadPixels(rect, 0, 0);
tex.Apply();
byte[] bytes;

View File

@@ -39,6 +39,8 @@ namespace XCharts.Runtime
public static bool IsInteger(double value)
{
if (value == 0) return true;
if (value >= -1 && value <= 1) return false;
return Math.Abs(value % 1) <= (Double.Epsilon * 100);
}

View File

@@ -21,8 +21,8 @@ namespace XCharts.Runtime
[ExecuteInEditMode]
public static class XChartsMgr
{
public static readonly string version = "3.6.0";
public static readonly int versionDate = 20230401;
public static readonly string version = "3.7.0";
public static readonly int versionDate = 20230601;
public static string fullVersion { get { return version + "-" + versionDate; } }
internal static List<BaseChart> chartList = new List<BaseChart>();

View File

@@ -276,11 +276,13 @@ namespace XCharts.Runtime
return;
var axisLength = isY ? m_SerieGrid.context.height : m_SerieGrid.context.width;
var scaleWid = AxisHelper.GetDataWidth(axis, axisLength, showData.Count, dataZoom);
int maxCount = serie.maxShow > 0 ?
(serie.maxShow > showData.Count ? showData.Count : serie.maxShow) :
showData.Count;
maxCount -= serie.context.dataZoomStartIndexOffset;
var scaleWid = AxisHelper.GetDataWidth(axis, axisLength, maxCount, dataZoom);
int rate = LineHelper.GetDataAverageRate(serie, m_SerieGrid, maxCount, false);
var totalAverage = serie.sampleAverage > 0 ?
serie.sampleAverage :
@@ -304,9 +306,10 @@ namespace XCharts.Runtime
SeriesHelper.UpdateStackDataList(chart.series, serie, dataZoom, m_StackSerieData);
}
var lp = Vector3.zero;
for (int i = serie.minShow; i < maxCount; i += rate)
for (int i = serie.minShow; i < showData.Count; i += rate)
{
var serieData = showData[i];
var realIndex = i - serie.context.dataZoomStartIndexOffset;
var isIgnore = serie.IsIgnoreValue(serieData);
if (isIgnore)
{
@@ -320,7 +323,7 @@ namespace XCharts.Runtime
else
{
var np = Vector3.zero;
var xValue = axis.IsCategory() ? i : serieData.GetData(0, axis.inverse);
var xValue = axis.IsCategory() ? realIndex : serieData.GetData(0, axis.inverse);
var relativedValue = DataHelper.SampleValue(ref showData, serie.sampleType, rate, serie.minShow,
maxCount, totalAverage, i, dataChangeDuration, ref dataChanging, relativedAxis, unscaledTime);
@@ -329,7 +332,7 @@ namespace XCharts.Runtime
serieData.context.isClip = false;
if (serie.clip && !m_SerieGrid.Contains(np))
{
if (m_SerieGrid.BoundaryPoint(lp, np, ref np))
//if (m_SerieGrid.BoundaryPoint(lp, np, ref np))
{
serieData.context.isClip = true;
}

View File

@@ -15,7 +15,7 @@ namespace XCharts.Runtime
var rate = 0;
var width = isYAxis ? grid.context.height : grid.context.width;
if (sampleDist > 0)
rate = (int) ((maxCount - serie.minShow) / (width / sampleDist));
rate = (int)((maxCount - serie.minShow) / (width / sampleDist));
if (rate < 1)
rate = 1;
return rate;
@@ -86,8 +86,13 @@ namespace XCharts.Runtime
var lastDataIsIgnore = false;
for (int i = 0; i < points.Count; i++)
{
var tp = points[i].position;
var isIgnore = points[i].isIgnoreBreak;
var pdata = points[i];
var tp = pdata.position;
if (serie.clip)
{
grid.Clamp(ref tp);
}
var isIgnore = pdata.isIgnoreBreak;
var color = areaColor;
var toColor = areaToColor;
var lerp = areaLerp;
@@ -281,6 +286,7 @@ namespace XCharts.Runtime
var lastDataIsIgnore = datas[0].isIgnoreBreak;
var smooth = serie.lineType == LineType.Smooth;
var firstInGridPointIndex = serie.clip ? -1 : 1;
for (int i = 1; i < dataCount; i++)
{
var cdata = datas[i];
@@ -299,8 +305,16 @@ namespace XCharts.Runtime
}
serie.context.lineEndPostion = cp;
serie.context.lineEndValue = AxisHelper.GetAxisPositionValue(grid, relativedAxis, cp);
var handled = false;
var isClip = false;
if (serie.clip)
{
if (!grid.Contains(cp))
isClip = true;
else if (firstInGridPointIndex <= 0)
firstInGridPointIndex = i;
if (isClip) isIgnore = true;
}
if (!smooth)
{
switch (serie.lineStyle.type)
@@ -341,8 +355,10 @@ namespace XCharts.Runtime
ref itp, ref ibp,
ref clp, ref crp,
ref bitp, ref bibp, i);
if (i == 1)
{
if (isClip) lastDataIsIgnore = true;
AddLineVertToVertexHelper(vh, ltp, lbp, lineColor, isVisualMapGradient, isLineStyleGradient,
visualMap, serie.lineStyle, grid, axis, relativedAxis, false, lastDataIsIgnore, isIgnore);
if (dataCount == 2 || isBreak)
@@ -460,7 +476,7 @@ namespace XCharts.Runtime
private static void UpdateNormalLineDrawPoints(Serie serie, Settings setting, VisualMap visualMap)
{
var isVisualMapGradient = VisualMapHelper.IsNeedGradient(visualMap);
if (isVisualMapGradient)
if (isVisualMapGradient || serie.clip)
{
var dataPoints = serie.context.dataPoints;
if (dataPoints.Count > 1)
@@ -473,7 +489,7 @@ namespace XCharts.Runtime
var dir = (ep - sp).normalized;
var dist = Vector3.Distance(sp, ep);
var segment = (int) (dist / setting.lineSegmentDistance);
var segment = (int)(dist / setting.lineSegmentDistance);
serie.context.drawPoints.Add(new PointInfo(sp, ignore));
for (int j = 1; j < segment; j++)
{

View File

@@ -233,10 +233,12 @@ namespace XCharts.Runtime
serieData.context.currentAngle = serieData.context.toAngle;
}
var halfDegree = (serieData.context.toAngle - startDegree) / 2;
var halfRadius = serie.context.insideRadius + (serieData.context.outsideRadius - serie.context.insideRadius) / 2;
serieData.context.halfAngle = startDegree + halfDegree;
serieData.context.angle = startDegree + halfDegree;
serieData.context.offsetCenter = serie.context.center;
serieData.context.insideRadius = serie.context.insideRadius;
serieData.context.position = ChartHelper.GetPosition(serie.context.center, serieData.context.halfAngle, halfRadius);
if (offset > 0)
{
var currRad = serieData.context.halfAngle * Mathf.Deg2Rad;

View File

@@ -38,18 +38,19 @@ namespace XCharts.Runtime
if (dataIndex < 0)
return;
var radar = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
if (radar == null)
return;
if (serie.radarType == RadarType.Single)
{
var colorIndex1 = serie.colorByData ? dataIndex : serie.context.colorIndex;
category = radar.GetIndicatorName(dataIndex);
UpdateItemSerieParams(ref paramList, ref title, dataIndex, category,
marker, itemFormatter, numericFormatter, ignoreDataDefaultContent, 1, colorIndex1);
return;
}
var radar = chart.GetChartComponent<RadarCoord>(serie.radarIndex);
if (radar == null)
return;
var serieData = serie.GetSerieData(dataIndex);
if (serieData == null)
return;
@@ -72,6 +73,7 @@ namespace XCharts.Runtime
param.value = serieData.GetData(i);
param.total = indicator.max;
param.color = color;
param.category = radar.GetIndicatorName(i);
param.marker = SerieHelper.GetItemMarker(serie, serieData, marker);
param.itemFormatter = SerieHelper.GetItemFormatter(serie, serieData, itemFormatter);
param.numericFormatter = SerieHelper.GetNumericFormatter(serie, serieData, numericFormatter);

View File

@@ -6,7 +6,7 @@ namespace XCharts.Runtime
{
/// <summary>
/// Whether to show as Nightingale chart, which distinguishs data through radius.
/// 是否展示成南丁格尔图,通过半径区分数据大小。
/// |是否展示成南丁格尔图,通过半径区分数据大小。
/// </summary>
public enum RoseType
{
@@ -61,7 +61,8 @@ namespace XCharts.Runtime
}
/// <summary>
/// the type of bar. |柱状图类型。
/// the type of bar.
/// |柱状图类型。
/// </summary>
public enum BarType
{
@@ -83,7 +84,8 @@ namespace XCharts.Runtime
}
/// <summary>
/// the type of radar. |雷达图类型。
/// the type of radar.
/// |雷达图类型。
/// </summary>
public enum RadarType
{
@@ -100,7 +102,8 @@ namespace XCharts.Runtime
}
/// <summary>
/// 采样类型
/// sample type of line chart.
/// |采样类型,一般用于折线图。
/// </summary>
public enum SampleType
{
@@ -133,26 +136,31 @@ namespace XCharts.Runtime
}
/// <summary>
/// 数据排序方式
/// the sort type of serie data.
/// |数据排序方式。
/// </summary>
public enum SerieDataSortType
{
/// <summary>
/// data 的顺序
/// In the order of data.
/// |按数据的顺序。
/// </summary>
None,
/// <summary>
/// 升序
/// Sort data in ascending order.
/// |升序。
/// </summary>
Ascending,
/// <summary>
/// 降序
/// Sort data in descending order.
/// |降序。
/// </summary>
Descending,
}
/// <summary>
/// 对齐方式
/// Alignment mode.
/// |对齐方式。文本,图标,图形等的对齐方式。
/// </summary>
public enum Align
{
@@ -202,23 +210,23 @@ namespace XCharts.Runtime
{
/// <summary>
/// Select state.
/// |默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略Pie默认是Data策略
/// |默认策略。每种Serie都有自己的默认的取颜色策略。比如Line默认是Series策略Pie默认是Data策略
/// </summary>
Default,
/// <summary>
/// assigns the colors in the palette by serie, so that all data in the same series are in the same color;.
/// assigns the colors in the palette by serie, so that all data in the same series are in the same color.
/// |按照系列分配调色盘中的颜色,同一系列中的所有数据都是用相同的颜色。
/// </summary>
Serie,
/// <summary>
/// assigns colors in the palette according to data items, with each data item using a different color..
/// assigns colors in the palette according to data items, with each data item using a different color.
/// |按照数据项分配调色盘中的颜色,每个数据项都使用不同的颜色。
/// </summary>
Data
}
/// <summary>
/// 系列。
/// 系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。
/// </summary>
[System.Serializable]
public partial class Serie : BaseSerie, IComparable
@@ -839,7 +847,8 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_Large, value)) SetAllDirty(); }
}
/// <summary>
/// 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
/// Turn on the threshold for mass optimization. Enter performance mode only when large is enabled and the amount of data is greater than the threshold.
/// |开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
/// </summary>
public int largeThreshold
{
@@ -847,7 +856,8 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_LargeThreshold, value)) SetAllDirty(); }
}
/// <summary>
/// 在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
/// If the pie chart and labels are displayed externally, whether to enable the label overlap prevention policy is disabled by default. If labels are crowded and overlapped, the positions of labels are moved to prevent label overlap.
/// |在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
/// </summary>
public bool avoidLabelOverlap
{

View File

@@ -35,6 +35,7 @@ namespace XCharts.Runtime
public List<int> pointerAxisDataIndexs = new List<int>();
public bool isTriggerByAxis = false;
public int dataZoomStartIndex = 0;
public int dataZoomStartIndexOffset = 0;
/// <summary>
/// 中心点

View File

@@ -421,6 +421,7 @@ namespace XCharts.Runtime
currLabel != null &&
currLabel.show &&
serieData.context.canShowLabel &&
!serieData.context.isClip &&
!isIgnore)
{
if (serie.multiDimensionLabel)

View File

@@ -760,14 +760,19 @@ namespace XCharts.Runtime
}
}
private static List<SerieData> emptyFilter = new List<SerieData>();
/// <summary>
/// 根据dataZoom更新数据列表缓存
/// </summary>
/// <param name="dataZoom"></param>
public static void UpdateFilterData(Serie serie, DataZoom dataZoom)
{
if (dataZoom == null || !dataZoom.enable) return;
if (dataZoom == null || !dataZoom.enable)
{
serie.m_NeedUpdateFilterData = true;
serie.context.dataZoomStartIndex = 0;
serie.context.dataZoomStartIndexOffset = 0;
return;
}
if (dataZoom.IsContainsXAxis(serie.xAxisIndex))
{
if (dataZoom.IsXAxisIndexValue(serie.xAxisIndex))
@@ -822,7 +827,10 @@ namespace XCharts.Runtime
}
else if (endValue == 0)
{
serie.m_FilterData = emptyFilter;
if (serie.m_FilterData == null)
serie.m_FilterData = new List<SerieData>();
else if (serie.m_FilterData.Count > 0)
serie.m_FilterData.Clear();
}
}
@@ -863,24 +871,54 @@ namespace XCharts.Runtime
if (start >= 0)
{
serie.context.dataZoomStartIndex = start;
serie.context.dataZoomStartIndexOffset = 0;
serie.m_FilterData = data.GetRange(start, range);
var nowCount = serie.m_FilterData.Count;
if (nowCount > 0)
{
if (serie.IsIgnoreValue(serie.m_FilterData[nowCount - 1]))
{
for (int i = start + range; i < data.Count; i++)
{
serie.m_FilterData.Add(data[i]);
if (!serie.IsIgnoreValue(data[i]))
break;
}
}
if (serie.IsIgnoreValue(serie.m_FilterData[0]))
{
for (int i = start - 1; i >= 0; i--)
{
serie.m_FilterData.Insert(0, data[i]);
serie.context.dataZoomStartIndexOffset++;
if (!serie.IsIgnoreValue(data[i]))
break;
}
}
}
}
else
{
serie.context.dataZoomStartIndex = 0;
serie.context.dataZoomStartIndexOffset = 0;
serie.m_FilterData = data;
}
}
else
{
serie.context.dataZoomStartIndex = 0;
serie.context.dataZoomStartIndexOffset = 0;
serie.m_FilterData = data;
}
}
else if (end == 0)
{
serie.context.dataZoomStartIndex = 0;
serie.m_FilterData = emptyFilter;
serie.context.dataZoomStartIndexOffset = 0;
if (serie.m_FilterData == null)
serie.m_FilterData = new List<SerieData>();
else if (serie.m_FilterData.Count > 0)
serie.m_FilterData.Clear();
}
}

View File

@@ -133,8 +133,8 @@ namespace XUGL
cp2 = ep - (nep - sp).normalized * diff;
if (limit) cp2.y = ep.y;
}
int segment = (int) (dist / (smoothness <= 0 ? 2f : smoothness));
if (segment < 1) segment = (int) (dist / 0.5f);
int segment = (int)(dist / (smoothness <= 0 ? 2f : smoothness));
if (segment < 1) segment = (int)(dist / 0.5f);
if (segment < 4) segment = 4;
GetBezierList2(ref posList, sp, ep, segment, cp1, cp2);
if (posList.Count < 2)
@@ -154,7 +154,7 @@ namespace XUGL
Vector3 cp2 = sp + dist / k * dir * (k - 1);
cp1.x = sp.x;
cp2.x = ep.x;
int segment = (int) (dist / (smoothness <= 0 ? 2f : smoothness));
int segment = (int)(dist / (smoothness <= 0 ? 2f : smoothness));
GetBezierList2(ref posList, sp, ep, segment, cp1, cp2);
if (posList.Count < 2)
{
@@ -169,7 +169,7 @@ namespace XUGL
List<Vector3> list = new List<Vector3>();
for (int i = 0; i < segment; i++)
{
list.Add(GetBezier(i / (float) segment, sp, cp, ep));
list.Add(GetBezier(i / (float)segment, sp, cp, ep));
}
list.Add(ep);
return list;
@@ -185,7 +185,7 @@ namespace XUGL
}
for (int i = 0; i < segment; i++)
{
posList.Add((GetBezier2(i / (float) segment, sp, cp, cp2, ep)));
posList.Add((GetBezier2(i / (float)segment, sp, cp, cp2, ep)));
}
posList.Add(ep);
}
@@ -255,12 +255,10 @@ namespace XUGL
/// <param name="p2">线段1终点</param>
/// <param name="p3">线段2起点</param>
/// <param name="p4">线段2终点</param>
/// <param name="intersection">相交点。当不交时默认为 Vector3.zero </param>
/// <param name="intersection">相交点。当不交时为初始值</param>
/// <returns>相交则返回 true, 否则返回 false</returns>
public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref Vector3 intersection)
{
intersection = Vector3.zero;
var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x);
if (d == 0)
return false;
@@ -275,6 +273,30 @@ namespace XUGL
return true;
}
/// <summary>
/// 获得两直线的交点
/// </summary>
/// <param name="p1">线段1起点</param>
/// <param name="p2">线段1终点</param>
/// <param name="p3">线段2起点</param>
/// <param name="p4">线段2终点</param>
/// <param name="intersection">相交点。当不相交时为初始值</param>
/// <returns>相交则返回 true, 否则返回 false</returns>
public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref List<Vector3> intersection)
{
var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x);
if (d == 0)
return false;
var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d;
var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d;
if (u < 0 || u > 1 || v < 0 || v > 1)
return false;
intersection.Add(new Vector3(p1.x + u * (p2.x - p1.x), p1.y + u * (p2.y - p1.y)));
return true;
}
/// <summary>
/// 三个点画线段所需要的六个关键点
/// </summary>
@@ -317,8 +339,8 @@ namespace XUGL
if (Vector3.Cross(dir1, dir2) == Vector3.zero && np != cp)
{
itp = ntp;
ibp = nbp;
itp = clp;
ibp = crp;
return;
}

View File

@@ -1,9 +1,9 @@
{
"name": "com.monitor1394.xcharts",
"displayName": "XCharts",
"version": "3.6.0",
"date": "20230401",
"checkdate": "20230401",
"version": "3.7.0",
"date": "20230601",
"checkdate": "20230601",
"desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!",
"unity": "2018.3",
"description": "A charting and data visualization library for Unity.",