From f5c2e73098db51b3bc1d9bfbc71b060351a7cc93 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 4 Jul 2022 08:30:43 +0800 Subject: [PATCH] [code] add comment --- Runtime/Component/Axis/Axis.cs | 10 +++++----- Runtime/Component/Child/AreaStyle.cs | 2 +- Runtime/Component/Comment/Comment.cs | 4 ++++ Runtime/Component/Debug/DebugInfo.cs | 25 +++++++++++++++++++++++++ Runtime/Component/Legend/Legend.cs | 13 ++----------- Runtime/Component/Radar/RadarCoord.cs | 2 +- Runtime/Theme/AxisTheme.cs | 5 ++++- Runtime/Theme/SerieTheme.cs | 26 ++++++++++++++++++++++++-- Runtime/Theme/ThemeStyle.cs | 12 +++++++++--- 9 files changed, 75 insertions(+), 24 deletions(-) diff --git a/Runtime/Component/Axis/Axis.cs b/Runtime/Component/Axis/Axis.cs index 3cde9a2b..8b9f8ee0 100644 --- a/Runtime/Component/Axis/Axis.cs +++ b/Runtime/Component/Axis/Axis.cs @@ -19,12 +19,12 @@ namespace XCharts.Runtime { /// /// Numerical axis, suitable for continuous data. - /// ||数值轴。适用于连续数据。 + /// |数值轴。适用于连续数据。 /// Value, /// /// Category axis, suitable for discrete category data. Data should only be set via data for this type. - /// ||类目轴。适用于离散的类目数据,为该类型时必须通过 data 设置类目数据。 + /// |类目轴。适用于离散的类目数据,为该类型时必须通过 data 设置类目数据。serie的数据第0维数据对应坐标轴data的index。 /// Category, /// @@ -74,12 +74,12 @@ namespace XCharts.Runtime } [SerializeField] protected bool m_Show = true; - [SerializeField] protected AxisType m_Type; - [SerializeField] protected AxisMinMaxType m_MinMaxType; + [SerializeField] protected Axis.AxisType m_Type; + [SerializeField] protected Axis.AxisMinMaxType m_MinMaxType; [SerializeField] protected int m_GridIndex; [SerializeField] protected int m_PolarIndex; [SerializeField] protected int m_ParallelIndex; - [SerializeField] protected AxisPosition m_Position; + [SerializeField] protected Axis.AxisPosition m_Position; [SerializeField] protected float m_Offset; [SerializeField] protected double m_Min; [SerializeField] protected double m_Max; diff --git a/Runtime/Component/Child/AreaStyle.cs b/Runtime/Component/Child/AreaStyle.cs index 0b4a45bc..f7d1e0a4 100644 --- a/Runtime/Component/Child/AreaStyle.cs +++ b/Runtime/Component/Child/AreaStyle.cs @@ -33,7 +33,7 @@ namespace XCharts.Runtime } [SerializeField] private bool m_Show = true; - [SerializeField] private AreaOrigin m_Origin; + [SerializeField] private AreaStyle.AreaOrigin m_Origin; [SerializeField] private Color32 m_Color; [SerializeField] private Color32 m_ToColor; [SerializeField][Range(0, 1)] private float m_Opacity = 0.6f; diff --git a/Runtime/Component/Comment/Comment.cs b/Runtime/Component/Comment/Comment.cs index b2cb70a3..4274a774 100644 --- a/Runtime/Component/Comment/Comment.cs +++ b/Runtime/Component/Comment/Comment.cs @@ -22,6 +22,10 @@ namespace XCharts.Runtime /// |是否显示注解组件。 /// public bool show { get { return m_Show; } set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); } } + /// + /// The items of comment. + /// |注解项。每个注解组件可以设置多个注解项。 + /// public List items { get { return m_Items; } set { m_Items = value; SetComponentDirty(); } } /// /// The text style of all comments. diff --git a/Runtime/Component/Debug/DebugInfo.cs b/Runtime/Component/Debug/DebugInfo.cs index 5daca29c..ba3f5c49 100644 --- a/Runtime/Component/Debug/DebugInfo.cs +++ b/Runtime/Component/Debug/DebugInfo.cs @@ -40,10 +40,35 @@ namespace XCharts.Runtime private ChartLabel m_Label; private List m_FpsList = new List(); + /// + /// Whether show debug component. + /// |是否显示Debug组件。 + /// + public bool show { get { return m_Show; } set { m_Show = value; } } + /// + /// Whether show children components of chart in hierarchy view. + /// |是否在Hierarchy试图显示所有chart下的节点。 + /// public bool showAllChartObject { get { return m_ShowAllChartObject; } set { m_ShowAllChartObject = value; } } + /// + /// Whether to fold series in inspector view. + /// |是否在Inspector上折叠Serie。 + /// public bool foldSeries { get { return m_FoldSeries; } set { m_FoldSeries = value; } } + /// + /// frame rate. + /// |当前帧率。 + /// public float fps { get; private set; } + /// + /// The average frame rate. + /// |平均帧率。 + /// public float avgFps { get; private set; } + /// + /// The fefresh count of chart per second. + /// |图表每秒刷新次数。 + /// public int refreshCount { get; internal set; } internal int clickChartCount { get; set; } diff --git a/Runtime/Component/Legend/Legend.cs b/Runtime/Component/Legend/Legend.cs index 95d0636b..df3e5b46 100644 --- a/Runtime/Component/Legend/Legend.cs +++ b/Runtime/Component/Legend/Legend.cs @@ -97,7 +97,6 @@ namespace XCharts.Runtime /// /// Type of legend. /// |图例类型。 - /// [default:Type.Auto] /// public Type iconType { @@ -107,7 +106,6 @@ namespace XCharts.Runtime /// /// Selected mode of legend, which controls whether series can be toggled displaying by clicking legends. /// |选择模式。控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 None 关闭。 - /// [default:SelectedMode.Multiple] /// public SelectedMode selectedMode { @@ -117,7 +115,6 @@ namespace XCharts.Runtime /// /// Specify whether the layout of legend component is horizontal or vertical. /// |布局方式是横还是竖。 - /// [default:Orient.Horizonal] /// public Orient orient { @@ -127,7 +124,6 @@ namespace XCharts.Runtime /// /// The location of legend. /// |图例显示的位置。 - /// [default:Location.defaultTop] /// public Location location { @@ -137,7 +133,6 @@ namespace XCharts.Runtime /// /// Image width of legend symbol. /// |图例标记的图形宽度。 - /// [default:24f] /// public float itemWidth { @@ -147,7 +142,6 @@ namespace XCharts.Runtime /// /// Image height of legend symbol. /// |图例标记的图形高度。 - /// [default:12f] /// public float itemHeight { @@ -157,7 +151,6 @@ namespace XCharts.Runtime /// /// The distance between each legend, horizontal distance in horizontal layout, and vertical distance in vertical layout. /// |图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。 - /// [default:10f] /// public float itemGap { @@ -167,7 +160,6 @@ namespace XCharts.Runtime /// /// Whether the legend symbol matches the color automatically. /// |图例标记的图形是否自动匹配颜色。 - /// [default:true] /// public bool itemAutoColor { @@ -189,7 +181,6 @@ namespace XCharts.Runtime /// 使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。 /// 参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings /// - /// public string numericFormatter { get { return m_NumericFormatter; } @@ -235,7 +226,7 @@ namespace XCharts.Runtime /// /// Data array of legend. An array item is usually a name representing string. (If it is a pie chart, /// it could also be the name of a single data in the pie chart) of a series. - /// |If data is not specified, it will be auto collected from series. + /// If data is not specified, it will be auto collected from series. /// |图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name(如果是饼图,也可以是饼图单个数据的 name)。 /// 如果 data 没有被指定,会自动从当前系列中获取。指定data时里面的数据项和serie匹配时才会生效。 /// @@ -254,7 +245,7 @@ namespace XCharts.Runtime } /// /// the colors of legend item. - /// 图例标记的颜色列表。 + /// |图例标记的颜色列表。 /// public List colors { diff --git a/Runtime/Component/Radar/RadarCoord.cs b/Runtime/Component/Radar/RadarCoord.cs index 8a2c6bb9..6410f661 100644 --- a/Runtime/Component/Radar/RadarCoord.cs +++ b/Runtime/Component/Radar/RadarCoord.cs @@ -55,7 +55,7 @@ namespace XCharts.Runtime /// The name of indicator. /// |指示器名称。 /// - public string name { get { return FormatterHelper.TrimAndReplaceLine(m_Name); } set { m_Name = value; } } + public string name { get { return m_Name; } set { m_Name = value; } } /// /// The maximum value of indicator, with default value of 0, but we recommend to set it manually. /// |指示器的最大值,默认为 0 无限制。 diff --git a/Runtime/Theme/AxisTheme.cs b/Runtime/Theme/AxisTheme.cs index be4496be..ee5d8fdf 100644 --- a/Runtime/Theme/AxisTheme.cs +++ b/Runtime/Theme/AxisTheme.cs @@ -122,7 +122,10 @@ namespace XCharts.Runtime get { return m_TickColor; } set { if (PropertyUtil.SetColor(ref m_TickColor, value)) SetVerticesDirty(); } } - + /// + /// the colors of split area. + /// |坐标轴分隔区域的颜色。 + /// public List splitAreaColors { get { return m_SplitAreaColors; } diff --git a/Runtime/Theme/SerieTheme.cs b/Runtime/Theme/SerieTheme.cs index f22e0c68..c97a693d 100644 --- a/Runtime/Theme/SerieTheme.cs +++ b/Runtime/Theme/SerieTheme.cs @@ -27,18 +27,38 @@ namespace XCharts.Runtime get { return m_LineWidth; } set { if (PropertyUtil.SetStruct(ref m_LineWidth, value)) SetVerticesDirty(); } } + /// + /// the symbol size of line serie. + /// |折线图的Symbol大小。 + /// public float lineSymbolSize { get { return m_LineSymbolSize; } set { if (PropertyUtil.SetStruct(ref m_LineSymbolSize, value)) SetVerticesDirty(); } } + /// + /// the selected symbol size of line serie. + /// |折线图Symbol在被选中状态时的大小。 + /// public float lineSymbolSelectedSize { get { return lineSymbolSize * selectedRate; } } + /// + /// the symbol size of scatter serie. + /// |散点图的Symbol大小。 + /// public float scatterSymbolSize { get { return m_ScatterSymbolSize; } set { if (PropertyUtil.SetStruct(ref m_ScatterSymbolSize, value)) SetVerticesDirty(); } } + /// + /// the selected symbol size of scatter serie. + /// |散点图的Symbol在被选中状态时的大小。 + /// public float scatterSymbolSelectedSize { get { return scatterSymbolSize * selectedRate; } } + /// + /// the rate of symbol size of line or scatter serie. + /// |折线图或散点图在被选中时的放大倍数。 + /// public float selectedRate { get { return m_SelectedRate; } @@ -46,7 +66,8 @@ namespace XCharts.Runtime } /// - /// 饼图鼠标移到高亮时的额外半径 + /// the extra radius of pie when actived by tooltip. + /// |饼图鼠标移到高亮时的额外半径 /// public float pieTooltipExtraRadius { @@ -54,7 +75,8 @@ namespace XCharts.Runtime set { if (PropertyUtil.SetStruct(ref m_PieTooltipExtraRadius, value < 0 ? 0f : value)) SetVerticesDirty(); } } /// - /// 饼图选中时的中心点偏移 + /// the center offset of pie if selected. + /// |饼图选中时的中心点偏移。 /// public float pieSelectedOffset { diff --git a/Runtime/Theme/ThemeStyle.cs b/Runtime/Theme/ThemeStyle.cs index aaa616e7..f174dbcd 100644 --- a/Runtime/Theme/ThemeStyle.cs +++ b/Runtime/Theme/ThemeStyle.cs @@ -58,17 +58,23 @@ namespace XCharts.Runtime { get { return sharedTheme.themeType; } } + /// + /// theme name. + /// |主题名字。 + /// public string themeName { get { return sharedTheme.themeName; } } - + /// + /// the asset of theme. + /// |主题配置。 + /// public Theme sharedTheme { get { return m_SharedTheme; } set { m_SharedTheme = value; SetAllDirty(); } } - /// /// the contrast color of chart. /// |对比色。 @@ -91,7 +97,7 @@ namespace XCharts.Runtime } /// /// Whether the background color is transparent. When true, the background color is not drawn. - /// |是否透明背景颜色。当设置为true时,不绘制背景颜色。 + /// |是否透明背景颜色。当设置为true时,不绘制背景颜色。 /// public bool transparentBackground {