diff --git a/CHANGELOG.md b/CHANGELOG.md index cb4f0d3d..4975545e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ # 更新日志 [master](#master) +[v3.0.1](#v3.0.1) [v3.0.0](#v3.0.0) [v3.0.0-preivew9](#v3.0.0-preivew9) [v3.0.0-preivew8](#v3.0.0-preivew8) @@ -53,8 +54,14 @@ ## master +## v3.0.1 + +* (2022.06.16) 发布`v3.0.1`版本 +* (2022.06.16) 修复`Inspector`上部分`foldout`箭头点击无法展开的问题 +* (2022.06.16) 修复`Inspector`上部分`foldout`箭头点击无法展开的问题 +* (2022.06.15) 优化`Doc`自动生成,完善代码注释和配置项手册文档 * (2022.06.14) 优化`SerieLabelStyle`,支持动态调整`Icon` -* (2022.06.13) 优化`Background`,参数`hideThemeBackgroundColor`重命名为`autoColor` +* (2022.06.13) 优化`Background`背景设置 * (2022.06.10) 增加`Legend`的`AxisLabel`支持`autoColor` * (2022.06.08) 修复`Axis`的`AxisLabel`在设置不显示时还显示首尾两个`label`的问题 diff --git a/Documentation/CHANGELOG-EN.md b/Documentation/CHANGELOG-EN.md index 54a27d3d..443f1958 100644 --- a/Documentation/CHANGELOG-EN.md +++ b/Documentation/CHANGELOG-EN.md @@ -2,6 +2,7 @@ # 更新日志 [master](#master) +[v3.0.1](#v3.0.1) [v3.0.0](#v3.0.0) [v2.3.0](#v2.3.0) [v2.2.3](#v2.2.3) @@ -38,6 +39,16 @@ [v0.5.0](#v0.5.0) [v0.1.0](#v0.1.0) +## v3.0.1 + +* (2022.06.16) Release `v3.0.1` version +* (2022.06.16) Fixed an issue where the `foldout` arrow on `Inspector` could not be expanded +* (2022.06.15) Optimized `Doc` auto-generation, improved code comments and configuration item manual documentation +* (2022.06.14) Optimized `SerieLabelStyle` to support dynamic adjustment of `Icon` +* (2022.06.13) Optimized `Background` setting +* (2022.06.10) Added `Legend` AxisLabel support for `autoColor` +* (2022.06.08) Fixed issue where `Axis` `AxisLabel` still shows the first and last two labels when not displayed + ## v3.0.0 * More robust underlying framework. diff --git a/Documentation/XChartsConfiguration-EN.md b/Documentation/XChartsConfiguration-EN.md index e68a15ed..8a251fcf 100644 --- a/Documentation/XChartsConfiguration-EN.md +++ b/Documentation/XChartsConfiguration-EN.md @@ -1361,8 +1361,8 @@ Tooltip component. | `show` |true | Whether to show the tooltip component. | | `type` | | Indicator type.
`Painter.Type`:
- `Base`:
- `Serie`:
- `Top`:
| | `trigger` | | Type of triggering.
`Tooltip.Trigger`:
- `Item`: Triggered by data item, which is mainly used for charts that don't have a category axis like scatter charts or pie charts.
- `Axis`: Triggered by axes, which is mainly used for charts that have category axes, like bar charts or line charts.
- `None`: Trigger nothing.
| -| `itemFormatter` | | a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. When formatter is not null, use formatter first, otherwise use itemFormatter. | -| `titleFormatter` | | The string template formatter for the tooltip title content. Support for wrapping lines with \n. The placeholder {I} can be set separately to indicate that the title is ignored and not displayed. Template variables are {.}, {a}, {b}, {c}, {d}.
{.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.
{a} is the series name of the serie that is currently indicated or whose index is 0.
{b} is the name of the data item serieData that is currently indicated or whose index is 0, or a category value (such as the X-axis of a line chart).
{c} is the value of a Y-dimension (dimesion is 1) from a Serie that is currently indicated or whose index is 0.
{d} is the percentage value of Y-dimensions (dimesion is 1) from serie that is currently indicated or whose index is 0, with no % sign.
{e} is the name of the data item serieData that is currently indicated or whose index is 0.
{f} is sum of data.
{.1} represents a dot from serie corresponding color that specifies index as 1.
1 in {a1}, {b1}, {c1} represents a serie that specifies an index of 1.
{c1:2} represents the third data from serie's current indication data item indexed to 1 (a data item has multiple data, index 2 represents the third data).
{c1:2-2} represents the third data item from serie's third data item indexed to 1 (i.e., which data item must be specified to specify).
{d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).
{d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).
Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"
| +| `itemFormatter` | | a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. Template variables are {.}, {a}, {b}, {c}, {d}.
{.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.
{a} is the series name of the serie that is currently indicated or whose index is 0.
{b} is the name of the data item serieData that is currently indicated or whose index is 0, or a category value (such as the X-axis of a line chart).
{c} is the value of a Y-dimension (dimesion is 1) from a Serie that is currently indicated or whose index is 0.
{d} is the percentage value of Y-dimensions (dimesion is 1) from serie that is currently indicated or whose index is 0, with no % sign.
{e} is the name of the data item serieData that is currently indicated or whose index is 0.
{f} is sum of data.
{.1} represents a dot from serie corresponding color that specifies index as 1.
1 in {a1}, {b1}, {c1} represents a serie that specifies an index of 1.
{c1:2} represents the third data from serie's current indication data item indexed to 1 (a data item has multiple data, index 2 represents the third data).
{c1:2-2} represents the third data item from serie's third data item indexed to 1 (i.e., which data item must be specified to specify).
{d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).
{d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).
Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"
| +| `titleFormatter` | | The string template formatter for the tooltip title content. Support for wrapping lines with \n. The placeholder {I} can be set separately to indicate that the title is ignored and not displayed. Template see itemFormatter. | | `marker` | | the marker of serie. | | `fixedWidth` |0 | Fixed width. Higher priority than minWidth. | | `fixedHeight` |0 | Fixed height. Higher priority than minHeight. | diff --git a/Documentation/XChartsConfiguration-ZH.md b/Documentation/XChartsConfiguration-ZH.md index 7f903bfa..dd7d5d44 100644 --- a/Documentation/XChartsConfiguration-ZH.md +++ b/Documentation/XChartsConfiguration-ZH.md @@ -445,7 +445,7 @@ Inherits or Implemented: [ChildComponent](#ChildComponent) |field|default|comment| |--|--|--| | `show` |true | 是否显示当前注解项。 | -| `content` | | 注解的文本内容。 | +| `content` | | 注解的文本内容。支持模板参数,可以参考Tooltip的itemFormatter。 | | `position` | | 注解项的位置坐标。 | | `markRect` | | 注解区域。 | | `markStyle` | | 注解标记区域样式。 [CommentMarkStyle](CommentMarkStyle)| @@ -771,7 +771,7 @@ Inherits or Implemented: [MainComponent](#MainComponent),[IPropertyChanged](#IPr | `itemGap` |10f | 图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。 [default:10f] | | `itemAutoColor` |true | 图例标记的图形是否自动匹配颜色。 [default:true] | | `itemOpacity` |1 | 图例标记的图形的颜色透明度。 | -| `formatter` | | 图例内容字符串模版格式器。支持用 \n 换行。 模板变量为图例名称 {value}。 [default:null] | +| `formatter` | | 图例内容字符串模版格式器。支持用 \n 换行。 模板变量为图例名称 {value}。其他模板变量参考Toolip的itemFormatter。 | | `numericFormatter` | | 标准数字格式字符串。用于将数值格式化显示为字符串。 使用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 | | `labelStyle` | | 文本样式。 [LabelStyle](LabelStyle)| | `data` | | If data is not specified, it will be auto collected from series. | @@ -1361,8 +1361,8 @@ Inherits or Implemented: [MainComponent](#MainComponent) | `show` |true | 是否显示提示框组件。 | | `type` | | 提示框指示器类型。
`Painter.Type`:
- `Base`:
- `Serie`:
- `Top`:
| | `trigger` | | 触发类型。
`Tooltip.Trigger`:
- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。
- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。
- `None`: 什么都不触发。
| -| `itemFormatter` | | 提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。当formatter不为空时,优先使用formatter,否则使用itemFormatter。 | -| `titleFormatter` | | 提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。
模板变量有{.}、{a}、{b}、{c}、{d}、{e}。
{.}为当前所指示或index为0的serie的对应颜色的圆点。
{a}为当前所指示或index为0的serie的系列名name。
{b}为当前所指示或index为0的serie的数据项serieData的name,或者类目值(如折线图的X轴)。
{c}为当前所指示或index为0的serie的y维(dimesion为1)的数值。
{d}为当前所指示或index为0的serie的y维(dimesion为1)百分比值,注意不带%号。
{e}为当前所指示或index为0的serie的数据项serieData的name。
{f}为数据总和。
{.1}表示指定index为1的serie对应颜色的圆点。
{a1}、{b1}、{c1}中的1表示指定index为1的serie。
{c1:2}表示索引为1的serie的当前指示数据项的第3个数据(一个数据项有多个数据,index为2表示第3个数据)。
{c1:2-2}表示索引为1的serie的第3个数据项的第3个数据(也就是要指定第几个数据项时必须要指定第几个数据)。
{d1:2:f2}表示单独指定了数值的格式化字符串为f2(不指定时用numericFormatter)。
{d:0.##} 表示单独指定了数值的格式化字符串为 0.## (用于百分比,保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。
示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}" | +| `itemFormatter` | | 提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}。
{.}为当前所指示或index为0的serie的对应颜色的圆点。
{a}为当前所指示或index为0的serie的系列名name。
{b}为当前所指示或index为0的serie的数据项serieData的name,或者类目值(如折线图的X轴)。
{c}为当前所指示或index为0的serie的y维(dimesion为1)的数值。
{d}为当前所指示或index为0的serie的y维(dimesion为1)百分比值,注意不带%号。
{e}为当前所指示或index为0的serie的数据项serieData的name。
{f}为数据总和。
{.1}表示指定index为1的serie对应颜色的圆点。
{a1}、{b1}、{c1}中的1表示指定index为1的serie。
{c1:2}表示索引为1的serie的当前指示数据项的第3个数据(一个数据项有多个数据,index为2表示第3个数据)。
{c1:2-2}表示索引为1的serie的第3个数据项的第3个数据(也就是要指定第几个数据项时必须要指定第几个数据)。
{d1:2:f2}表示单独指定了数值的格式化字符串为f2(不指定时用numericFormatter)。
{d:0.##} 表示单独指定了数值的格式化字符串为 0.## (用于百分比,保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。
示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}" | +| `titleFormatter` | | 提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 模板变量参考Toolip的itemFormatter。 | | `marker` | | serie的符号标志。 | | `fixedWidth` |0 | 固定宽度。比 minWidth 优先。 | | `fixedHeight` |0 | 固定高度。比 minHeight 优先。 | diff --git a/Editor/Series/PieEditor.cs b/Editor/Series/PieEditor.cs index 4d909ad0..7a66372f 100644 --- a/Editor/Series/PieEditor.cs +++ b/Editor/Series/PieEditor.cs @@ -11,17 +11,14 @@ namespace XCharts.Editor PropertyField("m_Gap"); PropertyTwoFiled("m_Center"); PropertyTwoFiled("m_Radius"); - //PropertyField("m_StartAngle"); - + PropertyField("m_AvoidLabelOverlap"); PropertyFiledMore(() => { PropertyField("m_MinAngle"); PropertyField("m_RoundCap"); PropertyField("m_Ignore"); PropertyField("m_IgnoreValue"); - PropertyField("m_AvoidLabelOverlap"); }); - PropertyField("m_ItemStyle"); PropertyField("m_Animation"); } diff --git a/Editor/Utilities/ChartEditorHelper.cs b/Editor/Utilities/ChartEditorHelper.cs index de606eef..647e7166 100644 --- a/Editor/Utilities/ChartEditorHelper.cs +++ b/Editor/Utilities/ChartEditorHelper.cs @@ -543,7 +543,7 @@ namespace XCharts.Editor Action drawCallback, params HeaderMenuInfo[] menus) { var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT); - var labelRect = DrawHeaderInternal(rect, title, state, drawBackground, activeField); + var labelRect = DrawHeaderInternal(rect, title, ref state, drawBackground, activeField); DrawMenu(rect, menus); if (drawCallback != null) { @@ -568,7 +568,7 @@ namespace XCharts.Editor Action drawCallback, List menus) { var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT); - var labelRect = DrawHeaderInternal(rect, title, state, drawBackground, activeField); + var labelRect = DrawHeaderInternal(rect, title, ref state, drawBackground, activeField); DrawMenu(rect, menus); if (drawCallback != null) { @@ -589,7 +589,7 @@ namespace XCharts.Editor return state; } - private static Rect DrawHeaderInternal(Rect rect, string title, bool state, bool drawBackground, SerializedProperty activeField) + private static Rect DrawHeaderInternal(Rect rect, string title, ref bool state, bool drawBackground, SerializedProperty activeField) { var splitRect = rect; splitRect.x = EditorGUI.indentLevel * INDENT_WIDTH + 4; diff --git a/Runtime/Component/Comment/CommentItem.cs b/Runtime/Component/Comment/CommentItem.cs index 3b0db35e..5a3a891f 100644 --- a/Runtime/Component/Comment/CommentItem.cs +++ b/Runtime/Component/Comment/CommentItem.cs @@ -29,7 +29,7 @@ namespace XCharts.Runtime public Vector3 position { get { return m_Position; } set { if (PropertyUtil.SetStruct(ref m_Position, value)) SetComponentDirty(); } } /// /// content of comment. - /// |注解的文本内容。 + /// |注解的文本内容。支持模板参数,可以参考Tooltip的itemFormatter。 /// public string content { get { return m_Content; } set { if (PropertyUtil.SetClass(ref m_Content, value)) SetComponentDirty(); } } /// diff --git a/Runtime/Component/Legend/Legend.cs b/Runtime/Component/Legend/Legend.cs index 504850ca..4c59156f 100644 --- a/Runtime/Component/Legend/Legend.cs +++ b/Runtime/Component/Legend/Legend.cs @@ -196,8 +196,7 @@ namespace XCharts.Runtime /// /// Legend content string template formatter. Support for wrapping lines with \n. Template:{value}. /// |图例内容字符串模版格式器。支持用 \n 换行。 - /// 模板变量为图例名称 {value}。 - /// [default:null] + /// 模板变量为图例名称 {value}。其他模板变量参考Toolip的itemFormatter。 /// public string formatter { diff --git a/Runtime/Component/Tooltip/Tooltip.cs b/Runtime/Component/Tooltip/Tooltip.cs index 7ff3abec..8e13e316 100644 --- a/Runtime/Component/Tooltip/Tooltip.cs +++ b/Runtime/Component/Tooltip/Tooltip.cs @@ -138,6 +138,13 @@ namespace XCharts.Runtime /// /// The string template formatter for the tooltip title content. Support for wrapping lines with \n. /// The placeholder {I} can be set separately to indicate that the title is ignored and not displayed. + /// Template see itemFormatter. + /// |提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 + /// 模板变量参考Toolip的itemFormatter。 + /// + public string titleFormatter { get { return m_TitleFormatter; } set { m_TitleFormatter = value; } } + /// + /// a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. /// Template variables are {.}, {a}, {b}, {c}, {d}.
/// {.} is the dot of the corresponding color of a Serie that is currently indicated or whose index is 0.
/// {a} is the series name of the serie that is currently indicated or whose index is 0.
@@ -153,7 +160,7 @@ namespace XCharts.Runtime /// {d1:2: F2} indicates that a formatted string with a value specified separately is F2 (numericFormatter is used when numericFormatter is not specified).
/// {d:0.##} indicates that a formatted string with a value specified separately is 0.## (used for percentage, reserved 2 valid digits while avoiding the situation similar to "100.00%" when using f2 ).
/// Example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1} : {c1:1-1: f1}"
- /// |提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。
+ /// |提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。 /// 模板变量有{.}、{a}、{b}、{c}、{d}、{e}。
/// {.}为当前所指示或index为0的serie的对应颜色的圆点。
/// {a}为当前所指示或index为0的serie的系列名name。
@@ -170,12 +177,6 @@ namespace XCharts.Runtime /// {d:0.##} 表示单独指定了数值的格式化字符串为 0.## (用于百分比,保留2位有效数同时又能避免使用 f2 而出现的类似于"100.00%"的情况 )。
/// 示例:"{a}:{c}"、"{a1}:{c1:f1}"、"{a1}:{c1:0:f1}"、"{a1}:{c1:1-1:f1}" ///
- public string titleFormatter { get { return m_TitleFormatter; } set { m_TitleFormatter = value; } } - /// - /// a string template formatter for a single Serie or data item content. Support for wrapping lines with \n. - /// When formatter is not null, use formatter first, otherwise use itemFormatter. - /// |提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。当formatter不为空时,优先使用formatter,否则使用itemFormatter。 - /// public string itemFormatter { get { return m_ItemFormatter; } set { m_ItemFormatter = value; } } /// /// the marker of serie. diff --git a/Runtime/Internal/XChartsMgr.cs b/Runtime/Internal/XChartsMgr.cs index 67e96695..69b9c211 100644 --- a/Runtime/Internal/XChartsMgr.cs +++ b/Runtime/Internal/XChartsMgr.cs @@ -20,8 +20,8 @@ namespace XCharts.Runtime [ExecuteInEditMode] public static class XChartsMgr { - public static readonly string version = "3.0.0"; - public static readonly int versionDate = 20220601; + public static readonly string version = "3.0.1"; + public static readonly int versionDate = 20220616; public static string fullVersion { get { return version + "-" + versionDate; } } internal static List chartList = new List(); diff --git a/package.json b/package.json index 9e11fcf0..5e21cefc 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "com.monitor1394.xcharts", "displayName": "XCharts", - "version": "3.0.0", - "date": "20220601", - "checkdate": "20220601", + "version": "3.0.1", + "date": "20220616", + "checkdate": "20220616", "desc": "如果 XCharts 对您有帮助,希望您能在 Github 上点 Star 支持,非常感谢!", "unity": "2018.3", "description": "A charting and data visualization library for Unity.",