From f94f678661dfcabd577c0d46005e8af9a7cc9d3a Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 16 Nov 2023 08:20:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B3=A8=E9=87=8A=E5=92=8C?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/configuration.md | 6 +- Documentation~/zh/configuration.md | 6 +- Runtime/Component/Animation/AnimationStyle.cs | 1 - Runtime/Component/Child/ItemStyle.cs | 1 - Runtime/Component/Child/Location.cs | 1 - Runtime/Component/Label/LabelStyle.cs | 28 ++++++---- Runtime/Component/Radar/RadarCoord.cs | 1 - Runtime/Component/Settings/Settings.cs | 2 - Runtime/Component/Tooltip/Tooltip.cs | 56 ++++++++++++------- Runtime/Component/VisualMap/VisualMap.cs | 2 - Runtime/Coord/Grid/GridCoord.cs | 1 - Runtime/Serie/Serie.cs | 1 - Runtime/Serie/SerieData.cs | 1 - Runtime/Theme/Theme.cs | 2 - Runtime/Theme/ThemeStyle.cs | 1 - Runtime/Theme/VisualMapTheme.cs | 1 - Runtime/Utilities/DateTimeUtil.cs | 16 +++--- 17 files changed, 68 insertions(+), 59 deletions(-) diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 58c5ec17..c128c11e 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -1226,7 +1226,7 @@ Text label of chart, to explain some data information about graphic item like va |autoRotate|false|v3.6.0|auto rotate of label. |distance|||the distance of label to axis line. |formatter|||label content string template formatter. \n line wrapping is supported. Formatters for some components will not take effect.
Template placeholder have the following, some of which apply only to fixed components:
`{.}` : indicates the dot mark.
`{a}` : indicates the series name.
`{b}` : category value or data name.
`{c}` : data value.
`{d}` : percentage.
`{e}` : indicates the data name.
`{f}` : data sum.
`{g}` : indicates the total number of data.
`{h}` : hexadecimal color value.
`{value}` : The value of the axis or legend.
The following placeholder apply to `UITable` components:
`{name}` : indicates the row name of the table.
`{index}` : indicates the row number of the table.
The following placeholder apply to `UIStatistc` components:
`{title}` : title text.
`{dd}` : day.
`{hh}` : hours.
`{mm}` : minutes.
`{ss}` : second.
`{fff}` : milliseconds.
`{d}` : day.
`{h}` : hours.
`{m}` : minutes.
`{s}` : second.
`{f}` : milliseconds.
Example :{b}:{c}
-|numericFormatter|||Standard numeric format string. Used to format numeric values and display them as strings. Use the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N number, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. reference: https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings +|numericFormatter|||Standard number and date format string. Used to format a Double value or a DateTime date as a string. numericFormatter is used as an argument to either `Double.ToString ()` or `DateTime.ToString()`.
The number format uses the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N digit, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. E.g. F1, E2
Date format Common date formats are: yyyy year, MM month, dd day, HH hour, mm minute, ss second, fff millisecond. For example: yyyy-MM-dd HH:mm:ss
number format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
date format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
|width|0||the width of label. If set as default value 0, it means than the label width auto set as the text width. |height|0||the height of label. If set as default value 0, it means than the label height auto set as the text height. |icon|||the sytle of icon. [IconStyle](#iconstyle)| @@ -2219,13 +2219,13 @@ Tooltip component. |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.
- `Auto`: Auto select trigger according to serie type.
| |position||v3.3.0|Type of position.
`Tooltip.Position`:
- `Auto`: Auto. The mobile platform is displayed at the top, and the non-mobile platform follows the mouse position.
- `Custom`: Custom. Fully customize display position (x,y).
- `FixedX`: Just fix the coordinate X. Y follows the mouse position.
- `FixedY`:
| |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. +|titleFormatter|||String template formatter for tooltip title content. \n line wrapping is supported. The placeholder {i} can be set separately to indicate that title is ignored and not displayed. Template variables are {.}, {a}, {b}, {c}, {d}, {e}, {f}, and {g}.
{.} is the dot of the corresponding color of serie currently indicated or index 0.
{a} is the series name name of serie currently indicated or index 0.
{b} is the name of the serie data item serieData currently indicated or index 0, or the category value (such as the X-axis of a line chart).
{c} is the value of the serie y-dimension (dimesion is 1) currently indicated or index is 0.
{d} is the serie y-dimensional (dimesion 1) percentage value of the currently indicated or index 0, note without the % sign.
{e} is the name of the serie data item serieData currently indicated or whose index is 0.
{h} is the hexadecimal color value of serieData for the serie data item currently indicated or index 0.
{f} is the sum of data.
{g} indicates the total number of data.
{.1} represents a dot of the corresponding color with serie specified as index 1.
The 1 in {a1}, {b1}, {c1} represents serie where index is specified as 1.
{c1:2} represents the third data of the current indicator data item in serie with index 1 (one data item has multiple data, index 2 represents the third data).
{c1:2-2} represents the third data of serie third data item with index 1 (that is, the number of data items must be specified when specifying the number of data items).
{d1:2:f2} indicates that a format string with a single value is f2 (numericFormatter is used if no value is specified).
{d:0.##} indicates that the format string with a value specified alone is 0.## # (for percentages, preserving a 2-digit significant number while avoiding the "100.00%" situation with f2).
example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1}, {c1:1-1: f1}" |marker|||the marker of serie. |fixedWidth|0||Fixed width. Higher priority than minWidth. |fixedHeight|0||Fixed height. Higher priority than minHeight. |minWidth|0||Minimum width. If fixedWidth has a value, get fixedWidth first. |minHeight|0||Minimum height. If fixedHeight has a value, take priority over fixedHeight. -|numericFormatter|||Standard numeric format string. Used to format numeric values to display as strings. Using 'Axx' form: 'A' is the single character of the format specifier, supporting 'C' currency, 'D' decimal, 'E' exponent, 'F' number of vertices, 'G' regular, 'N' digits, 'P' percentage, 'R' round tripping, 'X' hex etc. 'XX' is the precision specification, from '0' - '99'. +|numericFormatter|||Standard number and date format string. Used to format a Double value or a DateTime date as a string. numericFormatter is used as an argument to either `Double.ToString ()` or `DateTime.ToString()`.
The number format uses the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N digit, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. E.g. F1, E2
Date format Common date formats are: yyyy year, MM month, dd day, HH hour, mm minute, ss second, fff millisecond. For example: yyyy-MM-dd HH:mm:ss
number format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
date format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
|paddingLeftRight|10||the text padding of left and right. defaut:5. |paddingTopBottom|10||the text padding of top and bottom. defaut:5. |ignoreDataShow|false||Whether to show ignored data on tooltip. diff --git a/Documentation~/zh/configuration.md b/Documentation~/zh/configuration.md index 5180b785..2caeca06 100644 --- a/Documentation~/zh/configuration.md +++ b/Documentation~/zh/configuration.md @@ -1226,7 +1226,7 @@ Drawing grid in rectangular coordinate. Line chart, bar chart, and scatter chart |autoRotate|false|v3.6.0|是否自动旋转。 |distance|||距离轴线的距离。 |formatter|||标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。
模板通配符有以下这些,部分只适用于固定的组件:
`{.}`:圆点标记。
`{a}`:系列名。
`{b}`:类目值或数据名。
`{c}`:数据值。
`{d}`:百分比。
`{e}`:数据名。
`{f}`:数据和。
`{g}`:数据总个数。
`{h}`:十六进制颜色值。
`{value}`:坐标轴或图例的值。
以下通配符适用UITable组件:
`{name}`: 表格的行名。
`{index}`:表格的行号。
以下通配符适用UIStatistc组件:
`{title}`:标题文本。
`{dd}`:天。
`{hh}`:小时。
`{mm}`:分钟。
`{ss}`:秒。
`{fff}`:毫秒。
`{d}`:天。
`{h}`:小时。
`{m}`:分钟。
`{s}`:秒。
`{f}`:毫秒。
示例:“{b}:{c}” -|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 +|numericFormatter|||标准数字和日期格式字符串。用于将Double数值或DateTime日期格式化显示为字符串。numericFormatter用来作为Double.ToString()或DateTime.ToString()的参数。
数字格式使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。如:F1, E2
日期格式常见的格式:yyyy年,MM月,dd日,HH时,mm分,ss秒,fff毫秒。如:yyyy-MM-dd HH:mm:ss
数值格式化参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
日期格式化参考:https://learn.microsoft.com/zh-cn/dotnet/standard/base-types/standard-date-and-time-format-strings |width|0||标签的宽度。一般不用指定,不指定时则自动是文字的宽度。 |height|0||标签的高度。一般不用指定,不指定时则自动是文字的高度。 |icon|||图标样式。 [IconStyle](#iconstyle)| @@ -2218,14 +2218,14 @@ Serie的状态样式。Serie的状态有正常,高亮,淡出,选中四种 |type|||提示框指示器类型。
`Tooltip.Type`:
- `Line`: 直线指示器
- `Shadow`: 阴影指示器
- `None`: 无指示器
- `Corss`: 十字准星指示器。坐标轴显示Label和交叉线。
- `Auto`: 根据serie的类型自动选择显示指示器。
| |trigger|||触发类型。
`Tooltip.Trigger`:
- `Item`: 数据项图形触发,主要在散点图,饼图等无类目轴的图表中使用。
- `Axis`: 坐标轴触发,主要在柱状图,折线图等会使用类目轴的图表中使用。
- `None`: 什么都不触发。
- `Auto`: 根据serie的类型自动选择触发类型。
| |position||v3.3.0|显示位置类型。
`Tooltip.Position`:
- `Auto`: 自适应。移动平台靠顶部显示,非移动平台跟随鼠标位置。
- `Custom`: 自定义。完全自定义显示位置(x,y)。
- `FixedX`: 只固定坐标X。Y跟随鼠标位置。
- `FixedY`:
| -|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用|来表示多个列的分隔。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。
{i}或-表示忽略当前项。 {.}为当前所指示的serie或数据项的对应颜色的圆点。
{a}为当前所指示的serie或数据项的系列名name。
{b}为当前所指示的serie或数据项的数据项serieData的name,或者类目值(如折线图的X轴)。
{c}为当前所指示的serie或数据项的y维(dimesion为1)的数值。
{d}为当前所指示的serie或数据项的y维(dimesion为1)百分比值,注意不带%号。
{e}为当前所指示的serie或数据项的数据项serieData的name。
{f}为当前所指示的serie的默认维度的数据总和。
{g}为当前所指示的serie的数据总个数。
{h}为当前所指示的serie的十六进制颜色值。
{c0}表示当前数据项维度为0的数据。
{c1}表示当前数据项维度为1的数据。
{d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}" +|itemFormatter|||提示框单个serie或数据项内容的字符串模版格式器。支持用 \n 换行。用|来表示多个列的分隔。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。
{i}或-表示忽略当前项。 {.}为当前所指示的serie或数据项的对应颜色的圆点。
{a}为当前所指示的serie或数据项的系列名name。
{b}为当前所指示的serie或数据项的数据项serieData的name,或者类目值(如折线图的X轴)。
{c}为当前所指示的serie或数据项的y维(dimesion为1)的数值。
{d}为当前所指示的serie或数据项的y维(dimesion为1)百分比值,注意不带%号。
{e}为当前所指示的serie或数据项的数据项serieData的name。
{f}为当前所指示的serie的默认维度的数据总和。
{g}为当前所指示的serie的数据总个数。
{h}为当前所指示的serie的十六进制颜色值。
{c0}表示当前数据项维度为0的数据。
{c1}表示当前数据项维度为1的数据。
{d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}" |titleFormatter|||提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。
{.}为当前所指示或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。
{h}为当前所指示或index为0的serie的数据项serieData的十六进制颜色值。
{f}为数据总和。
{g}为数据总个数。
{.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}" |marker|||serie的符号标志。 |fixedWidth|0||固定宽度。比 minWidth 优先。 |fixedHeight|0||固定高度。比 minHeight 优先。 |minWidth|0||最小宽度。如若 fixedWidth 设有值,优先取 fixedWidth。 |minHeight|0||最小高度。如若 fixedHeight 设有值,优先取 fixedHeight。 -|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 +|numericFormatter|||标准数字和日期格式字符串。用于将Double数值或DateTime日期格式化显示为字符串。numericFormatter用来作为Double.ToString()或DateTime.ToString()的参数。
数字格式使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。如:F1, E2
日期格式常见的格式:yyyy年,MM月,dd日,HH时,mm分,ss秒,fff毫秒。如:yyyy-MM-dd HH:mm:ss
数值格式化参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
日期格式化参考:https://learn.microsoft.com/zh-cn/dotnet/standard/base-types/standard-date-and-time-format-strings |paddingLeftRight|10||左右边距。 |paddingTopBottom|10||上下边距。 |ignoreDataShow|false||是否显示忽略数据在tooltip上。 diff --git a/Runtime/Component/Animation/AnimationStyle.cs b/Runtime/Component/Animation/AnimationStyle.cs index 15d48914..4ae085a4 100644 --- a/Runtime/Component/Animation/AnimationStyle.cs +++ b/Runtime/Component/Animation/AnimationStyle.cs @@ -121,7 +121,6 @@ namespace XCharts.Runtime /// Data hiding animation configuration. /// ||数据隐藏动画配置。 /// - /// public AnimationHiding hiding { get { return m_Hiding; } } /// /// Interaction animation configuration. diff --git a/Runtime/Component/Child/ItemStyle.cs b/Runtime/Component/Child/ItemStyle.cs index b5a975c9..b9712fb7 100644 --- a/Runtime/Component/Child/ItemStyle.cs +++ b/Runtime/Component/Child/ItemStyle.cs @@ -214,7 +214,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; } diff --git a/Runtime/Component/Child/Location.cs b/Runtime/Component/Child/Location.cs index 062fd986..0d49d6c7 100644 --- a/Runtime/Component/Child/Location.cs +++ b/Runtime/Component/Child/Location.cs @@ -92,7 +92,6 @@ namespace XCharts.Runtime /// the anchor of text. /// ||Location对应的Anchor锚点 /// - /// public TextAnchor runtimeTextAlignment { get { return m_TextAlignment; } } #if dUI_TextMeshPro diff --git a/Runtime/Component/Label/LabelStyle.cs b/Runtime/Component/Label/LabelStyle.cs index 8af39460..5ae385c4 100644 --- a/Runtime/Component/Label/LabelStyle.cs +++ b/Runtime/Component/Label/LabelStyle.cs @@ -182,14 +182,17 @@ namespace XCharts.Runtime set { if (PropertyUtil.SetClass(ref m_Formatter, value)) SetComponentDirty(); } } /// - /// Standard numeric format string. Used to format numeric values and display them as strings. - /// Use the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N number, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. - /// reference: https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings - /// ||标准数字格式字符串。用于将数值格式化显示为字符串。 - /// 使用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 + /// Standard number and date format string. Used to format a Double value or a DateTime date as a string. numericFormatter is used as an argument to either `Double.ToString ()` or `DateTime.ToString()`.
+ /// The number format uses the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N digit, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. E.g. F1, E2
+ /// Date format Common date formats are: yyyy year, MM month, dd day, HH hour, mm minute, ss second, fff millisecond. For example: yyyy-MM-dd HH:mm:ss
+ /// number format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
+ /// date format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
+ /// ||标准数字和日期格式字符串。用于将Double数值或DateTime日期格式化显示为字符串。numericFormatter用来作为Double.ToString()或DateTime.ToString()的参数。
+ /// 数字格式使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。如:F1, E2
+ /// 日期格式常见的格式:yyyy年,MM月,dd日,HH时,mm分,ss秒,fff毫秒。如:yyyy-MM-dd HH:mm:ss
+ /// 数值格式化参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
+ /// 日期格式化参考:https://learn.microsoft.com/zh-cn/dotnet/standard/base-types/standard-date-and-time-format-strings ///
- /// public string numericFormatter { get { return m_NumericFormatter; } @@ -235,7 +238,6 @@ namespace XCharts.Runtime /// the width of label. If set as default value 0, it means than the label width auto set as the text width. /// ||标签的宽度。一般不用指定,不指定时则自动是文字的宽度。 /// - /// public float width { get { return m_Width; } @@ -245,7 +247,6 @@ namespace XCharts.Runtime /// the height of label. If set as default value 0, it means than the label height auto set as the text height. /// ||标签的高度。一般不用指定,不指定时则自动是文字的高度。 /// - /// public float height { get { return m_Height; } @@ -452,7 +453,14 @@ namespace XCharts.Runtime } else { - dateString = dateTime.ToString(numericFormatter); + try + { + dateString = dateTime.ToString(numericFormatter); + } + catch + { + XLog.Warning("not support datetime formatter:" + numericFormatter); + } } if (!string.IsNullOrEmpty(m_Formatter)) { diff --git a/Runtime/Component/Radar/RadarCoord.cs b/Runtime/Component/Radar/RadarCoord.cs index f6068868..6967ec6e 100644 --- a/Runtime/Component/Radar/RadarCoord.cs +++ b/Runtime/Component/Radar/RadarCoord.cs @@ -133,7 +133,6 @@ namespace XCharts.Runtime /// Radar render type, in which 'Polygon' and 'Circle' are supported. /// ||雷达图绘制类型,支持 'Polygon' 和 'Circle'。 /// - /// public Shape shape { get { return m_Shape; } diff --git a/Runtime/Component/Settings/Settings.cs b/Runtime/Component/Settings/Settings.cs index 3eace0ba..6a073339 100644 --- a/Runtime/Component/Settings/Settings.cs +++ b/Runtime/Component/Settings/Settings.cs @@ -90,7 +90,6 @@ namespace XCharts.Runtime /// ||When the area with gradient is filled, the larger the value, the worse the transition effect. /// ||曲线平滑度。值越小曲线越平滑,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。 /// - /// public float lineSmoothness { get { return m_LineSmoothness; } @@ -102,7 +101,6 @@ namespace XCharts.Runtime /// the higher the number of vertices. When the area with gradient is filled, the larger the value, the worse the transition effect. /// ||线段的分割距离。普通折线图的线是由很多线段组成,段数由该数值决定。值越小段数越多,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。 /// - /// public float lineSegmentDistance { get { return m_LineSegmentDistance; } diff --git a/Runtime/Component/Tooltip/Tooltip.cs b/Runtime/Component/Tooltip/Tooltip.cs index 57747e09..d737f210 100644 --- a/Runtime/Component/Tooltip/Tooltip.cs +++ b/Runtime/Component/Tooltip/Tooltip.cs @@ -181,9 +181,24 @@ namespace XCharts.Runtime set { if (PropertyUtil.SetStruct(ref m_Position, value)) SetAllDirty(); } } /// - /// 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. + /// String template formatter for tooltip title content. \n line wrapping is supported. The placeholder {i} can be set separately to indicate that title is ignored and not displayed. + /// Template variables are {.}, {a}, {b}, {c}, {d}, {e}, {f}, and {g}.
+ /// {.} is the dot of the corresponding color of serie currently indicated or index 0.
+ /// {a} is the series name name of serie currently indicated or index 0.
+ /// {b} is the name of the serie data item serieData currently indicated or index 0, or the category value (such as the X-axis of a line chart).
+ /// {c} is the value of the serie y-dimension (dimesion is 1) currently indicated or index is 0.
+ /// {d} is the serie y-dimensional (dimesion 1) percentage value of the currently indicated or index 0, note without the % sign.
+ /// {e} is the name of the serie data item serieData currently indicated or whose index is 0.
+ /// {h} is the hexadecimal color value of serieData for the serie data item currently indicated or index 0.
+ /// {f} is the sum of data.
+ /// {g} indicates the total number of data.
+ /// {.1} represents a dot of the corresponding color with serie specified as index 1.
+ /// The 1 in {a1}, {b1}, {c1} represents serie where index is specified as 1.
+ /// {c1:2} represents the third data of the current indicator data item in serie with index 1 (one data item has multiple data, index 2 represents the third data).
+ /// {c1:2-2} represents the third data of serie third data item with index 1 (that is, the number of data items must be specified when specifying the number of data items).
+ /// {d1:2:f2} indicates that a format string with a single value is f2 (numericFormatter is used if no value is specified).
+ /// {d:0.##} indicates that the format string with a value specified alone is 0.## # (for percentages, preserving a 2-digit significant number while avoiding the "100.00%" situation with f2).
+ /// example: "{a}, {c}", "{a1}, {c1: f1}", "{a1}, {c1:0: f1}", "{a1}, {c1:1-1: f1}" /// ||提示框标题内容的字符串模版格式器。支持用 \n 换行。可以单独设置占位符{i}表示忽略不显示title。 /// 模板变量有{.}、{a}、{b}、{c}、{d}、{e}、{f}、{g}。
/// {.}为当前所指示或index为0的serie的对应颜色的圆点。
@@ -203,7 +218,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. @@ -237,11 +251,28 @@ namespace XCharts.Runtime /// {c0}表示当前数据项维度为0的数据。
/// {c1}表示当前数据项维度为1的数据。
/// {d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
- /// |表示多个列的分隔。
+ /// |表示多个列的分隔。
/// 示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}" ///
public string itemFormatter { get { return m_ItemFormatter; } set { m_ItemFormatter = value; } } /// + /// Standard number and date format string. Used to format a Double value or a DateTime date as a string. numericFormatter is used as an argument to either `Double.ToString ()` or `DateTime.ToString()`.
+ /// The number format uses the Axx format: A is a single-character format specifier that supports C currency, D decimal, E exponent, F fixed-point number, G regular, N digit, P percentage, R round trip, and X hexadecimal. xx is precision specification, from 0-99. E.g. F1, E2
+ /// Date format Common date formats are: yyyy year, MM month, dd day, HH hour, mm minute, ss second, fff millisecond. For example: yyyy-MM-dd HH:mm:ss
+ /// number format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
+ /// date format reference: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings
+ /// ||标准数字和日期格式字符串。用于将Double数值或DateTime日期格式化显示为字符串。numericFormatter用来作为Double.ToString()或DateTime.ToString()的参数。
+ /// 数字格式使用Axx的形式:A是格式说明符的单字符,支持C货币、D十进制、E指数、F定点数、G常规、N数字、P百分比、R往返、X十六进制的。xx是精度说明,从0-99。如:F1, E2
+ /// 日期格式常见的格式:yyyy年,MM月,dd日,HH时,mm分,ss秒,fff毫秒。如:yyyy-MM-dd HH:mm:ss
+ /// 数值格式化参考:https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings
+ /// 日期格式化参考:https://learn.microsoft.com/zh-cn/dotnet/standard/base-types/standard-date-and-time-format-strings + ///
+ public string numericFormatter + { + get { return m_NumericFormatter; } + set { if (PropertyUtil.SetClass(ref m_NumericFormatter, value)) SetComponentDirty(); } + } + /// /// the marker of serie. /// ||serie的符号标志。 /// @@ -267,21 +298,6 @@ namespace XCharts.Runtime /// public float minHeight { get { return m_MinHeight; } set { m_MinHeight = value; } } /// - /// Standard numeric format string. Used to format numeric values to display as strings. - /// Using 'Axx' form: 'A' is the single character of the format specifier, supporting 'C' currency, - /// 'D' decimal, 'E' exponent, 'F' number of vertices, 'G' regular, 'N' digits, 'P' percentage, - /// 'R' round tripping, 'X' hex etc. 'XX' is the precision specification, from '0' - '99'. - /// ||标准数字格式字符串。用于将数值格式化显示为字符串。 - /// 使用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; } - set { if (PropertyUtil.SetClass(ref m_NumericFormatter, value)) SetComponentDirty(); } - } - /// /// the text padding of left and right. defaut:5. /// ||左右边距。 /// diff --git a/Runtime/Component/VisualMap/VisualMap.cs b/Runtime/Component/VisualMap/VisualMap.cs index 0fd10e30..deee8550 100644 --- a/Runtime/Component/VisualMap/VisualMap.cs +++ b/Runtime/Component/VisualMap/VisualMap.cs @@ -193,7 +193,6 @@ namespace XCharts.Runtime /// || /// 对于连续型数据,自动平均切分成几段,默认为0时自动匹配inRange颜色列表大小。 /// - /// public int splitNumber { get { return m_SplitNumber; } @@ -277,7 +276,6 @@ namespace XCharts.Runtime /// 打开 hoverLink 功能时,鼠标悬浮到 visualMap 组件上时,鼠标位置对应的数值 在 图表中对应的图形元素,会高亮。 /// 反之,鼠标悬浮到图表中的图形元素上时,在 visualMap 组件的相应位置会有三角提示其所对应的数值。 /// - /// public bool hoverLink { get { return m_HoverLink; } diff --git a/Runtime/Coord/Grid/GridCoord.cs b/Runtime/Coord/Grid/GridCoord.cs index 4801785b..8f4ccdc4 100644 --- a/Runtime/Coord/Grid/GridCoord.cs +++ b/Runtime/Coord/Grid/GridCoord.cs @@ -43,7 +43,6 @@ namespace XCharts.Runtime /// When this value is set, the left, right, top, and bottom properties will be invalid. /// ||网格所属的网格布局组件的索引。默认为-1,表示不属于任何网格布局组件。当设置了该值时,left、right、top、bottom属性将失效。 /// - /// public int layoutIndex { get { return m_LayoutIndex; } diff --git a/Runtime/Serie/Serie.cs b/Runtime/Serie/Serie.cs index 546a784c..a6fac691 100644 --- a/Runtime/Serie/Serie.cs +++ b/Runtime/Serie/Serie.cs @@ -798,7 +798,6 @@ namespace XCharts.Runtime /// /// 忽略数据时折线是断开还是连接。默认false为连接。 /// - /// public bool ignoreLineBreak { get { return m_IgnoreLineBreak; } diff --git a/Runtime/Serie/SerieData.cs b/Runtime/Serie/SerieData.cs index af170ba0..c0e79546 100644 --- a/Runtime/Serie/SerieData.cs +++ b/Runtime/Serie/SerieData.cs @@ -106,7 +106,6 @@ namespace XCharts.Runtime /// /// 数据项图例名称。当数据项名称不为空时,图例名称即为系列名称;反之则为索引index。 /// - /// public string legendName { get { return string.IsNullOrEmpty(name) ? ChartCached.IntToStr(index) : name; } } /// diff --git a/Runtime/Theme/Theme.cs b/Runtime/Theme/Theme.cs index dbb27f23..d2eb5704 100644 --- a/Runtime/Theme/Theme.cs +++ b/Runtime/Theme/Theme.cs @@ -277,7 +277,6 @@ namespace XCharts.Runtime /// default theme. /// ||默认主题。 /// - /// public static void ResetToDefaultTheme(Theme theme) { theme.themeType = ThemeType.Default; @@ -303,7 +302,6 @@ namespace XCharts.Runtime /// dark theme. /// ||暗主题。 /// - /// public static void ResetToDarkTheme(Theme theme) { theme.themeType = ThemeType.Dark; diff --git a/Runtime/Theme/ThemeStyle.cs b/Runtime/Theme/ThemeStyle.cs index f83f45f3..7c459b4f 100644 --- a/Runtime/Theme/ThemeStyle.cs +++ b/Runtime/Theme/ThemeStyle.cs @@ -109,7 +109,6 @@ namespace XCharts.Runtime /// you can use 'sync color to custom' to synchronize the theme color to the custom color. It can also be set manually. /// ||是否自定义主题颜色。当设置为true时,可以用‘sync color to custom’同步主题的颜色到自定义颜色。也可以手动设置。 /// - /// public bool enableCustomTheme { get { return m_EnableCustomTheme; } diff --git a/Runtime/Theme/VisualMapTheme.cs b/Runtime/Theme/VisualMapTheme.cs index 5553ba37..f07b952a 100644 --- a/Runtime/Theme/VisualMapTheme.cs +++ b/Runtime/Theme/VisualMapTheme.cs @@ -42,7 +42,6 @@ namespace XCharts.Runtime /// /// 可视化组件的调节三角形边长。 /// - /// public float triangeLen { get { return m_TriangeLen; } diff --git a/Runtime/Utilities/DateTimeUtil.cs b/Runtime/Utilities/DateTimeUtil.cs index 1ff3fa97..7c14cfe5 100644 --- a/Runtime/Utilities/DateTimeUtil.cs +++ b/Runtime/Utilities/DateTimeUtil.cs @@ -19,24 +19,24 @@ namespace XCharts.Runtime private static string s_YearDateFormatter = "yyyy"; //private static string s_MonthDateFormatter = "MM"; //private static string s_DayDateFormatter = "dd"; - private static string s_HourDateFormatter = "HH:mm"; - private static string s_MinuteDateFormatter = "HH:mm"; + //private static string s_HourDateFormatter = "HH:mm"; + //private static string s_MinuteDateFormatter = "mm:ss"; private static string s_SecondDateFormatter = "HH:mm:ss"; - //private static string s_DateFormatter = "yyyy-MM-dd HH:mm:ss"; + //private static string s_FullDateFormatter = "yyyy-MM-dd HH:mm:ss"; public static int GetTimestamp() { - return (int) (DateTime.Now - k_DateTime1970).TotalSeconds; + return (int)(DateTime.Now - k_DateTime1970).TotalSeconds; } public static int GetTimestamp(DateTime time) { - return (int) (time - k_DateTime1970).TotalSeconds; + return (int)(time - k_DateTime1970).TotalSeconds; } public static DateTime GetDateTime(int timestamp) { - long span = ((long) timestamp) * 10000000; + long span = ((long)timestamp) * 10000000; return k_DateTime1970.Add(new TimeSpan(span)); } @@ -61,11 +61,11 @@ namespace XCharts.Runtime } else if (range >= DateTimeUtil.ONE_HOUR * DateTimeUtil.MIN_TIME_SPLIT_NUMBER) { - dateString = dateTime.ToString(s_HourDateFormatter); + dateString = dateTime.ToString(s_SecondDateFormatter); } else if (range >= DateTimeUtil.ONE_MINUTE * DateTimeUtil.MIN_TIME_SPLIT_NUMBER) { - dateString = dateTime.ToString(s_MinuteDateFormatter); + dateString = dateTime.ToString(s_SecondDateFormatter); } else {