From 9c069296edf5ca96a03b00ef129cb5040494d6a1 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 13 Feb 2023 07:22:07 +0800 Subject: [PATCH] update doc --- Documentation~/en/api.md | 77 +++++++++++++++-------------- Documentation~/en/configuration.md | 20 ++++---- Documentation~/en/tutorial01.md | 20 ++++---- Documentation~/zh/api.md | 79 +++++++++++++++--------------- Documentation~/zh/changelog.md | 3 +- Documentation~/zh/configuration.md | 24 ++++----- Documentation~/zh/faq.md | 2 +- Documentation~/zh/support.md | 3 +- Documentation~/zh/tutorial01.md | 22 ++++----- README.md | 2 +- 10 files changed, 128 insertions(+), 124 deletions(-) diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index c0b4c566..599a6f46 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -27,9 +27,9 @@ slug: /api |[PieChart](#piechart)|[PolarChart](#polarchart)|[PolarCoordContext](#polarcoordcontext)| |[PropertyUtil](#propertyutil)|[RadarChart](#radarchart)|[RadarCoordContext](#radarcoordcontext)| |[ReflectionUtil](#reflectionutil)|[RequireChartComponentAttribute](#requirechartcomponentattribute)|[RingChart](#ringchart)| -|[RuntimeUtil](#runtimeutil)|[ScatterChart](#scatterchart)|[SerieContext](#seriecontext)| -|[SerieConvertAttribute](#serieconvertattribute)|[SerieDataContext](#seriedatacontext)|[SerieDataExtraComponentAttribute](#seriedataextracomponentattribute)| -|[SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)|[SerieExtraComponentAttribute](#serieextracomponentattribute)|[SerieHandler](#seriehandler)| +|[RuntimeUtil](#runtimeutil)|[ScatterChart](#scatterchart)|[SerieComponentAttribute](#seriecomponentattribute)| +|[SerieContext](#seriecontext)|[SerieConvertAttribute](#serieconvertattribute)|[SerieDataComponentAttribute](#seriedatacomponentattribute)| +|[SerieDataContext](#seriedatacontext)|[SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)|[SerieHandler](#seriehandler)| |[SerieHandler<T>](#seriehandlert)|[SerieHandlerAttribute](#seriehandlerattribute)|[SerieHelper](#seriehelper)| |[SerieLabelHelper](#serielabelhelper)|[SerieLabelPool](#serielabelpool)|[SerieParams](#serieparams)| |[SeriesHelper](#serieshelper)|[SimplifiedBarChart](#simplifiedbarchart)|[SimplifiedCandlestickChart](#simplifiedcandlestickchart)| @@ -133,7 +133,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver | ConvertSerie() |public bool ConvertSerie(Serie serie, Type type)| | ConvertSerie<T>() |public bool ConvertSerie<T>(Serie serie) where T : Serie| | ConvertXYAxis() |public void ConvertXYAxis(int index)
转换X轴和Y轴的配置 | -| EnsureChartComponent<T>() |public T EnsureChartComponent<T>() where T : MainComponent| +| EnsureChartComponent<T>() |public T EnsureChartComponent<T>() where T : MainComponent
Ensure the chart has the component, if not, add it. Note: it may fail to add. | | GenerateDefaultSerieName() |public string GenerateDefaultSerieName()| | GetAllSerieDataCount() |public int GetAllSerieDataCount()| | GetChartBackgroundColor() |public Color32 GetChartBackgroundColor()| @@ -321,7 +321,6 @@ Inherits or Implemented: [BaseChart](#basechart) | GetBlurColor() |public static Color32 GetBlurColor(Color32 color, float a = 0.3f)| | GetColor() |public static Color32 GetColor(string hexColorStr)| | GetDire() |public static Vector3 GetDire(float angle, bool isDegree = false)| -| GetFloatAccuracy() |public static int GetFloatAccuracy(double value)| | GetFullName() |public static string GetFullName(Transform transform)| | GetHighlightColor() |public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)| | GetLastValue() |public static Vector3 GetLastValue(List<Vector3> list)| @@ -635,6 +634,8 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler) | Approximately() |public static bool Approximately(double a, double b)| | Clamp() |public static double Clamp(double d, double min, double max)| | Clamp01() |public static double Clamp01(double value)| +| GetPrecision() |public static int GetPrecision(double value)| +| IsInteger() |public static bool IsInteger(double value)| | Lerp() |public static double Lerp(double a, double b, double t)| ## ObjectPool<T> where T @@ -737,6 +738,23 @@ Inherits or Implemented: [BaseChart](#basechart) Inherits or Implemented: [BaseChart](#basechart) +## SerieComponentAttribute + +Inherits or Implemented: [Attribute](#attribute) + +|public method|description| +|--|--| +| Contains() |public bool Contains(Type type)| +| Contains<T>() |public bool Contains<T>() where T : ISerieComponent| +| SerieComponentAttribute() |public SerieComponentAttribute()| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| + ## SerieContext ## SerieConvertAttribute @@ -752,28 +770,28 @@ Inherits or Implemented: [Attribute](#attribute) | SerieConvertAttribute() |public SerieConvertAttribute(Type serie, Type serie2, Type serie3)| | SerieConvertAttribute() |public SerieConvertAttribute(Type serie, Type serie2, Type serie3, Type serie4)| -## SerieDataContext - -|public method|description| -|--|--| -| Reset() |public void Reset()| - -## SerieDataExtraComponentAttribute +## SerieDataComponentAttribute Inherits or Implemented: [Attribute](#attribute) |public method|description| |--|--| | Contains() |public bool Contains(Type type)| -| Contains<T>() |public bool Contains<T>() where T : ISerieExtraComponent| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute()| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| +| Contains<T>() |public bool Contains<T>() where T : ISerieComponent| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute()| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| + +## SerieDataContext + +|public method|description| +|--|--| +| Reset() |public void Reset()| ## SerieDataExtraFieldAttribute @@ -791,23 +809,6 @@ Inherits or Implemented: [Attribute](#attribute) | SerieDataExtraFieldAttribute() |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)| | SerieDataExtraFieldAttribute() |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)| -## SerieExtraComponentAttribute - -Inherits or Implemented: [Attribute](#attribute) - -|public method|description| -|--|--| -| Contains() |public bool Contains(Type type)| -| Contains<T>() |public bool Contains<T>() where T : ISerieExtraComponent| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute()| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| - ## SerieHandler |public method|description| diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 7fcdb2c7..07e4b56b 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -54,7 +54,7 @@ slug: /configuration |[TitleStyle](#titlestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapRange](#visualmaprange)| |[VisualMapTheme](#visualmaptheme)| -## ISerieExtraComponent +## ISerieComponent ||||| |--|--|--|--| @@ -116,7 +116,7 @@ the animation of serie. ## AreaStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) The style of area. @@ -355,7 +355,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai ## BlurStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > Since `v3.2.0` @@ -508,7 +508,7 @@ Inherits or Implemented: [BaseScatter](#basescatter) ## EmphasisStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > Since `v3.2.0` @@ -570,7 +570,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent) ## ImageStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) |field|default|since|comment| |--|--|--|--| @@ -643,7 +643,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent] ## LabelLine -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) 标签的引导线 @@ -662,7 +662,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent ## LabelStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) Text label of chart, to explain some data information about graphic item like value, name and so on. @@ -757,7 +757,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai ## LineArrow -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent) |field|default|since|comment| |--|--|--|--| @@ -990,7 +990,7 @@ Inherits or Implemented: [BaseScatter](#basescatter) ## SelectStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > Since `v3.2.0` @@ -1344,7 +1344,7 @@ Title component, including main title and subtitle. ## TitleStyle -Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieExtraComponent](#iserieextracomponent) +Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent) the title of serie. diff --git a/Documentation~/en/tutorial01.md b/Documentation~/en/tutorial01.md index 64080abf..621a4e0d 100644 --- a/Documentation~/en/tutorial01.md +++ b/Documentation~/en/tutorial01.md @@ -100,29 +100,29 @@ chart.SetSize(580, 300);//代码动态设置尺寸,或直接操作chart.rectTr 设置标题: ```C# -var title = chart.GetOrAddChartComponent(); +var title = chart.EnsureChartComponent<Title>(); title.text = "Simple Line"; ``` 设置提示框和图例是否显示: ```C# -var tooltip = chart.GetOrAddChartComponent<Tooltip>(); +var tooltip = chart.EnsureChartComponent<Tooltip>(); tooltip.show = true; -var legend = chart.GetOrAddChartComponent<Legend>(); +var legend = chart.EnsureChartComponent<Legend>(); legend.show = false; ``` 设置坐标轴: ```C# -var xAxis = chart.GetOrAddChartComponent<XAxis>(); +var xAxis = chart.EnsureChartComponent<XAxis>(); xAxis.splitNumber = 10; xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; -var yAxis = chart.GetOrAddChartComponent<YAxis>(); +var yAxis = chart.EnsureChartComponent<YAxis>(); yAxis.type = Axis.AxisType.Value; ``` @@ -195,11 +195,11 @@ XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换 需要先获取组件,再修改里面的参数: ```C# -var title = chart.GetOrAddChartComponent<Title>(); +var title = chart.EnsureChartComponent<Title>(); title.text = "Simple LineChart"; title.subText = "normal line"; -var xAxis = chart.GetOrAddChartComponent<XAxis>(); +var xAxis = chart.EnsureChartComponent<XAxis>(); xAxis.splitNumber = 10; xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; @@ -234,9 +234,9 @@ serie.roundCap = true; 给Serie添加额外组件: ```C# -serie.AddExtraComponent<AreaStyle>(); +serie.EnsureComponent<AreaStyle>(); -var label = serie1.AddExtraComponent<LabelStyle>(); +var label = serie1.EnsureComponent<LabelStyle>(); label.offset = new Vector3(0,20,0); ``` @@ -247,7 +247,7 @@ var serieData = chart.AddData(0, 20); //var serieData = serie.GetSerieData(0); //从已有数据中获取 serieData.radius = 10; -var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件 +var itemStyle = serieData.EnsureComponent<ItemStyle>(); //给数据项添加ItemStyle组件 itemStyle.color = Color.blue; ``` diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 255fe22d..a7ec92fd 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 41 slug: /api --- @@ -27,9 +27,9 @@ slug: /api |[PieChart](#piechart)|[PolarChart](#polarchart)|[PolarCoordContext](#polarcoordcontext)| |[PropertyUtil](#propertyutil)|[RadarChart](#radarchart)|[RadarCoordContext](#radarcoordcontext)| |[ReflectionUtil](#reflectionutil)|[RequireChartComponentAttribute](#requirechartcomponentattribute)|[RingChart](#ringchart)| -|[RuntimeUtil](#runtimeutil)|[ScatterChart](#scatterchart)|[SerieContext](#seriecontext)| -|[SerieConvertAttribute](#serieconvertattribute)|[SerieDataContext](#seriedatacontext)|[SerieDataExtraComponentAttribute](#seriedataextracomponentattribute)| -|[SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)|[SerieExtraComponentAttribute](#serieextracomponentattribute)|[SerieHandler](#seriehandler)| +|[RuntimeUtil](#runtimeutil)|[ScatterChart](#scatterchart)|[SerieComponentAttribute](#seriecomponentattribute)| +|[SerieContext](#seriecontext)|[SerieConvertAttribute](#serieconvertattribute)|[SerieDataComponentAttribute](#seriedatacomponentattribute)| +|[SerieDataContext](#seriedatacontext)|[SerieDataExtraFieldAttribute](#seriedataextrafieldattribute)|[SerieHandler](#seriehandler)| |[SerieHandler<T>](#seriehandlert)|[SerieHandlerAttribute](#seriehandlerattribute)|[SerieHelper](#seriehelper)| |[SerieLabelHelper](#serielabelhelper)|[SerieLabelPool](#serielabelpool)|[SerieParams](#serieparams)| |[SeriesHelper](#serieshelper)|[SimplifiedBarChart](#simplifiedbarchart)|[SimplifiedCandlestickChart](#simplifiedcandlestickchart)| @@ -133,7 +133,7 @@ Inherits or Implemented: [BaseGraph](#basegraph),[ISerializationCallbackReceiver | ConvertSerie() |public bool ConvertSerie(Serie serie, Type type)| | ConvertSerie<T>() |public bool ConvertSerie<T>(Serie serie) where T : Serie| | ConvertXYAxis() |public void ConvertXYAxis(int index)<br/>转换X轴和Y轴的配置 | -| EnsureChartComponent<T>() |public T EnsureChartComponent<T>() where T : MainComponent| +| EnsureChartComponent<T>() |public T EnsureChartComponent<T>() where T : MainComponent<br/>确保图表有该组件,如果没有则添加。注意:有可能添加不成功。 | | GenerateDefaultSerieName() |public string GenerateDefaultSerieName()| | GetAllSerieDataCount() |public int GetAllSerieDataCount()| | GetChartBackgroundColor() |public Color32 GetChartBackgroundColor()| @@ -321,7 +321,6 @@ Inherits or Implemented: [BaseChart](#basechart) | GetBlurColor() |public static Color32 GetBlurColor(Color32 color, float a = 0.3f)| | GetColor() |public static Color32 GetColor(string hexColorStr)| | GetDire() |public static Vector3 GetDire(float angle, bool isDegree = false)| -| GetFloatAccuracy() |public static int GetFloatAccuracy(double value)| | GetFullName() |public static string GetFullName(Transform transform)| | GetHighlightColor() |public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)| | GetLastValue() |public static Vector3 GetLastValue(List<Vector3> list)| @@ -635,6 +634,8 @@ Inherits or Implemented: [MainComponentHandler](#maincomponenthandler) | Approximately() |public static bool Approximately(double a, double b)| | Clamp() |public static double Clamp(double d, double min, double max)| | Clamp01() |public static double Clamp01(double value)| +| GetPrecision() |public static int GetPrecision(double value)| +| IsInteger() |public static bool IsInteger(double value)| | Lerp() |public static double Lerp(double a, double b, double t)| ## ObjectPool<T> where T @@ -737,6 +738,23 @@ Inherits or Implemented: [BaseChart](#basechart) Inherits or Implemented: [BaseChart](#basechart) +## SerieComponentAttribute + +Inherits or Implemented: [Attribute](#attribute) + +|public method|description| +|--|--| +| Contains() |public bool Contains(Type type)| +| Contains<T>() |public bool Contains<T>() where T : ISerieComponent| +| SerieComponentAttribute() |public SerieComponentAttribute()| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| +| SerieComponentAttribute() |public SerieComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| + ## SerieContext ## SerieConvertAttribute @@ -752,28 +770,28 @@ Inherits or Implemented: [Attribute](#attribute) | SerieConvertAttribute() |public SerieConvertAttribute(Type serie, Type serie2, Type serie3)| | SerieConvertAttribute() |public SerieConvertAttribute(Type serie, Type serie2, Type serie3, Type serie4)| -## SerieDataContext - -|public method|description| -|--|--| -| Reset() |public void Reset()| - -## SerieDataExtraComponentAttribute +## SerieDataComponentAttribute Inherits or Implemented: [Attribute](#attribute) |public method|description| |--|--| | Contains() |public bool Contains(Type type)| -| Contains<T>() |public bool Contains<T>() where T : ISerieExtraComponent| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute()| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| -| SerieDataExtraComponentAttribute() |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| +| Contains<T>() |public bool Contains<T>() where T : ISerieComponent| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute()| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| +| SerieDataComponentAttribute() |public SerieDataComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| + +## SerieDataContext + +|public method|description| +|--|--| +| Reset() |public void Reset()| ## SerieDataExtraFieldAttribute @@ -791,23 +809,6 @@ Inherits or Implemented: [Attribute](#attribute) | SerieDataExtraFieldAttribute() |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)| | SerieDataExtraFieldAttribute() |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)| -## SerieExtraComponentAttribute - -Inherits or Implemented: [Attribute](#attribute) - -|public method|description| -|--|--| -| Contains() |public bool Contains(Type type)| -| Contains<T>() |public bool Contains<T>() where T : ISerieExtraComponent| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute()| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)| -| SerieExtraComponentAttribute() |public SerieExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)| - ## SerieHandler |public method|description| diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 88225e58..4de6548a 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 61 slug: /changelog --- @@ -65,6 +65,7 @@ slug: /changelog ## master +* (2023.02.12) 重构`Component`相关代码,调整API接口 * (2023.02.10) 修复`Axis`在`Log`轴时某些情况下最小值不正确的问题 * (2023.02.10) 优化`Axis`的数值`Label`的默认显示格式 * (2023.02.08) 增加`DataZoom`的`startLock`和`endLock`参数支持锁定 diff --git a/Documentation~/zh/configuration.md b/Documentation~/zh/configuration.md index af75cdde..6dd6b967 100644 --- a/Documentation~/zh/configuration.md +++ b/Documentation~/zh/configuration.md @@ -1,5 +1,5 @@ --- -sidebar_position: 2 +sidebar_position: 31 slug: /configuration --- @@ -54,7 +54,7 @@ slug: /configuration |[TitleStyle](#titlestyle)|[TitleTheme](#titletheme)|[TooltipTheme](#tooltiptheme)|[VisualMapRange](#visualmaprange)| |[VisualMapTheme](#visualmaptheme)| -## ISerieExtraComponent 系列的额外组件 +## ISerieComponent 可添加到Serie的组件 ||||| |--|--|--|--| @@ -62,7 +62,7 @@ slug: /configuration |[LabelLine](#labelline)|[LabelStyle](#labelstyle)|[LineArrow](#linearrow)|[SelectStyle](#selectstyle)| |[TitleStyle](#titlestyle)| -## ISerieDataComponent 数据项的额外组件 +## ISerieDataComponent 可添加到SerieData的组件 ||||| |--|--|--|--| @@ -116,7 +116,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent) ## AreaStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) 区域填充样式。 @@ -355,7 +355,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai ## BlurStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > 从 `v3.2.0` 开始支持 @@ -508,7 +508,7 @@ Inherits or Implemented: [BaseScatter](#basescatter) ## EmphasisStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > 从 `v3.2.0` 开始支持 @@ -570,7 +570,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent) ## ImageStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) |field|default|since|comment| |--|--|--|--| @@ -643,7 +643,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieDataComponent] ## LabelLine -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) 标签的引导线 @@ -662,7 +662,7 @@ Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent ## LabelStyle -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) 图形上的文本标签,可用于说明图形的一些数据信息,比如值,名称等。 @@ -757,7 +757,7 @@ Inherits or Implemented: [Serie](#serie),[INeedSerieContainer](#ineedseriecontai ## LineArrow -Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieExtraComponent](#iserieextracomponent) +Inherits or Implemented: [ChildComponent](#childcomponent),[ISerieComponent](#iseriecomponent) |field|default|since|comment| |--|--|--|--| @@ -990,7 +990,7 @@ Inherits or Implemented: [BaseScatter](#basescatter) ## SelectStyle -Inherits or Implemented: [StateStyle](#statestyle),[ISerieExtraComponent](#iserieextracomponent),[ISerieDataComponent](#iseriedatacomponent) +Inherits or Implemented: [StateStyle](#statestyle),[ISerieComponent](#iseriecomponent),[ISerieDataComponent](#iseriedatacomponent) > 从 `v3.2.0` 开始支持 @@ -1344,7 +1344,7 @@ Inherits or Implemented: [MainComponent](#maincomponent),[IPropertyChanged](#ipr ## TitleStyle -Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieExtraComponent](#iserieextracomponent) +Inherits or Implemented: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent) 标题相关设置。 diff --git a/Documentation~/zh/faq.md b/Documentation~/zh/faq.md index 666238c1..c9a221e8 100644 --- a/Documentation~/zh/faq.md +++ b/Documentation~/zh/faq.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 51 slug: /faq --- diff --git a/Documentation~/zh/support.md b/Documentation~/zh/support.md index ddbf9ab3..440edfc5 100644 --- a/Documentation~/zh/support.md +++ b/Documentation~/zh/support.md @@ -1,5 +1,6 @@ --- -sidebar_position: 6 +title: 技术支持和订阅服务 +sidebar_position: 21 slug: /support --- diff --git a/Documentation~/zh/tutorial01.md b/Documentation~/zh/tutorial01.md index 3d027094..855cac94 100644 --- a/Documentation~/zh/tutorial01.md +++ b/Documentation~/zh/tutorial01.md @@ -1,6 +1,6 @@ --- title: 入门教程:5分钟上手 XCharts 3.0 -sidebar_position: 1 +sidebar_position: 11 slug: /tutorial01 --- @@ -105,29 +105,29 @@ chart.SetSize(580, 300);//代码动态设置尺寸,或直接操作chart.rectTr 设置标题: ```C# -var title = chart.GetOrAddChartComponent<Title>(); +var title = chart.EnsureChartComponent<Title>(); title.text = "Simple Line"; ``` 设置提示框和图例是否显示: ```C# -var tooltip = chart.GetOrAddChartComponent<Tooltip>(); +var tooltip = chart.EnsureChartComponent<Tooltip>(); tooltip.show = true; -var legend = chart.GetOrAddChartComponent<Legend>(); +var legend = chart.EnsureChartComponent<Legend>(); legend.show = false; ``` 设置坐标轴: ```C# -var xAxis = chart.GetOrAddChartComponent<XAxis>(); +var xAxis = chart.EnsureChartComponent<XAxis>(); xAxis.splitNumber = 10; xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; -var yAxis = chart.GetOrAddChartComponent<YAxis>(); +var yAxis = chart.EnsureChartComponent<YAxis>(); yAxis.type = Axis.AxisType.Value; ``` @@ -201,11 +201,11 @@ XCharts支持TextMeshPro,但默认是不开启的,需要自己手动切换 需要先获取组件,再修改里面的参数: ```C# -var title = chart.GetOrAddChartComponent<Title>(); +var title = chart.EnsureChartComponent<Title>(); title.text = "Simple LineChart"; title.subText = "normal line"; -var xAxis = chart.GetOrAddChartComponent<XAxis>(); +var xAxis = chart.EnsureChartComponent<XAxis>(); xAxis.splitNumber = 10; xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; @@ -240,9 +240,9 @@ serie.roundCap = true; 给Serie添加额外组件: ```C# -serie.AddExtraComponent<AreaStyle>(); +serie.EnsureComponent<AreaStyle>(); -var label = serie1.AddExtraComponent<LabelStyle>(); +var label = serie1.EnsureComponent<LabelStyle>(); label.offset = new Vector3(0,20,0); ``` @@ -253,7 +253,7 @@ var serieData = chart.AddData(0, 20); //var serieData = serie.GetSerieData(0); //从已有数据中获取 serieData.radius = 10; -var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件 +var itemStyle = serieData.EnsureComponent<ItemStyle>(); //给数据项添加ItemStyle组件 itemStyle.color = Color.blue; ``` diff --git a/README.md b/README.md index faf54529..62871c53 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ - 支持万级大数据量绘制,支持采样绘制。 - 支持`TexMeshPro`。 - 支持所有`5.6`以上的`Unity`版本。 -- 支持 Input System ([如何从 Input Manager 转 Input System](Documentation~/zh/inputsystem.md))。 +- 支持 Input System ([如何从 Input Manager 转 Input System](https://xcharts-team.github.io/docs/master/tutorial03/inputsystem))。 ## 截图