diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index e648ee85..b02863f9 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -159,6 +159,7 @@ slug: /api - [MainComponentContext](#maincomponentcontext) - [MainComponentHandler](#maincomponenthandler) - [MainComponentHandler<T>](#maincomponenthandlert) +- [MainComponentHandler<Title>](#maincomponenthandlertitle) - [MarkArea](#markarea) - [MarkAreaData](#markareadata) - [MarkAreaType](#markareatype) @@ -257,6 +258,7 @@ slug: /api - [ThemeStyle](#themestyle) - [ThemeType](#themetype) - [Title](#title) +- [TitleHandler](#titlehandler) - [TitleStyle](#titlestyle) - [TitleTheme](#titletheme) - [Tooltip](#tooltip) @@ -2035,10 +2037,6 @@ public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount, int gridIndex) where T : Serie -### BaseChart.GetTitlePosition - -public Vector3 GetTitlePosition(Title title) - ### BaseChart.GetVisualMapOfSerie public VisualMap GetVisualMapOfSerie(Serie serie) @@ -2558,6 +2556,10 @@ public string warningInfo public string CheckWarning() 检测警告信息。 +### BaseGraph.GetTitlePosition + +public Vector3 GetTitlePosition(Title title) + ### BaseGraph.LocalPointToScreenPoint public Vector2 LocalPointToScreenPoint(Vector2 localPoint) @@ -2886,6 +2888,14 @@ public static string ColorToStr(Color color) public static string FloatToStr(double value, string numericFormatter = "F", int precision = 0) +### ChartCached.GetAxisLabelName + +public static string GetAxisLabelName(int index) + +### ChartCached.GetComponentObjectName + +public static string GetComponentObjectName(MainComponent component) + ### ChartCached.GetSerieLabelName public static string GetSerieLabelName(string prefix, int i, int j) @@ -2894,6 +2904,14 @@ public static string GetSerieLabelName(string prefix, int i, int j) public static string GetString(string prefix, int suffix) +### ChartCached.GetTypeName + +public static string GetTypeName(Type type) + +### ChartCached.GetTypeName<T> + +public static string GetTypeName<T>() + ### ChartCached.IntToStr public static string IntToStr(int value, string numericFormatter = "") @@ -5750,6 +5768,10 @@ class in XCharts.Runtime / Inherits from: [MainComponentHandler](#maincomponenth public T component +## MainComponentHandler<Title> + +class in / Subclasses: [TitleHandler](#titlehandler) + ## MarkArea class in XCharts.Runtime / Inherits from: [MainComponent](#maincomponent) @@ -8676,6 +8698,30 @@ public override void ClearComponentDirty() public void OnChanged() +## TitleHandler + +class in XCharts.Runtime / Inherits from: [MainComponentHandler<Title>](#maincomponenthandlertitle) + +### TitleHandler.AddSubTitleLabel + +public static ChartLabel AddSubTitleLabel(Transform parent, Title title, ComponentTheme componentTheme, BaseChart chart = null) + +### TitleHandler.AddTitleLabel + +public static ChartLabel AddTitleLabel(Transform parent, Title title, ComponentTheme componentTheme, BaseChart chart = null) + +### TitleHandler.AddTitleObject + +public static GameObject AddTitleObject(BaseGraph graph, Title title, ComponentTheme componentTheme, int titleSiblingIndex, string objectName = null) + +### TitleHandler.InitComponent + +public override void InitComponent() + +### TitleHandler.OnSerieDataUpdate + +public override void OnSerieDataUpdate(int serieIndex) + ## TitleStyle class in XCharts.Runtime / Inherits from: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent) diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 2bf6a998..21992a61 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -159,6 +159,7 @@ slug: /api - [MainComponentContext](#maincomponentcontext) - [MainComponentHandler](#maincomponenthandler) - [MainComponentHandler<T>](#maincomponenthandlert) +- [MainComponentHandler<Title>](#maincomponenthandlertitle) - [MarkArea](#markarea) - [MarkAreaData](#markareadata) - [MarkAreaType](#markareatype) @@ -257,6 +258,7 @@ slug: /api - [ThemeStyle](#themestyle) - [ThemeType](#themetype) - [Title](#title) +- [TitleHandler](#titlehandler) - [TitleStyle](#titlestyle) - [TitleTheme](#titletheme) - [Tooltip](#tooltip) @@ -2035,10 +2037,6 @@ public float GetSerieTotalGap<T>(float categoryWidth, float gap, int index public float GetSerieTotalWidth<T>(float categoryWidth, float gap, int realBarCount, int gridIndex) where T : Serie -### BaseChart.GetTitlePosition - -public Vector3 GetTitlePosition(Title title) - ### BaseChart.GetVisualMapOfSerie public VisualMap GetVisualMapOfSerie(Serie serie) @@ -2558,6 +2556,10 @@ public string warningInfo public string CheckWarning() 检测警告信息。 +### BaseGraph.GetTitlePosition + +public Vector3 GetTitlePosition(Title title) + ### BaseGraph.LocalPointToScreenPoint public Vector2 LocalPointToScreenPoint(Vector2 localPoint) @@ -2886,6 +2888,14 @@ public static string ColorToStr(Color color) public static string FloatToStr(double value, string numericFormatter = "F", int precision = 0) +### ChartCached.GetAxisLabelName + +public static string GetAxisLabelName(int index) + +### ChartCached.GetComponentObjectName + +public static string GetComponentObjectName(MainComponent component) + ### ChartCached.GetSerieLabelName public static string GetSerieLabelName(string prefix, int i, int j) @@ -2894,6 +2904,14 @@ public static string GetSerieLabelName(string prefix, int i, int j) public static string GetString(string prefix, int suffix) +### ChartCached.GetTypeName + +public static string GetTypeName(Type type) + +### ChartCached.GetTypeName<T> + +public static string GetTypeName<T>() + ### ChartCached.IntToStr public static string IntToStr(int value, string numericFormatter = "") @@ -5750,6 +5768,10 @@ class in XCharts.Runtime / 继承自: [MainComponentHandler](#maincomponenthandl public T component +## MainComponentHandler<Title> + +class in / 子类: [TitleHandler](#titlehandler) + ## MarkArea class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) @@ -8676,6 +8698,30 @@ public override void ClearComponentDirty() public void OnChanged() +## TitleHandler + +class in XCharts.Runtime / 继承自: [MainComponentHandler<Title>](#maincomponenthandlertitle) + +### TitleHandler.AddSubTitleLabel + +public static ChartLabel AddSubTitleLabel(Transform parent, Title title, ComponentTheme componentTheme, BaseChart chart = null) + +### TitleHandler.AddTitleLabel + +public static ChartLabel AddTitleLabel(Transform parent, Title title, ComponentTheme componentTheme, BaseChart chart = null) + +### TitleHandler.AddTitleObject + +public static GameObject AddTitleObject(BaseGraph graph, Title title, ComponentTheme componentTheme, int titleSiblingIndex, string objectName = null) + +### TitleHandler.InitComponent + +public override void InitComponent() + +### TitleHandler.OnSerieDataUpdate + +public override void OnSerieDataUpdate(int serieIndex) + ## TitleStyle class in XCharts.Runtime / 继承自: [LabelStyle](#labelstyle),[ISerieDataComponent](#iseriedatacomponent),[ISerieComponent](#iseriecomponent) diff --git a/Runtime/Component/Title/Title.cs b/Runtime/Component/Title/Title.cs index 2ed68335..f0cf1239 100644 --- a/Runtime/Component/Title/Title.cs +++ b/Runtime/Component/Title/Title.cs @@ -8,7 +8,7 @@ namespace XCharts.Runtime /// ||标题组件,包含主标题和副标题。 /// [Serializable] - [ComponentHandler(typeof(TitleHander), true)] + [ComponentHandler(typeof(TitleHandler), true)] public class Title : MainComponent, IPropertyChanged { [SerializeField] private bool m_Show = true; diff --git a/Runtime/Component/Title/TitleHandler.cs b/Runtime/Component/Title/TitleHandler.cs index 9f789aba..90fb52b1 100644 --- a/Runtime/Component/Title/TitleHandler.cs +++ b/Runtime/Component/Title/TitleHandler.cs @@ -3,7 +3,7 @@ using UnityEngine; namespace XCharts.Runtime { [UnityEngine.Scripting.Preserve] - internal sealed class TitleHander : MainComponentHandler