From 4f38b59288e9f9f1b844d854c688e67d58d02bcf Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 1 Oct 2024 22:59:59 +0800 Subject: [PATCH 01/20] 3.12.0 --- Documentation~/zh/tutorial01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation~/zh/tutorial01.md b/Documentation~/zh/tutorial01.md index 0eb4eb4b..45cbf830 100644 --- a/Documentation~/zh/tutorial01.md +++ b/Documentation~/zh/tutorial01.md @@ -22,7 +22,7 @@ XCharts是一个Unity图表插件,目前只能在Unity平台使用。 ## XCharts的获取和导入 -XCharts主要通过Github来维护更新和发布,可以到【Github主页】(https://github.com/XCharts-Team)进行下载获取源码和Pacakge;对于无Github访问条件的用户,可以访问[【国内镜像】](https://gitee.com/monitor1394/unity-ugui-XCharts)进行下载。国内镜像的版本更新可能会相对滞后。 +XCharts主要通过Github来维护更新和发布,可以到[【Github主页】](https://github.com/XCharts-Team)进行下载获取源码和Pacakge;对于无Github访问条件的用户,可以访问[【国内镜像】](https://gitee.com/monitor1394/unity-ugui-XCharts)进行下载。国内镜像的版本更新可能会相对滞后。 XCharts可通过以下任意一种方式导入到你的项目: From b0d6bea25638d59c9f3b31e3f938b12f47425247 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sat, 19 Oct 2024 23:23:38 +0800 Subject: [PATCH 02/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=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 | 1 - Documentation~/zh/configuration.md | 1 - README-en.md | 26 +++++++++++++------------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 085b558f..1e84543b 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -2,7 +2,6 @@ sidebar_position: 31 slug: /configuration --- -import APITable from '@site/src/components/APITable'; # Chart Configuration diff --git a/Documentation~/zh/configuration.md b/Documentation~/zh/configuration.md index edc81ed6..47914978 100644 --- a/Documentation~/zh/configuration.md +++ b/Documentation~/zh/configuration.md @@ -2,7 +2,6 @@ sidebar_position: 31 slug: /configuration --- -import APITable from '@site/src/components/APITable'; # 配置项手册 diff --git a/README-en.md b/README-en.md index 6149b131..7b38fc7c 100644 --- a/README-en.md +++ b/README-en.md @@ -1,45 +1,45 @@

- +

-

XCharts

+

XCharts

A powerful, easy-to-use, configurable charting and data visualization library for Unity. -
+
Unity数据可视化图表插件。 -
+
中文文档

- + - + - + - + - + - +

- + - + - +

From dc254fb722581ddb241d08a8a511a1a52929476d Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 21 Oct 2024 08:44:16 +0800 Subject: [PATCH 03/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/api.md | 8 +++----- Documentation~/en/configuration.md | 11 ++++------- Documentation~/en/tutorial01.md | 4 ++-- Documentation~/zh/api.md | 8 +++----- Documentation~/zh/configuration.md | 13 +++++-------- README.md | 4 ++-- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index 7759c74e..6c34fa74 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -3303,7 +3303,7 @@ public static string CheckChart(BaseChart chart) ## ChildComponent -class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) +class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MarqueeStyle](#marqueestyle),[MLValue](#mlvalue),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) ### ChildComponent.anyDirty @@ -6411,8 +6411,6 @@ Configurations of select state. class in XCharts.Runtime / Inherits from: [BaseSerie](#baseserie),[IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=icomparable) / Subclasses: [SerieHandler<T>](#seriehandlert),[Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Pie](#pie),[Radar](#radar),[Ring](#ring),[BaseScatter](#basescatter) -系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 - ### Serie.areaStyle public AreaStyle areaStyle @@ -8612,7 +8610,7 @@ Whether to show ignored data on tooltip. ### Tooltip.itemFormatter public string 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.
{y} is category value of y axis.
{.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}"
+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.
\{y\} is category value of y axis.
\{.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\}"
### Tooltip.marker @@ -8662,7 +8660,7 @@ Whether to show the tooltip floating layer, whose default value is true. It shou ### Tooltip.titleFormatter public string 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.
{y} is category value of y axis.
{.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}" +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.
\{y\} is category value of y axis.
\{.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\}" ### Tooltip.AddSerieDataIndex diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 1e84543b..09657319 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -2,7 +2,6 @@ sidebar_position: 31 slug: /configuration --- - # Chart Configuration ## Serie @@ -1236,7 +1235,7 @@ class in XCharts.Runtime ## ChildComponent -class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) +class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MarqueeStyle](#marqueestyle), [MLValue](#mlvalue), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) ## Comment @@ -2463,7 +2462,7 @@ the distance of label to axis line. `string` -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 of x axis 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.
`{y}` : category value of y axis.
`{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}
+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 of x axis 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.
`\{y\}` : category value of y axis.
`\{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\}
### LabelStyle.height @@ -3400,8 +3399,6 @@ Configurations of select state. class in XCharts.Runtime / Inherits from: [BaseSerie](#baseserie), [IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=IComparable) / Subclasses: [SerieHandler<T>](#seriehandlert), [Bar](#bar), [SimplifiedBar](#simplifiedbar), [Candlestick](#candlestick), [SimplifiedCandlestick](#simplifiedcandlestick), [Heatmap](#heatmap), [Line](#line), [SimplifiedLine](#simplifiedline), [Parallel](#parallel), [Pie](#pie), [Radar](#radar), [Ring](#ring), [BaseScatter](#basescatter) -系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 - ### Serie.align [Align](#align) @@ -4849,7 +4846,7 @@ Whether to show ignored data on tooltip. `string` -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.
{y} is category value of y axis.
{.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}"
+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.
\{y\} is category value of y axis.
\{.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\}"
### Tooltip.itemHeight @@ -4934,7 +4931,7 @@ Whether to show the tooltip floating layer, whose default value is true. It shou `string` -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.
{y} is category value of y axis.
{.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}" +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.
\{y\} is category value of y axis.
\{.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\}" ### Tooltip.titleHeight diff --git a/Documentation~/en/tutorial01.md b/Documentation~/en/tutorial01.md index 782f33b5..52b61256 100644 --- a/Documentation~/en/tutorial01.md +++ b/Documentation~/en/tutorial01.md @@ -1,10 +1,10 @@ --- -title: Tutorial: Getting Started with XCharts 3.0 in 5 Minutes +title: Getting Started with XCharts 3.0 in 5 Minutes sidebar_position: 11 slug: /tutorial01 --- -# Tutorial: Getting Started with XCharts 3.0 in 5 Minutes +# Getting Started with XCharts 3.0 in 5 Minutes > Note: This tutorial is only applicable to the XCharts 3.x version. For the 2.x version, please refer to [Tutorial: Mastering XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/Tutorial%3A5-Minute-Start-to-XCharts.md) diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 8e4e2458..27f26a07 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -3303,7 +3303,7 @@ public static string CheckChart(BaseChart chart) ## ChildComponent -class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) +class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MarqueeStyle](#marqueestyle),[MLValue](#mlvalue),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) ### ChildComponent.anyDirty @@ -6411,8 +6411,6 @@ class in XCharts.Runtime / 继承自: [StateStyle](#statestyle),[ISerieComponent class in XCharts.Runtime / 继承自: [BaseSerie](#baseserie),[IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=icomparable) / 子类: [SerieHandler<T>](#seriehandlert),[Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Pie](#pie),[Radar](#radar),[Ring](#ring),[BaseScatter](#basescatter) -系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 - ### Serie.areaStyle public AreaStyle areaStyle @@ -8612,7 +8610,7 @@ public bool ignoreDataShow ### Tooltip.itemFormatter public string 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的十六进制颜色值。
{y}为当前所指示的serie的y轴的类目值。
{c0}表示当前数据项维度为0的数据。
{c1}表示当前数据项维度为1的数据。
{d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}", "{.}|{b}|{y}" +提示框单个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的十六进制颜色值。
\{y\}为当前所指示的serie的y轴的类目值。
\{c0\}表示当前数据项维度为0的数据。
\{c1\}表示当前数据项维度为1的数据。
\{d3\}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"\{i\}", "\{.\}|\{a\}|\{c\}", "\{.\}|\{b\}|\{c2:f2\}", "\{.\}|\{b\}|\{y\}" ### Tooltip.marker @@ -8662,7 +8660,7 @@ public bool showContent ### Tooltip.titleFormatter public string 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}为数据总个数。
{y}为value所对应的y轴的类目值。
{.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}" +提示框标题内容的字符串模版格式器。支持用 \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\}为数据总个数。
\{y\}为value所对应的y轴的类目值。
\{.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\}" ### Tooltip.AddSerieDataIndex diff --git a/Documentation~/zh/configuration.md b/Documentation~/zh/configuration.md index 47914978..df8f1d9a 100644 --- a/Documentation~/zh/configuration.md +++ b/Documentation~/zh/configuration.md @@ -2,7 +2,6 @@ sidebar_position: 31 slug: /configuration --- - # 配置项手册 ## Serie 系列 @@ -1236,7 +1235,7 @@ class in XCharts.Runtime ## ChildComponent -class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) +class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MarqueeStyle](#marqueestyle), [MLValue](#mlvalue), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) ## Comment @@ -2463,7 +2462,7 @@ class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent), [ISerie `string` -标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。
模板通配符有以下这些,部分只适用于固定的组件:
`{.}`:圆点标记。
`{a}`:系列名。
`{b}`:X轴类目名或数据名。
`{c}`:数据值。
`{d}`:百分比。
`{e}`:数据名。
`{f}`:数据和。
`{g}`:数据总个数。
`{h}`:十六进制颜色值。
`{y}`:Y轴的类目名。
`{value}`:坐标轴或图例的值。
以下通配符适用UITable组件:
`{name}`: 表格的行名。
`{index}`:表格的行号。
以下通配符适用UIStatistc组件:
`{title}`:标题文本。
`{dd}`:天。
`{hh}`:小时。
`{mm}`:分钟。
`{ss}`:秒。
`{fff}`:毫秒。
`{d}`:天。
`{h}`:小时。
`{m}`:分钟。
`{s}`:秒。
`{f}`:毫秒。
示例:“{b}:{c}” +标签内容字符串模版格式器。支持用 \n 换行。部分组件的格式器会不生效。
模板通配符有以下这些,部分只适用于固定的组件:
`\{.\}`:圆点标记。
`\{a\}`:系列名。
`\{b\}`:X轴类目名或数据名。
`\{c\}`:数据值。
`\{d\}`:百分比。
`\{e\}`:数据名。
`\{f\}`:数据和。
`\{g\}`:数据总个数。
`\{h\}`:十六进制颜色值。
`\{y\}`:Y轴的类目名。
`\{value\}`:坐标轴或图例的值。
以下通配符适用UITable组件:
`\{name\}`: 表格的行名。
`\{index\}`:表格的行号。
以下通配符适用UIStatistc组件:
`\{title\}`:标题文本。
`\{dd\}`:天。
`\{hh\}`:小时。
`\{mm\}`:分钟。
`\{ss\}`:秒。
`\{fff\}`:毫秒。
`\{d\}`:天。
`\{h\}`:小时。
`\{m\}`:分钟。
`\{s\}`:秒。
`\{f\}`:毫秒。
示例:“\{b\}:\{c\}” ### LabelStyle.height @@ -3089,7 +3088,7 @@ class in XCharts.Runtime / 继承自: [ChildComponent](#childcomponent) `string` -标线名称,将会作为文字显示。label的formatter可通过{b}显示名称,通过{c}显示数值。 +标线名称,将会作为文字显示。label的formatter可通过\{b\}显示名称,通过\{c\}显示数值。 ### MarkLineData.startSymbol @@ -3400,8 +3399,6 @@ class in XCharts.Runtime / 继承自: [StateStyle](#statestyle), [ISerieComponen class in XCharts.Runtime / 继承自: [BaseSerie](#baseserie), [IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=IComparable) / 子类: [SerieHandler<T>](#seriehandlert), [Bar](#bar), [SimplifiedBar](#simplifiedbar), [Candlestick](#candlestick), [SimplifiedCandlestick](#simplifiedcandlestick), [Heatmap](#heatmap), [Line](#line), [SimplifiedLine](#simplifiedline), [Parallel](#parallel), [Pie](#pie), [Radar](#radar), [Ring](#ring), [BaseScatter](#basescatter) -系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 - ### Serie.align [Align](#align) @@ -4849,7 +4846,7 @@ class in XCharts.Runtime / 继承自: [MainComponent](#maincomponent) `string` -提示框单个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的十六进制颜色值。
{y}为当前所指示的serie的y轴的类目值。
{c0}表示当前数据项维度为0的数据。
{c1}表示当前数据项维度为1的数据。
{d3}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"{i}", "{.}|{a}|{c}", "{.}|{b}|{c2:f2}", "{.}|{b}|{y}" +提示框单个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的十六进制颜色值。
\{y\}为当前所指示的serie的y轴的类目值。
\{c0\}表示当前数据项维度为0的数据。
\{c1\}表示当前数据项维度为1的数据。
\{d3\}表示维度3的数据的百分比。它的分母是默认维度(一般是1维度)数据。
|表示多个列的分隔。
示例:"\{i\}", "\{.\}|\{a\}|\{c\}", "\{.\}|\{b\}|\{c2:f2\}", "\{.\}|\{b\}|\{y\}" ### Tooltip.itemHeight @@ -4934,7 +4931,7 @@ serie的符号标志。 `string` -提示框标题内容的字符串模版格式器。支持用 \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}为数据总个数。
{y}为value所对应的y轴的类目值。
{.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}" +提示框标题内容的字符串模版格式器。支持用 \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\}为数据总个数。
\{y\}为value所对应的y轴的类目值。
\{.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\}" ### Tooltip.titleHeight diff --git a/README.md b/README.md index b5c6d50f..ed6b0807 100644 --- a/README.md +++ b/README.md @@ -133,10 +133,10 @@ ## FAQ -- __XCharts可以免费使用吗?__ +- __XCharts可以免费使用吗?__ `XCharts`使用`MIT`协议,可以免费使用。也可以订阅`VIP`享受更多增值服务。 -- __XCharts支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?__ +- __XCharts支持代码动态添加和修改数据吗?支持从`Excel`或数据库中获取数据吗?__ `XCharts`提供了各种数据操作的接口,支持代码动态修改配置,添加和修改数据,但数据来源需要自己解析和获取,再调用`XCharts`的接口添加到图表。 - __XCharts除了用在Unity平台,还能用在Winform或WPF等平台吗?__ From 143a037761bc283ecc8e411bf84c536bfd6185a1 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 28 Oct 2024 22:25:14 +0800 Subject: [PATCH 04/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/api.md | 6 +- Documentation~/en/changelog.md | 6 +- Documentation~/en/configuration.md | 2 +- Documentation~/en/faq.md | 113 ++++++++++++----------------- Documentation~/en/support.md | 9 +++ Documentation~/en/tutorial01.md | 69 ++++++++++++++---- Documentation~/zh/api.md | 4 +- Documentation~/zh/faq.md | 111 ++++++++++------------------ Documentation~/zh/tutorial01.md | 66 ++++++++++++++--- README-en.md | 11 +-- README.md | 14 +--- 11 files changed, 219 insertions(+), 192 deletions(-) create mode 100644 Documentation~/en/support.md diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index 6c34fa74..cd357de3 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -3,7 +3,7 @@ sidebar_position: 41 slug: /api --- -# Chart API +# API ## All Class @@ -2347,7 +2347,7 @@ public void UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0) ## BaseGraph -class in XCharts.Runtime / Inherits from: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent) +class in XCharts.Runtime / Inherits from: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler), / Subclasses: [BaseChart](#basechart),[UIComponent](#uicomponent) ### BaseGraph.chartHideFlags @@ -5858,7 +5858,7 @@ class in / Subclasses: [XLog](#xlog) ## ObjectPool<T> where T -class in XCharts.Runtime / Inherits from: [new()](#new()) +class in XCharts.Runtime / Inherits from: new() ### ObjectPool<T> where T.countActive diff --git a/Documentation~/en/changelog.md b/Documentation~/en/changelog.md index aa270236..fea77f27 100644 --- a/Documentation~/en/changelog.md +++ b/Documentation~/en/changelog.md @@ -1,5 +1,5 @@ -# 更新日志 +# Changelog [master](#master) [v3.12.0](#v3120) @@ -153,7 +153,7 @@ Changelog Details: ## v3.10.2 * (2024.03.11) Release `v3.10.2` -* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting {d} (#304) +* (2024.03.11) Fix to `Legend`'s `formatter` showing possible mismatches when setting `{d}` (#304) * (2024.03.11) Fix to `Tooltip` still showing after moving out of coordinate system * (2024.03.08) Fixed an issue where `Tooltip`'s title might not appear after upgrading from an older version @@ -629,7 +629,7 @@ Details: * (2022.03.20) Release `v2.7.0` version * (2022.02.21) Fixed chart name repeat check error #183 * (2022.02.17) Fixed bug where axis split line might be displayed outside the coordinate system #181 -* (2022.02.08) Fixed {d} formatter error when value is 0 +* (2022.02.08) Fixed `{d}` formatter error when value is 0 * (2022.02.08) Fixed `YAxis` `AxisLabel`'s `onZero` does not work * (2022.01.06) Improved `Zebra` bar chart diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 09657319..789f7e0f 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -2,7 +2,7 @@ sidebar_position: 31 slug: /configuration --- -# Chart Configuration +# Configuration ## Serie diff --git a/Documentation~/en/faq.md b/Documentation~/en/faq.md index 864f6b49..b2fe30ef 100644 --- a/Documentation~/en/faq.md +++ b/Documentation~/en/faq.md @@ -1,155 +1,122 @@ -# XCharts FAQ +# FAQ -[FAQ 1: How to adjust the margin between the axis and the background?](#how-to-adjust-the-margin-between-the-axis-and-the-background) -[FAQ 2: How to play agian the fadeIn animation?](#how-to-play-agian-the-fadein-animation) -[FAQ 3: How to customize the color of data item in line chart and pie chart?](#how-to-customize-the-color-of-data-item-in-line-chart-and-pie-chart) -[FAQ 4: How to formatter the text of axis label, such as add a units text?](#how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text) -[FAQ 5: How to stack the bar of bar chart](#how-to-stack-the-bar-of-bar-chart) -[FAQ 6: How to make the bar serie in the same bar but not stack?](#how-to-make-the-bar-serie-in-the-same-bar-but-not-stack) -[FAQ 7: How to adjust the bar width and gap of barchart?](#how-to-adjust-the-bar-width-and-gap-of-barchart) -[FAQ 8: How to adjust the color of bar?](#how-to-adjust-the-color-of-bar) -[FAQ 9: Can I adjust the anchor of chart?](#can-i-adjust-the-anchor-of-chart) -[FAQ 10: Can display more than 1000 data?](#can-display-more-than-1000-data) -[FAQ 11: Can line chart drawing be dash, dot and dash-dot?](#can-line-chart-drawing-be-dash-dot-and-dash-dot) -[FAQ 12: How to limit the value range of the Y-axis?](#how-to-limit-the-value-range-of-the-y-axis) -[FAQ 13: How to customize the tick value range of value axis?](#how-to-customize-the-tick-value-range-of-value-axis) -[FAQ 14: How to display text at the top of data items?](#how-to-display-text-at-the-top-of-data-items) -[FAQ 15: How do I customize icons for data items?](#how-do-i-customize-icons-for-data-items) -[FAQ 16: How to anti-aliasing and make the chart smoother?](#how-to-anti-aliasing-and-make-the-chart-smoother) -[FAQ 17: Why does mouse over chart Tooltip not show?](#why-does-mouse-over-chart-tooltip-not-show) -[FAQ 18: How not to display the bar line of Tooltip?](#how-not-to-display-the-bar-line-of-tooltip) -[FAQ 19: How do I customize the display of Tooltip?](#how-do-i-customize-the-display-of-tooltip) -[FAQ 20: How do I get the Y-axis to display multiple decimal places?](#how-do-i-get-the-y-axis-to-display-multiple-decimal-places) -[FAQ 21: How do I dynamically update data with code?](#how-do-i-dynamically-update-data-with-code) -[FAQ 22: How to display legend? Why are legends sometimes not displayed?](#how-to-display-legend-why-are-legends-sometimes-not-displayed) -[FAQ 23: How to make chart as prefab?](#how-to-make-chart-as-prefab) -[FAQ 24: How do I draw custom graphic in chart,such as line or dot?](#how-do-i-draw-custom-content-in-chart-such-as-line-or-dot) -[FAQ 25: How to achieve similar data movement effect of ELECTRO cardiogram?](#how-to-achieve-similar-data-movement-effect-of-electro-cardiogram) -[FAQ 26: How do I use the background component? What are the conditions?](#how-do-i-use-the-background-component-what-are-the-conditions) -[FAQ 27: Mesh can not have more than 65000 vertices?](#mesh-cannot-have-more-than-65000-vertices) -[FAQ 28: Why are the parameters set in Serie reset after they run?](#why-are-the-parameters-set-in-serie-reset-after-they-run) -[FAQ 29: How to change the color of serie symbol?](#how-to-change-the-color-of-serie-symbol) -[FAQ 30: How to deal with TMP errors when importing or updating XCharts?](#what-if-tmp-errors-occur-when-importing-or-updating-xcharts) -[FAQ 31: Support empty data? How to achieve the effect of line chart disconnection?](#support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection) -[FAQ 32: 2.x What are the common problems when upgrading version 3.x?](#what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3) - -## how-to-adjust-the-margin-between-the-axis-and-the-background +## FAQ 1: How to adjust the margin between the axis and the background? `Grid` conponent,which can adjust the left, right, up, down margins of chart. -## how-to-play-agian-the-fadein-animation +## FAQ 2: How to play agian the fadeIn animation? call the `chart.AnimationReset()` API. -## how-to-customize-the-color-of-data-item-in-line chart-and-pie-chart +## FAQ 3: How to customize the color of data item in line chart and pie chart? `Theme`->`colorPalette`, or the sub component `LineStyle` and `ItemStyle` of `Serie`. -## how-to-formatter-the-text-of-axis-label-such-as-add-a-units-text +## FAQ 4: How to formatter the text of axis label, such as add a units text? Adjust `formatter` and `numericFormatter` parameter of `Legend`, `AxisLabel`, `Tooltop`, `SerieLabel`. -## how-to-stack-the-bar-of-bar-chart +## FAQ 5: How to stack the bar of bar chart? Set the `stack` parameter of `Serie`, the series will stack in a bar with the same `stack`. -## how-to-make-the-bar-serie-in-the-same-bar-but-not-stack +## FAQ 6: How to make the bar serie in the same bar but not stack? Set the `barGap` of `Serie` to `-1`,`stack` to null. -## how-to-adjust-the-bar-width-and-gap-of-barchart +## FAQ 7: How to adjust the bar width and gap of barchart? Adjust the `barWidth` and `barGap` parameter of `Serie`, the last `serie`'s `barWidth` and `barGap` are valid when multiple `serie`. -## how-to-adjust-the-color-of-bar +## FAQ 8: How to adjust the color of bar? Adjust the `ItemStyle` of `Data` in `inspector`. -## can-i-adjust-the-anchor-of-chart +## FAQ 9: Can I adjust the anchor of chart? Yes, you can set any one of 16 anchors but the value use default. -## can-display-more-than-1000-data +## FAQ 10: Can display more than 1000 data? Yes. But `UGUI` limits `65000` vertices to a single `Graphic`, so too much data may not be displayed completely. The sampling simplification curve can be turned on by setting the sampling distance `sampleDist`. You can also set some parameters to reduce the number of vertices in the chart to help show more data. Such as reducing the size of the chart, close or reduce the axis of the client drawing, close `Symbol` and `Label` display. A `Normal` line chart occupies fewer vertices than a `Smooth` line chart. The `1.5.0` and above versions can set `large` and `largeThreshold` parameters to enable performance mode. -## can-line-chart-drawing-be-dash-dot-and-dash-dot +## FAQ 11: Can line chart drawing be dash, dot and dash-dot? Yes. Adjust the `lineType` of `Serie`. -## how-to-limit-the-value-range-of-the-y-axis +## FAQ 12: How to limit the value range of the Y-axis? Select the `minMaxType` of `Axis` as `Custom`, then set `min` and `max` to the values you want. -## how-to-customize-the-tick-value-range-of-value-axis +## FAQ 13: How to customize the tick value range of value axis? By default, it is automatically split by the `splitNumber` of `Axis`. Also, you can customize the `interval` to the range you want. -## how-to-display-text-at-the-top-of-data-items +## FAQ 14: How to display text at the top of data items? Adjust the `Label` of `Serie`. -## how-do-i-customize-icons-for-data-items +## FAQ 15: How do I customize icons for data items? Set the `Icon` of `Data` in `Serie`. -## how-to-anti-aliasing-and-make-the-chart-smoother +## FAQ 16: How to anti-aliasing and make the chart smoother? Open the `Anti-Aliasing` setting in `Unity`. Selected the UI Canvas `Render Mode` as `Screen Space-Camera`, selected `MSAA`, set `4` times or higher anti-aliasing. The sawtooth can only be reduced and unavoidable. The higher the pixel, the less obvious the sawtooth is. -## why-does-mouse-over-chart-tooltip-not-show +## FAQ 17: Why does mouse over chart Tooltip not show? Verify `Toolip` is opened. Verify that the parent node of chart has turned off mouse events. -## how-not-to-display-the-bar-line-of-tooltip +## FAQ 18: How not to display the bar line of Tooltip? Set the `type` of `Tooltup` as `None`. Or adjust the parameters of `lineStyle`. -## how-do-i-customize-the-display-of-tooltip +## FAQ 19: How do I customize the display of Tooltip? See the `formatter`, `itemFormatter`, `titleFormatter` parameters of `Tooltip`. -## how-do-i-get-the-y-axis-to-display-multiple-decimal-places +## FAQ 20: How do I get the Y-axis to display multiple decimal places? Set the `numericFormatter` parameter of `AxisLabel`. -## how-do-i-dynamically-update-data-with-code +## FAQ 21: How do I dynamically update data with code? See example: `Example01_UpdateData.cs` -## how-to-display-legend-why-are-legends-sometimes-not-displayed +## FAQ 22: How to display legend? Why are legends sometimes not displayed? First, the `name` in `Serie` must have a value that is not null. Then set `Legend` is `show`, where `data` can be empty by default, indicating that all legends are displayed. If you only want to display part of the `Serie` legend, fill in `data` with the `name` of the legend you want to display. If none of the values in `data` are `name` of the series, the legend will not be displayed. -## how-to-make-chart-as-prefab +## FAQ 23: How to make chart as prefab? Before make prefab, please delete all sub gameObject under chart which auto-created by `XCharts`. -## how-do-i-draw-custom-content-in-chart-such-as-line-or-dot +## FAQ 24: How do I draw custom graphic in chart,such as line or dot? Implement `onCustomDraw` of chart, see `Example12_CustomDrawing.cs`. -## how-to-achieve-similar-data-movement-effect-of-electro-cardiogram +## FAQ 25: How to achieve similar data movement effect of ELECTRO cardiogram? See `Example_Dynamic.cs`. -## how-do-i-use-the-background-component-what-are-the-conditions +## FAQ 26: How do I use the background component? What are the conditions? Setting `show` to `true` for the `background` component. -## mesh-cannot-have-more-than-65000-vertices +## FAQ 27: Mesh can not have more than 65000 vertices? -This is the limit of `UGUI` on the number of vertices for a single `Graphic`. `XCharts` is draw chart on a single `Graphic`, so there is also this limitation. The solution can be referred to: [FAQ 10: Can display more than 1000 data](#can-display-more-than-1000-data) +This is the limit of `UGUI` on the number of vertices for a single `Graphic`. `XCharts` is draw chart on a single `Graphic`, so there is also this limitation. The solution can be referred to: [FAQ 10: Can display more than 1000 data?](#FAQ-10-can-display-more-than-1000-data) -## why-are-the-parameters-set-in-serie-reset-after-they-run +## FAQ 28: Why are the parameters set in Serie reset after they run? Check whether `RemoveData()` and add new `Serie` in the code. If you want to keep the configuration of `Serie`, you can only `ClearData()` which just clear data and then readd the data to the old serie. -## how-to-change-the-color-of-serie-symbol +## FAQ 29: How to change the color of serie symbol? The color of 'Symbol' is the color of 'ItemStyle' used. -## what-if-tmp-errors-occur-when-importing-or-updating-xcharts +## FAQ 30: How to deal with TMP errors when importing or updating XCharts? XCharts does not enable TMP by default, so there are no references to TMP on asmdef. This issue may occur when updating XCharts after TMP is enabled locally. It can be solved in the following two ways: @@ -158,11 +125,23 @@ XCharts does not enable TMP by default, so there are no references to TMP on asm Version ` 3.8.0 ` after adding Daemon [XCharts - Daemon](https://github.com/XCharts-Team/XCharts-Daemon), will be XCharts - Daemon import project, When updating XCharts, the daemon automatically refreshes the asmdef based on the locally enabled TMP to ensure proper compilation. -## support-empty-data-how-to-achieve-the-effect-of-line-chart-disconnection +## FAQ 31: Support empty data? How to achieve the effect of line chart disconnection? `data` of `Serie` is of type `double`, so it cannot represent empty data. Empty data can be achieved by turning on Serie's ignore and specifying ignoreValue. You can also set the ignore parameter for each SerieData. The ignoreLineBreak parameter can be set to disconnect or connect after ignoring data. -## what-are-the-common-problems-when-upgrading-xcharts2-to-xcharts3 +## FAQ 32: 2.x What are the common problems when upgrading version 3.x? 1. `XCharts.Runtime.XChartsMgr` is missing the class attribute `ExtensionOfNativeClass`! 3.x version does not need to mount XChartsMgr, directly delete the `_xcharts_` node on the scene. + +## FAQ 33: How to display a line chart without white space on both sides and start from the 0 coordinate? + +Set the `boundaryGap` parameter of the X-axis. + +## FAQ 34: How to set some Series not to display Tooltips? + +Setting the `itemFormatter` of `itemStyle` in `serie` to `'-'` can ignore `tooltip`. + +## FAQ 35: Sometimes an overlapping line appears in the area line chart when using semi-transparent colors + +This is a bug in the drawing of the area line chart. You can use light opaque colors instead of semi-transparent colors. diff --git a/Documentation~/en/support.md b/Documentation~/en/support.md new file mode 100644 index 00000000..8fbb3ed1 --- /dev/null +++ b/Documentation~/en/support.md @@ -0,0 +1,9 @@ +--- +title: Support +sidebar_position: 51 +slug: /support +--- + +# Support + +For technical support and to purchase additional charts, you can subscribe to the `VIP` service. For details, please send an email to `monitor1394@gmail.com` for consultation. diff --git a/Documentation~/en/tutorial01.md b/Documentation~/en/tutorial01.md index 52b61256..15df1db7 100644 --- a/Documentation~/en/tutorial01.md +++ b/Documentation~/en/tutorial01.md @@ -1,13 +1,16 @@ --- -title: Getting Started with XCharts 3.0 in 5 Minutes +title: Getting Started sidebar_position: 11 slug: /tutorial01 --- -# Getting Started with XCharts 3.0 in 5 Minutes +# Getting Started with XCharts in 5 Minutes +:::warning -> Note: This tutorial is only applicable to the XCharts 3.x version. For the 2.x version, please refer to [Tutorial: Mastering XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/Tutorial%3A5-Minute-Start-to-XCharts.md) +Note: This tutorial is only applicable to the XCharts 3.x version. For the 2.x version, please refer to [Tutorial: Mastering XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md) + +::: ## Prerequisites for XCharts @@ -55,7 +58,11 @@ The import method of XCharts-Daemon can refer to the previous import method of X After importing XCharts and compiling, the XCharts menu will appear in the Unity editor's menu bar, and you can start using XCharts. ->Note: The XCharts menu in the Unity menu bar indicates that XCharts is available. +:::tip + +Note: The XCharts menu in the Unity menu bar indicates that XCharts is available. + +::: ### Adding a Simple Chart @@ -86,7 +93,11 @@ In the `Inspector` view, find the `LineChart` panel, and click the `Add Serie` b ![op_addserie](img/tutorial01_addserie.png) ![linechart2](img/tutorial01_linechart2.png) ->Note: Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/docs/configuration#serie-系列) +:::tip + +Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/docs/configuration#serie-系列) + +::: ### Adding Other Main Components @@ -94,7 +105,11 @@ By default, the chart does not have a `Legend`. If you need a `Legend` component ![op_addcomponent](img/tutorial01_addcomponent.png) ->Note: Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件) +:::tip + +Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件) + +::: ### Adding Serie Components @@ -103,7 +118,11 @@ Serie only comes with a few common components, and other components need to be a ![op_addseriecomponent](img/tutorial01_addseriecomponent.png) ![linechart3](img/tutorial01_linechart3.png) ->Note: Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件) +:::tip + +Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件) + +::: ### Adding SerieData Components @@ -112,7 +131,11 @@ If you need to customize the configuration of each data item individually, you c ![op_addseriedatacomponent](img/tutorial01_addseriedatacomponent.png) ![linechart4](img/tutorial01_linechart4.png) ->Note: SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) +:::tip + +SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) + +::: ### More Components and Configuration Parameters @@ -133,7 +156,11 @@ To quickly locate the component corresponding to the effect you want to change, 2. If the `ItemStyle` of `Serie` has a color value other than `0000`, this color value is used. 3. Otherwise, the color value is taken from the `Color Palette` of the theme `Theme`. ->Note: The color value is usually `0000` when using the default color of the theme; other parameters are `0` or null when using the default configuration of the theme; pay attention to transparency when setting colors. +:::tip + +The color value is usually `0000` when using the default color of the theme; other parameters are `0` or null when using the default configuration of the theme; pay attention to transparency when setting colors. + +::: ### Adding a Line Chart with Code @@ -214,7 +241,11 @@ Now, a simple line chart is ready: If there are multiple series in a Chart, the data of Axis only needs to be added once, and should not be repeated in multiple loops. ->Remember: The number of Axis data should be consistent with the number of Serie data. +:::tip + +Remember: The number of Axis data should be consistent with the number of Serie data. + +::: For the complete code, please refer to `Examples`: `Example13_LineSimple.cs` @@ -229,7 +260,11 @@ The default font used by XCharts is Unity's default font `Arial`, which may not After the font is set, newly created charts will use the newly set font. For old charts, you can click the `Rebuild Chart Object` button to refresh. ->Note: It is recommended to set the font before using XCharts; when updating XCharts, pay attention to the potential restoration of the set font. +:::tip + +It is recommended to set the font before using XCharts; when updating XCharts, pay attention to the potential restoration of the set font. + +::: ### Using TextMeshPro @@ -271,7 +306,11 @@ XCharts has an automatic refresh mechanism, but it is also triggered under certa 2. `chart.RefreshChart()`: Refresh chart rendering, which only refreshes the rendering part and will not refresh component text, position, etc. 3. Each component can also refresh itself by calling `SetAllDirty()`. ->Note: Use APIs to manipulate data and various lists, not directly access the list for processing. +:::tip + +Use APIs to manipulate data and various lists, not directly access the list for processing. + +::: ### Changing Parameters on Main Components @@ -288,7 +327,11 @@ xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; ``` -> Note: In older versions without the `EnsureChartComponent()` interface, use `GetOrAddChartComponent()` +:::tip + +In older versions without the `EnsureChartComponent()` interface, use `GetOrAddChartComponent()` + +::: ### Changing Serie Parameters diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 27f26a07..1f0e6018 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -2347,7 +2347,7 @@ public void UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0) ## BaseGraph -class in XCharts.Runtime / 继承自: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler),[](#) / 子类: [BaseChart](#basechart),[UIComponent](#uicomponent) +class in XCharts.Runtime / 继承自: [MaskableGraphic](https://docs.unity3d.com/ScriptReference/30_search.html?q=maskablegraphic),[IPointerDownHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointerdownhandler),[IPointerUpHandler](https://docs.unity3d.com/ScriptReference/30_search.html?q=ipointeruphandler), / 子类: [BaseChart](#basechart),[UIComponent](#uicomponent) ### BaseGraph.chartHideFlags @@ -5858,7 +5858,7 @@ class in / 子类: [XLog](#xlog) ## ObjectPool<T> where T -class in XCharts.Runtime / 继承自: [new()](#new()) +class in XCharts.Runtime / 继承自: new() ### ObjectPool<T> where T.countActive diff --git a/Documentation~/zh/faq.md b/Documentation~/zh/faq.md index 66bca650..473d55d1 100644 --- a/Documentation~/zh/faq.md +++ b/Documentation~/zh/faq.md @@ -5,162 +5,123 @@ slug: /faq # 常见问题 -[FAQ 1:如何调整坐标轴与背景的边距?](#如何调整坐标轴与背景的边距) -[FAQ 2:如何让初始动画重新播放?](#如何让初始动画重新播放) -[FAQ 3:如何自定义折线图饼图的颜色?](#如何自定义折线图饼图的颜色) -[FAQ 4:如何给坐标轴上的文本加上单位?](#如何给坐标轴上的文本加上单位) -[FAQ 5:如何让柱形图的柱子堆叠显示?](#如何让柱形图的柱子堆叠显示) -[FAQ 6:如何让柱形图的柱子同柱但不重叠?](#如何让柱形图的柱子同柱但不重叠) -[FAQ 7:如何调整柱形图的柱子宽度和间距?](#如何调整柱形图的柱子宽度和间距) -[FAQ 8:如何调整柱形图单个柱子的颜色?](#如何调整柱形图单个柱子的颜色) -[FAQ 9:如何调整图表的对齐方式?](#如何调整图表的对齐方式) -[FAQ 10:可以显示超过1000以上的大数据吗?](#可以显示超过1000以上的大数据吗) -[FAQ 11:折线图可以画虚线、点线、点划线吗?](#折线图可以画虚线点线点划线吗) -[FAQ 12:如何限定Y轴的值范围?](#如何限定y轴的值范围) -[FAQ 13:如何自定义数值轴刻度大小?](#如何自定义数值轴刻度大小) -[FAQ 14:如何在数据项顶上显示文本?](#如何在数据项顶上显示文本) -[FAQ 15:如何给数据项自定义图标?](#如何给数据项自定义图标) -[FAQ 16:锯齿太严重,如何让图表更顺滑?](#锯齿太严重如何让图表更顺滑) -[FAQ 17:为什么鼠标移上图表Tooltip不显示?](#为什么鼠标移上图表tooltip不显示) -[FAQ 18:如何取消Tooltip的竖线?](#如何取消tooltip的竖线) -[FAQ 19:如何自定义Tooltip的显示内容?](#如何自定义tooltip的显示内容) -[FAQ 20:如何让y轴显示多位小数?](#如何让y轴显示多位小数) -[FAQ 21:如何用代码动态更新数据?](#如何用代码动态更新数据) -[FAQ 22:如何显示图例?为什么有时候图例无法显示?](#如何显示图例为什么有时候图例无法显示) -[FAQ 23:如何做成预设?](#如何做成预设) -[FAQ 24:如何在图表上画点画线等自定义内容?](#如何在图表上画点画线等自定义内容) -[FAQ 25:如何实现心电图类似的数据移动效果?](#如何实现心电图类似的数据移动效果) -[FAQ 26:如何使用背景组件?有什么条件限制?](#如何使用背景组件有什么条件限制) -[FAQ 27:Mesh can not have more than 65000 vertices?](#mesh_cannot_have_more_than_65000_vertices) -[FAQ 28:为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了) -[FAQ 29:如何修改serie的symbol的颜色?](#如何修改serie的symbol的颜色) -[FAQ 30:导入或更新XCharts时TMP报错如何处理?](#导入或更新xcharts时tmp报错怎么办) -[FAQ 31:支持空数据吗?如何实现折线图断开的效果?](#支持空数据吗如何实现折线图断开的效果) -[FAQ 32:2.x版本升级3.x版本时常见的问题有哪些?](#xcharts2升级xcharts3时常见的问题有哪些) -[FAQ 33:折线图如何两边不留空白而从0坐标开始显示?](#折线图如何两边不留空白而从0坐标开始显示) -[FAQ 34:如何设置部分Serie不显示Tooltip?](#如何设置部分serie不显示tooltip) - -## 如何调整坐标轴与背景的边距 +## FAQ 1:如何调整坐标轴与背景的边距? 调整`Grid`组件,可调整上下左右边距。 -## 如何让初始动画重新播放 +## FAQ 2:如何让初始动画重新播放? 调用`chart.AnimationReset()`接口。 -## 如何自定义折线图饼图的颜色 +## FAQ 3:如何自定义折线图饼图的颜色? 通过`Theme`的`colorPalette`调整,或者部分`Serie`下的`LineStyle`和`ItemStyle`。 -## 如何给坐标轴上的文本加上单位 +## FAQ 4:如何给坐标轴上的文本加上单位? 通过`formatter`和`numericFormatter`参数,在`Legend`、`Axis`的`AxisLabel`、`Tooltop`、`Serie`的`Label`都提供该参数的配置。 -## 如何让柱形图的柱子堆叠显示 +## FAQ 5:如何让柱形图的柱子堆叠显示? 设置`Serie`下的`stack`,`stack`相同的`serie`会堆叠显示在一个柱子上。 -## 如何让柱形图的柱子同柱但不重叠 +## FAQ 6:如何让柱形图的柱子同柱但不重叠? 设置`Serie`下的`barGap`为`-1`,`stack`为空。 -## 如何调整柱形图的柱子宽度和间距 +## FAQ 7:如何调整柱形图的柱子宽度和间距? 调整`Serie`下的`barWidth`和`barGap`,多个`serie`时最后一个`serie`的`barWidth`和`barGap`有效。 -## 如何调整柱形图单个柱子的颜色 +## FAQ 8:如何调整柱形图单个柱子的颜色? 可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。 -## 如何调整图表的对齐方式 +## FAQ 9:如何调整图表的对齐方式? 调整RectTransform的锚点,和UGUI的其他组件的用法一致。 -## 可以显示超过1000以上的大数据吗 +## FAQ 10:可以显示超过1000以上的大数据吗? 可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie`的`symbol`和`label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large`和`largeThreshold`参数来开启性能模式。 -## 折线图可以画虚线点线点划线吗 +## FAQ 11:折线图可以画虚线、点线、点划线吗? 可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。 -## 如何限定y轴的值范围 +## FAQ 12:如何限定Y轴的值范围? 设置`Axis`下的`minMaxType`为`Custom`,自定义`min`和`max`。 -## 如何自定义数值轴刻度大小 +## FAQ 13:如何自定义数值轴刻度大小? 默认时通过`Axis`下的`splitNumer`进行自动划分。也可以设置`interval`自定义刻度大小。 -## 如何在数据项顶上显示文本 +## FAQ 14:如何在数据项顶上显示文本? 通过设置`Serie`下的`Label`。3.0版本需要先添加`LabelStyle`组件。 -## 如何给数据项自定义图标 +## FAQ 15:如何给数据项自定义图标? 通过设置`Serie`的`data`下的数据项可单独设置`icon`相关参数。 -## 锯齿太严重如何让图表更顺滑 +## FAQ 16:锯齿太严重,如何让图表更顺滑? 开启抗锯齿设置(在`Unity`里设置)。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。 -## 为什么鼠标移上图表tooltip不显示 +## FAQ 17:为什么鼠标移上图表Tooltip不显示? 确认`Tooltip`是否开启;确认父节点是否关闭了鼠标事件。 -## 如何取消tooltip的竖线 +## FAQ 18:如何取消Tooltip的竖线? 设置`Tooltip`的`type`为`None`。或者调整`lineStyle`的参数。 -## 如何自定义tooltip的显示内容 +## FAQ 19:如何自定义Tooltip的显示内容? 自定义总的内容可以通过`Tooltip`的`formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter`和`titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie`的`itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](https://xcharts-team.github.io/docs/configuration#Tooltip-itemFormatter)。 -## 如何让y轴显示多位小数 +## FAQ 20:如何让y轴显示多位小数? 设置`Axis`下的`AxisLabel`中的`formatter`为`{value:f1}`或`{value:f2}`。`1.5.0`及以上版本通过`numericFormatter`设置。 -## 如何用代码动态更新数据 +## FAQ 21:如何用代码动态更新数据? 请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能,相关API请查看文档:[XChartsAPI接口](api.md) 。 -## 如何显示图例为什么有时候图例无法显示 +## FAQ 22:如何显示图例?为什么有时候图例无法显示? 首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例的`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示。 -## 如何做成预设 +## FAQ 23:如何做成预设? 做成prefab前,执行一下`Rebuild Chart Object`重新刷新节点,避免有冗余的节点存在。 -## 如何在图表上画点画线等自定义内容 +## FAQ 24:如何在图表上画点画线等自定义内容? `XCharts`有自定义绘制回调`onCustomDraw`,具体可参考`Example12_CustomDrawing.cs` -## 如何实现心电图类似的数据移动效果 +## FAQ 25:如何实现心电图类似的数据移动效果? 参考`Example`目录下的`Example_Dynamic.cs`。主要通过设置`maxCache`参数实现。`axis`和`serie`都设置相同的`maxCache`。`maxCache`可固定数据个数,当数据超过设定时会先删除第一个在添加新数据,实现数据移动效果。 -## 如何使用背景组件有什么条件限制 +## FAQ 26:如何使用背景组件?有什么条件限制? 设置`background`组件的`show`为`true`。 -## 区域折线图在用半透明颜色时有时候会一条叠加的线 - -这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。 - -## mesh_cannot_have_more_than_65000_vertices +## FAQ 27:Mesh can not have more than 65000 vertices? 这是`UGUI`对单个`Graphic`的顶点数限制。`XCharts`是将图形绘制在单个`Graphic`上,所以也会有这个限制。解决的办法可以参考:[FAQ 10:可以显示超过1000以上的大数据吗?](#可以显示超过1000以上的大数据吗) -## 为什么serie里设置的参数运行后又被重置了 +## FAQ 28:为什么serie里设置的参数运行后又被重置了? 检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。 -## 如何修改serie的symbol的颜色 +## FAQ 29:如何修改serie的symbol的颜色? `Symbol` 的颜色是使用的 `ItemStyle` 的 `color`。 -## 导入或更新xcharts时tmp报错怎么办 +## FAQ 30:导入或更新XCharts时TMP报错如何处理? XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决: @@ -169,19 +130,23 @@ XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开 `3.8.0`版本后增加[XCharts-Daemon](https://github.com/XCharts-Team/XCharts-Daemon)守护程序,将XCharts-Daemon导入项目后,在更新XCharts时守护程序会自动根据本地开启的TMP情况刷新asmdef,确保编译正常。 -## 支持空数据吗如何实现折线图断开的效果 +## FAQ 31:支持空数据吗?如何实现折线图断开的效果? `Serie`的`data`是`double`类型,所以无法表示空数据。可通过开启`Serie`的`ignore`和指定`ignoreValue`来达到空数据的效果。也可以每个`SerieData`设置`ignore`参数。忽略数据后断开还是连接可设置`ignoreLineBreak`参数。 -## xcharts2升级xcharts3时常见的问题有哪些 +## FAQ 32:2.x版本升级3.x版本时常见的问题有哪些? 1. 'XCharts.Runtime.XChartsMgr' is missing the class attribute 'ExtensionOfNativeClass'! 3.x版本时不需要挂载XChartsMgr,直接删掉场景上的`_xcharts_`节点即可。 -## 折线图如何两边不留空白而从0坐标开始显示 +## FAQ 33:折线图如何两边不留空白而从0坐标开始显示? 设置X轴的`boundaryGap`参数。 -## 如何设置部分serie不显示tooltip +## FAQ 34:如何设置部分Serie不显示Tooltip? `serie`的`itemStyle`的`itemFormatter`设置为`-`可以忽略`tooltip`。 + +## FAQ 35:区域折线图在用半透明颜色时有时候会一条叠加的线 + +这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。 diff --git a/Documentation~/zh/tutorial01.md b/Documentation~/zh/tutorial01.md index 45cbf830..817e9dc9 100644 --- a/Documentation~/zh/tutorial01.md +++ b/Documentation~/zh/tutorial01.md @@ -6,7 +6,11 @@ slug: /tutorial01 # 教程:5分钟上手 XCharts 3.0 -> Note:本教程仅适用XCharts 3.x版本,2.x版本请看 [教程:5分钟上手XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/教程:5分钟上手XCharts.md) +:::warning + +Note:本教程仅适用XCharts 3.x版本,2.x版本请看 [教程:5分钟上手XCharts 2.0](https://github.com/XCharts-Team/XCharts/blob/2.0/Doc/教程:5分钟上手XCharts.md) + +::: ## XCharts的前提条件 @@ -54,7 +58,11 @@ XCharts-Daemon的导入方式可参考刚才的XCharts导入方式。可以通 导入XCharts并编译通过后,Unity编辑器的菜单栏会显示XCharts,这时可以开始使用XCharts了。 ->Note:Unity的菜单栏出现XCharts菜单时才表示XCharts可用。 +:::tip + +Unity的菜单栏出现XCharts菜单时才表示XCharts可用。 + +::: ### 添加一个简单图表 @@ -85,7 +93,11 @@ Serie支持多维数据,一般折线图只用到二维数据:第一维表示 ![op_addserie](img/tutorial01_addserie.png) ![linechart2](img/tutorial01_linechart2.png) ->Note:Serie通过`Add Serie`按钮添加。可添加不同类型的Serie。[XCharts有哪些Serie?](https://xcharts-team.github.io/docs/configuration#serie-系列) +:::tip + +Serie通过`Add Serie`按钮添加。可添加不同类型的Serie。[XCharts有哪些Serie?](https://xcharts-team.github.io/docs/configuration#serie-系列) + +::: ### 添加其他主组件 @@ -93,7 +105,11 @@ Serie支持多维数据,一般折线图只用到二维数据:第一维表示 ![op_addcomponent](img/tutorial01_addcomponent.png) ->Note:主组件通过`Add Component`按钮添加。[XCharts有哪些主组件?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件) +:::tip + +主组件通过`Add Component`按钮添加。[XCharts有哪些主组件?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件) + +::: ### 添加Serie组件 @@ -102,7 +118,11 @@ Serie只自带了几个常见的组件,其他组件用到时需额外添加。 ![op_addseriecomponent](img/tutorial01_addseriecomponent.png) ![linechart3](img/tutorial01_linechart3.png) ->Note:Serie组件通过Serie右边的按钮添加。[XCharts有哪些Serie组件?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件) +:::tip + +Serie组件通过Serie右边的按钮添加。[XCharts有哪些Serie组件?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件) + +::: ### 添加SerieData组件 @@ -111,7 +131,11 @@ Serie只自带了几个常见的组件,其他组件用到时需额外添加。 ![op_addseriedatacomponent](img/tutorial01_addseriedatacomponent.png) ![linechart4](img/tutorial01_linechart4.png) ->Note:SerieData组件通过展开SerieData后Component右边的按钮添加。[XCharts有哪些SerieData组件?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) +:::tip + +SerieData组件通过展开SerieData后Component右边的按钮添加。[XCharts有哪些SerieData组件?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) + +::: ### 更多组件和配置参数 @@ -131,7 +155,11 @@ XCharts是数据和参数驱动的。想要什么效果,只需要去调整对 2. 如果`Serie`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。 3. 否则颜色值取自主题`Theme`的`Color Palette`。 ->Note:通常颜色值为0000时表示用主题默认颜色;其他参数为0或null时表示用主题默认配置;设置颜色时注意透明度。 +:::tip + +通常颜色值为0000时表示用主题默认颜色;其他参数为0或null时表示用主题默认配置;设置颜色时注意透明度。 + +::: ### 用代码添加折线图 @@ -212,7 +240,11 @@ for (int i = 0; i < 10; i++) 如果一个Chart里面有多个系列时,则Axis的data只需要加一次,不要多个循环加重复了。 ->记住:Axis的数据个数要和Serie的数据个数一致。 +:::danger + +请确保Axis的数据个数和Serie的数据个数一致。 + +::: 完整代码请查阅`Examples`:`Example13_LineSimple.cs` @@ -227,7 +259,11 @@ XCharts默认使用的是Unity默认字体`Arial`,在WebGL平台上可能无 字体设置好后,新创建的图表就会用新设置的字体了。对于旧图表,可以点击`Rebuild Chart Object`进行刷新。 ->Note:使用XCharts前建议先设置好字体;更新XCharts时注意设置的字体可能被还原的问题。 +:::warning + +使用XCharts前建议先设置好字体;更新XCharts时注意设置的字体可能被还原的问题。 + +::: ### 使用TextMeshPro @@ -269,7 +305,11 @@ XCharts内部有自动刷新机制,但也是在一定条件才会触发。如 2. `chart.RefreshChart()`:刷新图表绘制,只刷新绘制部分,不会刷新组件文本,位置等部分。 3. 各个组件也可以通过`SetAllDirty()`只刷新自己。 ->Note:用API去操作数据和各种list,而不是直接访问list进行处理 +:::danger + +用API去操作数据和各种list,而不是直接访问list进行处理 + +::: ### 改主组件上的参数 @@ -286,7 +326,11 @@ xAxis.boundaryGap = true; xAxis.type = Axis.AxisType.Category; ``` -> 注:低版本没有`EnsureChartComponent()`接口时,用`GetOrAddChartComponent()` +:::note + +低版本没有`EnsureChartComponent()`接口时,用`GetOrAddChartComponent()` + +::: ### 改Serie的参数 diff --git a/README-en.md b/README-en.md index 7b38fc7c..d19e3bcd 100644 --- a/README-en.md +++ b/README-en.md @@ -1,14 +1,7 @@

- - - -

-

XCharts

-

+

XCharts

A powerful, easy-to-use, configurable charting and data visualization library for Unity. -
- Unity数据可视化图表插件。 -
+
Unity数据可视化图表插件。
中文文档

diff --git a/README.md b/README.md index ed6b0807..9080dd4c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,8 @@ + +

- - - -

-

XCharts

-

- A powerful, easy-to-use, configurable charting and data visualization library for Unity. -
- Unity数据可视化图表插件。 -
+

XCharts

+ A powerful, easy-to-use, configurable charting and data visualization library for Unity.
Unity数据可视化图表插件。
English README

From d0d25b0221db6c3d4d7d4ad83250790b496d6e27 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Thu, 31 Oct 2024 23:28:46 +0800 Subject: [PATCH 05/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/changelog.md | 8 ++++++-- Documentation~/en/faq.md | 5 +++++ Documentation~/zh/faq.md | 7 +++---- README-en.md | 10 +++++----- README.md | 5 +++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Documentation~/en/changelog.md b/Documentation~/en/changelog.md index fea77f27..4011a0e0 100644 --- a/Documentation~/en/changelog.md +++ b/Documentation~/en/changelog.md @@ -1,3 +1,7 @@ +--- +sidebar_position: 61 +slug: /changelog +--- # Changelog @@ -171,7 +175,7 @@ Highlights: * Added chart border Settings to support rounded corner charts * Fixed several issues -Extended features: +Extension features: * Added `SankeyChart` Sankey chart * Added `border` Settings for `UITable` @@ -212,7 +216,7 @@ Highlights: * Perfect code comments and documentation * Fixed several issues -Extended features: +Extension features: * `UITable` adds the carousel function * `UITable` adds data api and callback functions diff --git a/Documentation~/en/faq.md b/Documentation~/en/faq.md index b2fe30ef..7fc1e938 100644 --- a/Documentation~/en/faq.md +++ b/Documentation~/en/faq.md @@ -1,3 +1,8 @@ +--- +sidebar_position: 41 +slug: /faq +--- + # FAQ ## FAQ 1: How to adjust the margin between the axis and the background? diff --git a/Documentation~/zh/faq.md b/Documentation~/zh/faq.md index 473d55d1..de36f976 100644 --- a/Documentation~/zh/faq.md +++ b/Documentation~/zh/faq.md @@ -123,7 +123,7 @@ slug: /faq ## FAQ 30:导入或更新XCharts时TMP报错如何处理? -XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决: +XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式的任意一种解决: 1. 找到`XCharts.Runtime.asmdef`和`XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用 2. 移除`PlayerSetting`中`Scripting Define Symbols`的`dUI_TextMeshPro`宏 @@ -136,8 +136,7 @@ XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开 ## FAQ 32:2.x版本升级3.x版本时常见的问题有哪些? -1. 'XCharts.Runtime.XChartsMgr' is missing the class attribute 'ExtensionOfNativeClass'! -3.x版本时不需要挂载XChartsMgr,直接删掉场景上的`_xcharts_`节点即可。 +1. 出现:`'XCharts.Runtime.XChartsMgr' is missing the class attribute 'ExtensionOfNativeClass'!`的问题时,是因为3.x版本时不需要挂载XChartsMgr,直接删掉场景上的`_xcharts_`节点即可。 ## FAQ 33:折线图如何两边不留空白而从0坐标开始显示? @@ -145,7 +144,7 @@ XCharts默认时不开启TMP,所以asmdef上没有TMP的引用。当本地开 ## FAQ 34:如何设置部分Serie不显示Tooltip? -`serie`的`itemStyle`的`itemFormatter`设置为`-`可以忽略`tooltip`。 +`serie`的`itemStyle`的`itemFormatter`设置为`-`可以忽略该`serie`的`tooltip`。 ## FAQ 35:区域折线图在用半透明颜色时有时候会一条叠加的线 diff --git a/README-en.md b/README-en.md index d19e3bcd..d72ef048 100644 --- a/README-en.md +++ b/README-en.md @@ -1,8 +1,8 @@

XCharts

- A powerful, easy-to-use, configurable charting and data visualization library for Unity. -
Unity数据可视化图表插件。
- 中文文档 +

A powerful, easy-to-use, configurable charting and data visualization library for Unity.
+ Unity数据可视化图表插件。

+

中文文档

@@ -40,14 +40,14 @@ ## Overview -A powerful and easy-to-use data visualization library for Unity. It supports more than ten built-in charts, including line, bar, pie, radar, scatter, heatmap, ring, candlestick, polar, parallel coordinates, as well as extended charts such as 3d pie, 3d bar, 3d pyramid, funnel, gauge, liquid, pictorialbar, gantt, treemap, sankey, line3d and graph chart. +A powerful and easy-to-use data visualization library for Unity. It supports more than ten built-in charts, including line, bar, pie, radar, scatter, heatmap, ring, candlestick, polar, parallel coordinates, as well as extension charts such as 3d pie, 3d bar, 3d pyramid, funnel, gauge, liquid, pictorialbar, gantt, treemap, sankey, line3d and graph chart. ## Key Features - __Pure Code Rendering__: Charts are rendered with pure code, eliminating the need for extra texture or shader resources. - __Visual Configuration__: Configure parameters visually with real-time preview and support for dynamic configuration and data adjustments at runtime. - __High Customizability__: Themes and configuration parameters can be adjusted as needed, with support for custom drawing and callbacks. -- __Built-in and Extended Charts__: Supports a variety of chart types, including 3D charts and special chart types like gauges and treemaps. +- __Built-in and Extension Charts__: Supports a variety of chart types, including 3D charts and special chart types like gauges and treemaps. - __Multiple Chart Combinations__: Combine multiple charts of the same or different types within a single instance. - __Various Coordinate Systems__: Supports different coordinate systems such as Cartesian, polar, and single axes. - __Rich Components__: Includes titles, legends, tooltips, and more. diff --git a/README.md b/README.md index 9080dd4c..1963eb98 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@

XCharts

- A powerful, easy-to-use, configurable charting and data visualization library for Unity.
Unity数据可视化图表插件。
-
English README +

A powerful, easy-to-use, configurable charting and data visualization library for Unity.
+ Unity数据可视化图表插件。

+

English README

From 45972a4cd9209f987d72d05f702f863e3b8da824 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Fri, 1 Nov 2024 08:22:36 +0800 Subject: [PATCH 06/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-en.md | 7 +++---- README.md | 8 +++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README-en.md b/README-en.md index d72ef048..e8ebf588 100644 --- a/README-en.md +++ b/README-en.md @@ -1,8 +1,7 @@ +

XCharts

-

XCharts

-

A powerful, easy-to-use, configurable charting and data visualization library for Unity.
- Unity数据可视化图表插件。

-

中文文档

+A powerful, easy-to-use, configurable charting and data visualization library for Unity.
Unity数据可视化图表插件。
+中文文档

diff --git a/README.md b/README.md index 1963eb98..b86ce426 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ - +

XCharts

-

XCharts

-

A powerful, easy-to-use, configurable charting and data visualization library for Unity.
- Unity数据可视化图表插件。

-

English README

+A powerful, easy-to-use, configurable charting and data visualization library for Unity.
Unity数据可视化图表插件。
+English README

From fdc7b41e8e2ab581c610d5f247206270ee257ea3 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 5 Nov 2024 08:28:57 +0800 Subject: [PATCH 07/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Title`=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=9A=90=E8=97=8F=E5=90=8E=E8=BF=90=E8=A1=8C=E8=BF=98?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Component/Title/TitleHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/Component/Title/TitleHandler.cs b/Runtime/Component/Title/TitleHandler.cs index e059352c..d1556c83 100644 --- a/Runtime/Component/Title/TitleHandler.cs +++ b/Runtime/Component/Title/TitleHandler.cs @@ -39,11 +39,11 @@ namespace XCharts.Runtime m_LabelObject = ChartHelper.AddChartLabel(s_TitleObjectName, titleObject.transform, title.labelStyle, chart.theme.title, GetTitleText(title), Color.clear, title.location.runtimeTextAlignment); - m_LabelObject.SetActive(title.show && title.labelStyle.show); + m_LabelObject.SetActive(title.show && title.labelStyle.show, true); m_SubLabelObject = ChartHelper.AddChartLabel(s_SubTitleObjectName, titleObject.transform, title.subLabelStyle, chart.theme.subTitle, GetSubTitleText(title), Color.clear, title.location.runtimeTextAlignment); - m_SubLabelObject.SetActive(title.show && title.subLabelStyle.show); + m_SubLabelObject.SetActive(title.show && title.subLabelStyle.show, true); m_SubLabelObject.transform.localPosition = subTitlePosition + title.subLabelStyle.offset; }; title.refreshComponent(); From e6c68be728614d4688a751f1d4af4f57db303673 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 5 Nov 2024 22:17:23 +0800 Subject: [PATCH 08/20] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/changelog.md | 2 +- Documentation~/en/tutorial01.md | 8 ++++---- Documentation~/zh/changelog.md | 3 +++ README-en.md | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation~/en/changelog.md b/Documentation~/en/changelog.md index 4011a0e0..691d6f91 100644 --- a/Documentation~/en/changelog.md +++ b/Documentation~/en/changelog.md @@ -381,7 +381,7 @@ Log details: Highlights: -* Updated documentation structure, added [Official XCharts Homepage](https://xcharts-team.github.io) +* Updated documentation structure, added [Official XCharts Homepage](https://xcharts-team.github.io/en) * Added support for the DataZoom box selected. * Added support for maximum width Settings for bars. * Other optimizations. diff --git a/Documentation~/en/tutorial01.md b/Documentation~/en/tutorial01.md index 15df1db7..9883a9b8 100644 --- a/Documentation~/en/tutorial01.md +++ b/Documentation~/en/tutorial01.md @@ -95,7 +95,7 @@ In the `Inspector` view, find the `LineChart` panel, and click the `Add Serie` b :::tip -Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/docs/configuration#serie-系列) +Series are added through the `Add Serie` button. Different types of Series can be added. [What kinds of Series does XCharts have?](https://xcharts-team.github.io/en/docs/configuration#serie-系列) ::: @@ -107,7 +107,7 @@ By default, the chart does not have a `Legend`. If you need a `Legend` component :::tip -Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/docs/configuration/#maincomponent-主组件) +Main components are added through the `Add Component` button. [What main components does XCharts have?](https://xcharts-team.github.io/en/docs/configuration/#maincomponent-主组件) ::: @@ -120,7 +120,7 @@ Serie only comes with a few common components, and other components need to be a :::tip -Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriecomponent-可添加到serie的组件) +Serie components are added through the button on the right side of Serie. [What components can be added to Serie in XCharts?](https://xcharts-team.github.io/en/docs/configuration/#iseriecomponent-可添加到serie的组件) ::: @@ -133,7 +133,7 @@ If you need to customize the configuration of each data item individually, you c :::tip -SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) +SerieData components are added through the button on the right side of SerieData after expanding. [What components can be added to SerieData in XCharts?](https://xcharts-team.github.io/en/docs/configuration/#iseriedatacomponent-可添加到seriedata的组件) ::: diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index ae226da8..ef01d154 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,9 @@ slug: /changelog ## master +* (2024.11.05) 修复`Title`设置隐藏后运行还显示的问题 +* (2024.11.01) 完善`website`中英文文档 + ## v3.12.0 版本要点: diff --git a/README-en.md b/README-en.md index e8ebf588..4d034bdc 100644 --- a/README-en.md +++ b/README-en.md @@ -59,7 +59,7 @@ A powerful and easy-to-use data visualization library for Unity. It supports mo ## Documentation -- [XCharts3.0 Homepage](https://xcharts-team.github.io) +- [XCharts3.0 Homepage](https://xcharts-team.github.io/en) - [XCharts3.0 Tutorial](Documentation~/en/tutorial01.md) - [XCharts3.0 API](Documentation~/en/api.md) - [XCharts3.0 FAQ](Documentation~/en/faq.md) @@ -78,7 +78,7 @@ A powerful and easy-to-use data visualization library for Unity. It supports mo - `XCharts3.0` is not fully compatible with `XCharts2.0`. Upgrading to 3.0 may require code adjustments and reconfiguration of some charts. - `XCharts2.0` is in the maintenance phase with only critical bug fixes applied. - While XCharts supports Unity 5.6 and above, compatibility issues may arise due to limited testing. -- This repository contains only the `XCharts` source code. For demos, visit the [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) repo or the [Online Demo](https://xcharts-team.github.io/examples/). +- This repository contains only the `XCharts` source code. For demos, visit the [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo) repo or the [Online Demo](https://xcharts-team.github.io/en/examples/). ## Getting Started From 7fb0765c6cae19e8e1991b65099ff704f30acad2 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 13 Nov 2024 08:40:56 +0800 Subject: [PATCH 09/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`DataZoom`=E7=9A=84star?= =?UTF-8?q?t=E5=92=8Cend=E5=9C=A8=E4=BB=A3=E7=A0=81=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E5=9B=BE=E8=A1=A8=E4=B8=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Component/DataZoom/DataZoomHandler.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index ef01d154..2935124b 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.13) 修复`DataZoom`的start和end在代码动态修改时图表不刷新的问题 * (2024.11.05) 修复`Title`设置隐藏后运行还显示的问题 * (2024.11.01) 完善`website`中英文文档 diff --git a/Runtime/Component/DataZoom/DataZoomHandler.cs b/Runtime/Component/DataZoom/DataZoomHandler.cs index 3c686cab..cfbeaf43 100644 --- a/Runtime/Component/DataZoom/DataZoomHandler.cs +++ b/Runtime/Component/DataZoom/DataZoomHandler.cs @@ -17,6 +17,8 @@ namespace XCharts.Runtime private bool m_CheckDataZoomLabel; private float m_DataZoomLastStartIndex; private float m_DataZoomLastEndIndex; + private float m_LastStart; + private float m_LastEnd; public override void InitComponent() { @@ -62,6 +64,10 @@ namespace XCharts.Runtime { CheckDataZoomScale(component); CheckDataZoomLabel(component); + if (m_LastStart != component.start || m_LastEnd != component.end) + { + UpdateDataZoomRange(component, component.start, component.end); + } } public override void DrawUpper(VertexHelper vh) @@ -404,6 +410,8 @@ namespace XCharts.Runtime dataZoom.start = start; if (!dataZoom.endLock) dataZoom.end = end; + m_LastStart = dataZoom.start; + m_LastEnd = dataZoom.end; if (dataZoom.realtime) { chart.OnDataZoomRangeChanged(dataZoom); From 0a923400b28355063ad3429717443cd5b7b4a588 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sat, 16 Nov 2024 17:18:06 +0800 Subject: [PATCH 10/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Animation`=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=80=9A=E8=BF=87=E4=BB=A3=E7=A0=81=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Serie/Serie.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 2935124b..dfd5fd74 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.16) 修复`Animation`无法通过代码开启的问题 * (2024.11.13) 修复`DataZoom`的start和end在代码动态修改时图表不刷新的问题 * (2024.11.05) 修复`Title`设置隐藏后运行还显示的问题 * (2024.11.01) 完善`website`中英文文档 diff --git a/Runtime/Serie/Serie.cs b/Runtime/Serie/Serie.cs index c41ae4df..70f1fd45 100644 --- a/Runtime/Serie/Serie.cs +++ b/Runtime/Serie/Serie.cs @@ -2007,8 +2007,11 @@ namespace XCharts.Runtime /// public void AnimationEnable(bool flag) { - if (animation.enable) animation.enable = flag; - SetVerticesDirty(); + if (!animation.enable) + { + animation.enable = flag; + SetVerticesDirty(); + } } ///

From 61fb717d202b369fe80ddf87f2b832bd19528e2b Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sat, 16 Nov 2024 17:22:40 +0800 Subject: [PATCH 11/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Animation`=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E9=80=9A=E8=BF=87=E4=BB=A3=E7=A0=81=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20(#334)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 2 +- Runtime/Serie/Serie.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index dfd5fd74..fffcd187 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,7 +77,7 @@ slug: /changelog ## master -* (2024.11.16) 修复`Animation`无法通过代码开启的问题 +* (2024.11.16) 修复`Animation`无法通过代码开启的问题 (#334) * (2024.11.13) 修复`DataZoom`的start和end在代码动态修改时图表不刷新的问题 * (2024.11.05) 修复`Title`设置隐藏后运行还显示的问题 * (2024.11.01) 完善`website`中英文文档 diff --git a/Runtime/Serie/Serie.cs b/Runtime/Serie/Serie.cs index 70f1fd45..ed02b5be 100644 --- a/Runtime/Serie/Serie.cs +++ b/Runtime/Serie/Serie.cs @@ -2007,7 +2007,7 @@ namespace XCharts.Runtime /// public void AnimationEnable(bool flag) { - if (!animation.enable) + if (animation.enable != flag) { animation.enable = flag; SetVerticesDirty(); From 6568595abbd1f5aaec6a9d395735a54c5b9beecf Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 18 Nov 2024 23:14:51 +0800 Subject: [PATCH 12/20] =?UTF-8?q?=E4=BC=98=E5=8C=96`Line`=E5=9C=A8?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=82=B9=E8=BF=87=E5=AF=86=E6=97=B6=E6=9C=89?= =?UTF-8?q?=E6=9B=B4=E5=A5=BD=E7=9A=84=E7=BB=98=E5=88=B6=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/XUGL/UGLHelper.cs | 92 ++++++++++++++++++++++++++-------- 2 files changed, 73 insertions(+), 20 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index fffcd187..76cd0c46 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.18) 优化`Line`在数据点过密时有更好的绘制效果 * (2024.11.16) 修复`Animation`无法通过代码开启的问题 (#334) * (2024.11.13) 修复`DataZoom`的start和end在代码动态修改时图表不刷新的问题 * (2024.11.05) 修复`Title`设置隐藏后运行还显示的问题 diff --git a/Runtime/XUGL/UGLHelper.cs b/Runtime/XUGL/UGLHelper.cs index a4d54a0d..07e56538 100644 --- a/Runtime/XUGL/UGLHelper.cs +++ b/Runtime/XUGL/UGLHelper.cs @@ -344,33 +344,85 @@ namespace XUGL return; } - var ldist = (Vector3.Distance(cp, lp) + 1) * dir1; - var rdist = (Vector3.Distance(cp, np) + 1) * dir2; + var ldist = (Vector3.Distance(cp, lp) + width) * dir1; + var rdist = (Vector3.Distance(cp, np) + width) * dir2; - bitp = true; - if (!UGLHelper.GetIntersection(ltp, ltp + ldist, ntp, ntp + rdist, ref itp)) + bitp = UGLHelper.GetIntersection(ltp, ltp + ldist, ntp, ntp + rdist, ref itp); + bibp = UGLHelper.GetIntersection(lbp, lbp + ldist, nbp, nbp + rdist, ref ibp); + if (bitp == bibp) { - itp = cp - dir1v; - clp = cp - dir1v; - crp = cp - dir2v; - bitp = false; + if (!bitp) + { + if (cp == np) + { + ltp = cp - dir1v; + clp = cp + dir1v; + crp = cp + dir1v; + } + else + { + Vector3 ibp2 = Vector3.zero; + if (UGLHelper.GetIntersection(lbp, lbp + ldist, ntp, nbp, ref ibp2)) + { + bibp = true; + ibp = ibp2; + clp = cp - dir1v; + crp = cp - dir2v; + } + else if (UGLHelper.GetIntersection(ltp, ltp + ldist, nbp, ntp, ref ibp2)) + { + bitp = true; + itp = ibp2; + clp = cp + dir1v; + crp = cp + dir2v; + } + else + { + if (IsUp(lp, cp, np)) + { + bibp = true; + + clp = cp - dir1v; + crp = cp - dir2v; + ibp = cp - Vector3.Cross((crp - clp).normalized, Vector3.back).normalized * width * 2f; + } + else + { + bitp = true; + clp = cp + dir1v; + crp = cp + dir2v; + itp = cp + Vector3.Cross((crp - clp).normalized, Vector3.back).normalized * width * 2f; + } + + } + } + } } - bibp = true; - if (!UGLHelper.GetIntersection(lbp, lbp + ldist, nbp, nbp + rdist, ref ibp)) + else { - ibp = cp + dir1v; - clp = cp + dir1v; - crp = cp + dir2v; - bibp = false; - } - if (bitp == false && bibp == false && cp == np) - { - ltp = cp - dir1v; - clp = cp + dir1v; - crp = cp + dir1v; + if (!bitp) + { + itp = cp; + clp = cp - dir1v; + crp = cp - dir2v; + } + else + { + ibp = cp; + clp = cp + dir1v; + crp = cp + dir2v; + } } } + public static bool IsUp(Vector3 p1, Vector3 p2, Vector3 p3) + { + var v1 = p1 - p2; + var v2 = p3 - p2; + var cross = v1.x * v2.y - v1.y * v2.x; + return cross > 0; + } + public static bool IsPointInTriangle(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 check) { var dire1 = check - p1; From 1dd31f747eac608f11aab0d3d16440b2f0c347d1 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Fri, 22 Nov 2024 22:10:12 +0800 Subject: [PATCH 13/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Time`=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=BD=B4=E5=9C=A8=E5=BC=80=E5=90=AF`Animation`?= =?UTF-8?q?=E6=97=B6=E5=8A=A8=E6=80=81=E5=8F=98=E6=9B=B4=E6=95=88=E6=9E=9C?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Utilities/DateTimeUtil.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 76cd0c46..bce5b86e 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.22) 修复`Time`时间轴在开启`Animation`时动态变更效果异常的问题 * (2024.11.18) 优化`Line`在数据点过密时有更好的绘制效果 * (2024.11.16) 修复`Animation`无法通过代码开启的问题 (#334) * (2024.11.13) 修复`DataZoom`的start和end在代码动态修改时图表不刷新的问题 diff --git a/Runtime/Utilities/DateTimeUtil.cs b/Runtime/Utilities/DateTimeUtil.cs index 6459f546..052ddbc0 100644 --- a/Runtime/Utilities/DateTimeUtil.cs +++ b/Runtime/Utilities/DateTimeUtil.cs @@ -161,6 +161,7 @@ namespace XCharts.Runtime ? (new DateTime(dtMin.Year, dtMin.Month, 1).AddMonths(1)) : (minTimestamp > firstValue ? DateTimeUtil.GetDateTime(secondValue) : DateTimeUtil.GetDateTime(firstValue)); tick = num * 365 * 24 * 3600; + dtStart = new DateTime(dtStart.Year, dtStart.Month, 1); while (dtStart.Ticks < dtMax.Ticks) { list.Add(DateTimeUtil.GetTimestamp(dtStart)); @@ -173,6 +174,7 @@ namespace XCharts.Runtime var dtStart = (firstValue == 0 || secondValue == 0 || (minTimestamp > firstValue && minTimestamp > secondValue)) ? (new DateTime(dtMin.Year, dtMin.Month, 1).AddMonths(1)) : (minTimestamp > firstValue ? DateTimeUtil.GetDateTime(secondValue) : DateTimeUtil.GetDateTime(firstValue)); + dtStart = new DateTime(dtStart.Year, dtStart.Month, 1); tick = num * 30 * 24 * 3600; while (dtStart.Ticks < dtMax.Ticks) { From 756df47fe31fc8f374e94f6e66a422de357cfebf Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Mon, 25 Nov 2024 08:39:48 +0800 Subject: [PATCH 14/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`UITable`=E5=9C=A8?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E6=97=B6=E4=B9=9F=E4=BC=9A=E7=82=B9=E9=80=89?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 22 ++++++++++++++++++++++ Runtime/XUGL/UGLHelper.cs | 29 ++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index bce5b86e..a87c6fad 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.24) 修复`UITable`在拖拽时也会点选的问题 * (2024.11.22) 修复`Time`时间轴在开启`Animation`时动态变更效果异常的问题 * (2024.11.18) 优化`Line`在数据点过密时有更好的绘制效果 * (2024.11.16) 修复`Animation`无法通过代码开启的问题 (#334) @@ -137,6 +138,8 @@ slug: /changelog 日志详情: + + * (2024.06.16) 发布`v3.11.0`版本 * (2024.06.15) 增加`Editor`下`Data`的添加、删除、上下移动操作按钮 * (2024.06.11) 修复`Axis`的`IndicatorLabel`可能会遮挡住`Tooltip`的问题 @@ -196,12 +199,19 @@ slug: /changelog * (2024.01.23) 增加`{y}`通配符用于获取Y轴的类目名 * (2024.01.23) 增加`Line`支持X轴和Y轴都为`Category`类目轴 * (2024.01.18) 修复`Animation`的`type`代码动态修改无效的问题 +* (2024.01.16) 增加`UIImage`图片组件 +* (2024.01.16) 优化`Background`组件,可设置圆角和边框 * (2024.01.13) 增加`Chart`的更多快捷创建图表菜单 * (2024.01.09) 增加`Background`的`borderStyle`,给图表默认设置圆角 * (2024.01.07) 修复`Tooltop`的第一个`ContentLabelStyle`设置`color`无效的问题 +* (2024.01.03) 增加`UITable`的`carouselStyle`的`hoverPause` +* (2024.01.02) 增加`UITable`的`scrollStyle`的`borderStyle` +* (2024.01.02) 增加`UITable`的`columnHeadStyle`的`opaque` +* (2024.01.01) 调整`UITable`的`border`边框相关设置,用`BorderStyle`代替 * (2024.01.01) 增加`BorderStyle`边框样式 * (2023.12.26) 增加`Heatmap`的`maxCache`参数支持 * (2023.12.25) 优化`Line`开启`clip`时绘制的顶点数 +* (2023.12.22) 增加`UITable`的行边框 * (2023.12.22) 修复`Scatter`散点图部分边界数据不显示的问题 * (2023.12.21) 修复`TriggerTooltip()`接口在指定0或最大index时可能无法触发的问题 * (2023.12.19) 修复`Legend`的`LabelStyle`设置`formatter`后不生效的问题 @@ -240,15 +250,27 @@ slug: /changelog * (2023.11.23) 增加`Axis`的`Animation`支持动画效果 * (2023.11.16) 取消`Legend`的`formatter`,用`LabelStyle`的代替 * (2023.11.14) 完善`LabelStyle`的`formatter`的注释和文档(#291) +* (2023.11.14) 增加`UITable`的`GetData()`和`GetContent()`接口 +* (2023.11.12) 增加`UITable`的`onTableClick`点击表格回调 +* (2023.11.11) 重构`UITable`的`SeparatorStyle`,可分开设置行列的分割线 * (2023.11.11) 修复`Documentation`部分注释生成文档不完整的问题 (#290) * (2023.11.11) 修复`Legend`的`formatter`在数据变更时没有自动刷新的问题 +* (2023.11.05) 增加`UITable`的`ColumnStyle`,重构Column相关参数 +* (2023.11.05) 增加`UITable`的`RowStyle`,重构Row相关参数 * (2023.11.05) 修复`SerieEventData`的`value`一直是0的问题 (#287) * (2023.11.03) 修复`Bar`设置渐变色时鼠标移出效果异常的问题 (#285) * (2023.11.02) 优化`SerieData`设置`ignore`时`formatter`的忽略问题 +* (2023.11.01) 增加`UITable`的`CarouselStyle`轮播功能 +* (2023.11.01) 增加`UITable`的`AddColumn()`和`UpdateColumn()`接口 * (2023.11.01) 增加`MarkLine`的`onTop`设置是否显示在最上层 +* (2023.10.23) 修复`UITable`点击`Rebuild Object`异常的问题 +* (2023.10.23) 修复`UITable`尺寸变化时不刷新的问题 * (2023.10.21) 修复`Pie`有0数据时`Label`的位置异常的问题 * (2023.10.21) 增加`Axis`的对数轴支持子刻度 * (2023.10.19) 修复`Pie`设置玫瑰图时引导线异常的问题 +* (2023.10.17) 修复`UITable`首次初始化异常的问题 +* (2023.10.17) 增加`UITable`的数据操作接口 +* (2023.10.17) 增加`UITable`的`RefreshTable()`刷新接口 * (2023.10.15) 修复`Line`设置`Animation`为`AlongPath`时动画异常的问题 (#281) * (2023.10.12) 修复`MarkLine`指定`yValue`时对数值轴无效的问题 * (2023.10.11) 修复`Serie`的`showDataDimension`设置无效的问题 diff --git a/Runtime/XUGL/UGLHelper.cs b/Runtime/XUGL/UGLHelper.cs index 07e56538..32db5443 100644 --- a/Runtime/XUGL/UGLHelper.cs +++ b/Runtime/XUGL/UGLHelper.cs @@ -259,17 +259,27 @@ namespace XUGL /// 相交则返回 true, 否则返回 false public static bool GetIntersection(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 p4, ref Vector3 intersection) { - var d = (p2.x - p1.x) * (p4.y - p3.y) - (p2.y - p1.y) * (p4.x - p3.x); - if (d == 0) + float dx1 = p2.x - p1.x; + float dy1 = p2.y - p1.y; + float dx2 = p4.x - p3.x; + float dy2 = p4.y - p3.y; + + float d = dx1 * dy2 - dy1 * dx2; + if (Mathf.Abs(d) < 1e-6f) return false; - var u = ((p3.x - p1.x) * (p4.y - p3.y) - (p3.y - p1.y) * (p4.x - p3.x)) / d; - var v = ((p3.x - p1.x) * (p2.y - p1.y) - (p3.y - p1.y) * (p2.x - p1.x)) / d; - if (u < 0 || u > 1 || v < 0 || v > 1) - return false; + float dx3 = p3.x - p1.x; + float dy3 = p3.y - p1.y; - intersection.x = p1.x + u * (p2.x - p1.x); - intersection.y = p1.y + u * (p2.y - p1.y); + float u = (dx3 * dy2 - dy3 * dx2) / d; + if (u < 0 || u > 1) return false; + + float v = (dx3 * dy1 - dy3 * dx1) / d; + if (v < 0 || v > 1) return false; + + intersection.x = p1.x + u * dx1; + intersection.y = p1.y + u * dy1; + intersection.z = p1.z; return true; } @@ -337,7 +347,8 @@ namespace XUGL clp = cp - dir2v; crp = cp + dir2v; - if (Vector3.Cross(dir1, dir2) == Vector3.zero && np != cp) + float crossMagnitude = Vector3.Cross(dir1, dir2).sqrMagnitude; + if (crossMagnitude < 1e-6f && np != cp) { itp = clp; ibp = crp; From d5647a448d3e4321886f52383aa2ea4f4144f6e7 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Tue, 26 Nov 2024 23:18:49 +0800 Subject: [PATCH 15/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E5=9C=A8?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=BC=9A=E8=B6=85=E5=87=BA=E5=B1=8F=E5=B9=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E6=95=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Runtime/Component/Tooltip/TooltipHandler.cs | 4 ++-- Runtime/Component/Tooltip/TooltipHelper.cs | 14 +++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index a87c6fad..65daa66f 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.26) 修复`Tooltip`在特殊情况下可能会超出屏幕显示不完整的问题 * (2024.11.24) 修复`UITable`在拖拽时也会点选的问题 * (2024.11.22) 修复`Time`时间轴在开启`Animation`时动态变更效果异常的问题 * (2024.11.18) 优化`Line`在数据点过密时有更好的绘制效果 diff --git a/Runtime/Component/Tooltip/TooltipHandler.cs b/Runtime/Component/Tooltip/TooltipHandler.cs index ea88ab2d..21787aa1 100644 --- a/Runtime/Component/Tooltip/TooltipHandler.cs +++ b/Runtime/Component/Tooltip/TooltipHandler.cs @@ -546,7 +546,7 @@ namespace XCharts.Runtime tooltip.SetActive(m_ShowTooltip); tooltip.view.Refresh(); - TooltipHelper.LimitInRect(tooltip, chart.chartRect); + TooltipHelper.LimitInRect(chart, tooltip, chart.chartRect); return true; } @@ -633,7 +633,7 @@ namespace XCharts.Runtime tooltip.SetActive(m_ShowTooltip); if (tooltip.view != null) tooltip.view.Refresh(); - TooltipHelper.LimitInRect(tooltip, chart.chartRect); + TooltipHelper.LimitInRect(chart, tooltip, chart.chartRect); return true; } return false; diff --git a/Runtime/Component/Tooltip/TooltipHelper.cs b/Runtime/Component/Tooltip/TooltipHelper.cs index 4c462262..ffefaffc 100644 --- a/Runtime/Component/Tooltip/TooltipHelper.cs +++ b/Runtime/Component/Tooltip/TooltipHelper.cs @@ -58,7 +58,7 @@ namespace XCharts.Runtime return "-".Equals(itemFormatter) ||"{i}".Equals(itemFormatter, StringComparison.CurrentCultureIgnoreCase); } - public static void LimitInRect(Tooltip tooltip, Rect chartRect) + public static void LimitInRect(BaseChart chart, Tooltip tooltip, Rect chartRect) { if (tooltip.view == null) return; @@ -78,6 +78,18 @@ namespace XCharts.Runtime } if (pos.y > chartRect.y + chartRect.height) pos.y = chartRect.y + chartRect.height; + var screenGap = 10; + var screenPos = chart.LocalPointToScreenPoint(pos); + if (screenPos.x < screenGap) + pos.x += Mathf.Abs(screenPos.x) + screenGap; + if (screenPos.x + tooltip.context.width > Screen.width - screenGap) + pos.x -= Mathf.Abs(screenPos.x + tooltip.context.width - Screen.width) + screenGap; + + if (screenPos.y < tooltip.context.height + screenGap) + pos.y += Mathf.Abs(screenPos.y - tooltip.context.height) + screenGap; + if (screenPos.y > Screen.height - screenGap) + pos.y -= Mathf.Abs(screenPos.y - Screen.height) + screenGap; + tooltip.UpdateContentPos(pos, chartRect.width / 2, chartRect.height / 2); } From ad77a793086cb31df3df397e466d84dcefd1128c Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 27 Nov 2024 22:28:47 +0800 Subject: [PATCH 16/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Unity6`=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BB=A3=E7=A0=81=E8=AD=A6=E5=91=8A=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/zh/changelog.md | 1 + Editor/Windows/XChartsEditor.cs | 4 +++ Runtime/Utilities/DefineSymbolsUtil.cs | 42 ++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 65daa66f..2c351b92 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.27) 修复`Unity6`的一些代码警告问题 * (2024.11.26) 修复`Tooltip`在特殊情况下可能会超出屏幕显示不完整的问题 * (2024.11.24) 修复`UITable`在拖拽时也会点选的问题 * (2024.11.22) 修复`Time`时间轴在开启`Animation`时动态变更效果异常的问题 diff --git a/Editor/Windows/XChartsEditor.cs b/Editor/Windows/XChartsEditor.cs index 004baa43..a4c3736a 100644 --- a/Editor/Windows/XChartsEditor.cs +++ b/Editor/Windows/XChartsEditor.cs @@ -19,7 +19,11 @@ namespace XCharts.Editor GameObject selectObj = Selection.activeGameObject; if (selectObj == null) { +#if UNITY_2023_1_OR_NEWER + var canvas = UnityEngine.Object.FindFirstObjectByType(); +#else var canvas = GameObject.FindObjectOfType(); +#endif if (canvas != null) return canvas.transform; else { diff --git a/Runtime/Utilities/DefineSymbolsUtil.cs b/Runtime/Utilities/DefineSymbolsUtil.cs index 12a24c82..60a361c8 100644 --- a/Runtime/Utilities/DefineSymbolsUtil.cs +++ b/Runtime/Utilities/DefineSymbolsUtil.cs @@ -4,6 +4,7 @@ using System; using System.Reflection; using System.Text; using UnityEditor; +using UnityEditor.Build; using UnityEngine; namespace XCharts.Runtime @@ -16,6 +17,22 @@ namespace XCharts.Runtime { var flag = false; var num = 0; +#if UNITY_2022_1_OR_NEWER + foreach (var buildTargetGroup in (BuildTargetGroup[]) Enum.GetValues(typeof(BuildTargetGroup))) + { + if (IsValidBuildTargetGroup(buildTargetGroup)) + { + var buildTargetName = NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup); + var symbols = PlayerSettings.GetScriptingDefineSymbols(buildTargetName); + symbols = symbols.Replace(" ", ""); + if (Array.IndexOf(symbols.Split(';'), symbol) != -1) continue; + flag = true; + num++; + var defines = symbols + (symbols.Length > 0 ? ";" + symbol : symbol); + PlayerSettings.SetScriptingDefineSymbols(buildTargetName, defines); + } + } +#else foreach (var buildTargetGroup in (BuildTargetGroup[]) Enum.GetValues(typeof(BuildTargetGroup))) { if (IsValidBuildTargetGroup(buildTargetGroup)) @@ -29,6 +46,7 @@ namespace XCharts.Runtime PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, defines); } } +#endif if (flag) { Debug.LogFormat("Added global define symbol \"{0}\" to {1} BuildTargetGroups.", symbol, num); @@ -39,6 +57,29 @@ namespace XCharts.Runtime { var flag = false; var num = 0; +#if UNITY_2022_1_OR_NEWER + foreach (var buildTargetGroup in (BuildTargetGroup[]) Enum.GetValues(typeof(BuildTargetGroup))) + { + if (IsValidBuildTargetGroup(buildTargetGroup)) + { + var buildTargetName = NamedBuildTarget.FromBuildTargetGroup(buildTargetGroup); + var symbols = PlayerSettings.GetScriptingDefineSymbols(buildTargetName).Split(';'); + if (Array.IndexOf(symbols, symbol) == -1) continue; + flag = true; + num++; + s_StringBuilder.Length = 0; + foreach (var str in symbols) + { + if (!str.Equals(symbol)) + { + if (s_StringBuilder.Length > 0) s_StringBuilder.Append(";"); + s_StringBuilder.Append(str); + } + } + PlayerSettings.SetScriptingDefineSymbols(buildTargetName, s_StringBuilder.ToString()); + } + } +#else foreach (var buildTargetGroup in (BuildTargetGroup[]) Enum.GetValues(typeof(BuildTargetGroup))) { if (IsValidBuildTargetGroup(buildTargetGroup)) @@ -59,6 +100,7 @@ namespace XCharts.Runtime PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, s_StringBuilder.ToString()); } } +#endif if (flag) { Debug.LogFormat("Removed global define symbol \"{0}\" to {1} BuildTargetGroups.", symbol, num); From 6c42fe63998b8bbf66e727b52486d55594e1df4e Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 27 Nov 2024 23:24:09 +0800 Subject: [PATCH 17/20] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Internal/BaseChart.API.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Runtime/Internal/BaseChart.API.cs b/Runtime/Internal/BaseChart.API.cs index 7383202d..7c744a2c 100644 --- a/Runtime/Internal/BaseChart.API.cs +++ b/Runtime/Internal/BaseChart.API.cs @@ -656,10 +656,12 @@ namespace XCharts.Runtime } } + private Background m_Background; public Color32 GetChartBackgroundColor() { - var background = GetChartComponent(); - return theme.GetBackgroundColor(background); + if (m_Background == null) m_Background = GetChartComponent(); + //var background = GetChartComponent(); + return theme.GetBackgroundColor(m_Background); } /// From bc1a11c4e3ed46f5428fa96abc431ca93cac6751 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sat, 30 Nov 2024 23:45:28 +0800 Subject: [PATCH 18/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E5=9C=A8?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E8=AE=BE=E7=BD=AE=E5=85=B6=E4=BB=96=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E6=97=B6=E6=89=8B=E6=9C=BA=E4=B8=8A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Documentation~/en/api.md | 15 +++++---- Documentation~/en/configuration.md | 4 ++- Documentation~/zh/api.md | 15 +++++---- Documentation~/zh/changelog.md | 1 + Documentation~/zh/configuration.md | 4 ++- Runtime/Component/Tooltip/Tooltip.cs | 31 ----------------- Runtime/Component/Tooltip/TooltipHelper.cs | 39 +++++++++++++++++++++- 7 files changed, 61 insertions(+), 48 deletions(-) diff --git a/Documentation~/en/api.md b/Documentation~/en/api.md index cd357de3..dd4ccd19 100644 --- a/Documentation~/en/api.md +++ b/Documentation~/en/api.md @@ -3303,7 +3303,7 @@ public static string CheckChart(BaseChart chart) ## ChildComponent -class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MarqueeStyle](#marqueestyle),[MLValue](#mlvalue),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) +class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) ### ChildComponent.anyDirty @@ -6411,6 +6411,8 @@ Configurations of select state. class in XCharts.Runtime / Inherits from: [BaseSerie](#baseserie),[IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=icomparable) / Subclasses: [SerieHandler<T>](#seriehandlert),[Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Pie](#pie),[Radar](#radar),[Ring](#ring),[BaseScatter](#basescatter) +系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 + ### Serie.areaStyle public AreaStyle areaStyle @@ -8720,11 +8722,6 @@ public void SetActive(bool flag) public void SetContentActive(bool flag) 设置文本框是否显示 -### Tooltip.UpdateContentPos - -public void UpdateContentPos(Vector2 pos, float width, float height) -更新文本框位置 - ## Tooltip.Position class in XCharts.Runtime @@ -8802,7 +8799,7 @@ public static bool IsIgnoreFormatter(string itemFormatter) ### TooltipHelper.LimitInRect -public static void LimitInRect(Tooltip tooltip, Rect chartRect) +public static void LimitInRect(BaseChart chart, Tooltip tooltip, Rect chartRect) ## TooltipTheme @@ -8999,6 +8996,10 @@ public static bool IsPointInPolygon(Vector3 p, params Vector3[] polyons) public static bool IsPointInTriangle(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 check) +### UGLHelper.IsUp + +public static bool IsUp(Vector3 p1, Vector3 p2, Vector3 p3) + ### UGLHelper.IsValueEqualsColor public static bool IsValueEqualsColor(Color color1, Color color2) diff --git a/Documentation~/en/configuration.md b/Documentation~/en/configuration.md index 789f7e0f..80e49047 100644 --- a/Documentation~/en/configuration.md +++ b/Documentation~/en/configuration.md @@ -1235,7 +1235,7 @@ class in XCharts.Runtime ## ChildComponent -class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MarqueeStyle](#marqueestyle), [MLValue](#mlvalue), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) +class in XCharts.Runtime / Subclasses: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) ## Comment @@ -3399,6 +3399,8 @@ Configurations of select state. class in XCharts.Runtime / Inherits from: [BaseSerie](#baseserie), [IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=IComparable) / Subclasses: [SerieHandler<T>](#seriehandlert), [Bar](#bar), [SimplifiedBar](#simplifiedbar), [Candlestick](#candlestick), [SimplifiedCandlestick](#simplifiedcandlestick), [Heatmap](#heatmap), [Line](#line), [SimplifiedLine](#simplifiedline), [Parallel](#parallel), [Pie](#pie), [Radar](#radar), [Ring](#ring), [BaseScatter](#basescatter) +系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 + ### Serie.align [Align](#align) diff --git a/Documentation~/zh/api.md b/Documentation~/zh/api.md index 1f0e6018..5a7d7425 100644 --- a/Documentation~/zh/api.md +++ b/Documentation~/zh/api.md @@ -3303,7 +3303,7 @@ public static string CheckChart(BaseChart chart) ## ChildComponent -class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MarqueeStyle](#marqueestyle),[MLValue](#mlvalue),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) +class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle),[AxisAnimation](#axisanimation),[AxisName](#axisname),[AxisSplitArea](#axissplitarea),[AreaStyle](#areastyle),[ArrowStyle](#arrowstyle),[BaseLine](#baseline),[BorderStyle](#borderstyle),[IconStyle](#iconstyle),[ImageStyle](#imagestyle),[ItemStyle](#itemstyle),[Level](#level),[LevelStyle](#levelstyle),[LineArrow](#linearrow),[LineStyle](#linestyle),[Location](#location),[MLValue](#mlvalue),[MarqueeStyle](#marqueestyle),[Padding](#padding),[StageColor](#stagecolor),[SymbolStyle](#symbolstyle),[TextLimit](#textlimit),[TextStyle](#textstyle),[CommentItem](#commentitem),[CommentMarkStyle](#commentmarkstyle),[LabelLine](#labelline),[LabelStyle](#labelstyle),[MarkAreaData](#markareadata),[MarkLineData](#marklinedata),[StateStyle](#statestyle),[VisualMapRange](#visualmaprange),[ViewControl](#viewcontrol),[UIComponentTheme](#uicomponenttheme),[SerieData](#seriedata),[SerieDataLink](#seriedatalink),[ComponentTheme](#componenttheme),[SerieTheme](#serietheme),[ThemeStyle](#themestyle) ### ChildComponent.anyDirty @@ -6411,6 +6411,8 @@ class in XCharts.Runtime / 继承自: [StateStyle](#statestyle),[ISerieComponent class in XCharts.Runtime / 继承自: [BaseSerie](#baseserie),[IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=icomparable) / 子类: [SerieHandler<T>](#seriehandlert),[Bar](#bar),[SimplifiedBar](#simplifiedbar),[Candlestick](#candlestick),[SimplifiedCandlestick](#simplifiedcandlestick),[Heatmap](#heatmap),[Line](#line),[SimplifiedLine](#simplifiedline),[Parallel](#parallel),[Pie](#pie),[Radar](#radar),[Ring](#ring),[BaseScatter](#basescatter) +系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 + ### Serie.areaStyle public AreaStyle areaStyle @@ -8720,11 +8722,6 @@ public void SetActive(bool flag) public void SetContentActive(bool flag) 设置文本框是否显示 -### Tooltip.UpdateContentPos - -public void UpdateContentPos(Vector2 pos, float width, float height) -更新文本框位置 - ## Tooltip.Position class in XCharts.Runtime @@ -8802,7 +8799,7 @@ public static bool IsIgnoreFormatter(string itemFormatter) ### TooltipHelper.LimitInRect -public static void LimitInRect(Tooltip tooltip, Rect chartRect) +public static void LimitInRect(BaseChart chart, Tooltip tooltip, Rect chartRect) ## TooltipTheme @@ -8999,6 +8996,10 @@ public static bool IsPointInPolygon(Vector3 p, params Vector3[] polyons) public static bool IsPointInTriangle(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 check) +### UGLHelper.IsUp + +public static bool IsUp(Vector3 p1, Vector3 p2, Vector3 p3) + ### UGLHelper.IsValueEqualsColor public static bool IsValueEqualsColor(Color color1, Color color2) diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 2c351b92..37bebb7c 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -77,6 +77,7 @@ slug: /changelog ## master +* (2024.11.30) 修复`Tooltip`在图表设置其他锚点时手机上显示位置异常的问题 * (2024.11.27) 修复`Unity6`的一些代码警告问题 * (2024.11.26) 修复`Tooltip`在特殊情况下可能会超出屏幕显示不完整的问题 * (2024.11.24) 修复`UITable`在拖拽时也会点选的问题 diff --git a/Documentation~/zh/configuration.md b/Documentation~/zh/configuration.md index df8f1d9a..9514a70b 100644 --- a/Documentation~/zh/configuration.md +++ b/Documentation~/zh/configuration.md @@ -1235,7 +1235,7 @@ class in XCharts.Runtime ## ChildComponent -class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MarqueeStyle](#marqueestyle), [MLValue](#mlvalue), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) +class in XCharts.Runtime / 子类: [AnimationStyle](#animationstyle), [AxisAnimation](#axisanimation), [AxisName](#axisname), [AxisSplitArea](#axissplitarea), [AreaStyle](#areastyle), [ArrowStyle](#arrowstyle), [BaseLine](#baseline), [BorderStyle](#borderstyle), [IconStyle](#iconstyle), [ImageStyle](#imagestyle), [ItemStyle](#itemstyle), [Level](#level), [LevelStyle](#levelstyle), [LineArrow](#linearrow), [LineStyle](#linestyle), [Location](#location), [MLValue](#mlvalue), [MarqueeStyle](#marqueestyle), [Padding](#padding), [StageColor](#stagecolor), [SymbolStyle](#symbolstyle), [TextLimit](#textlimit), [TextStyle](#textstyle), [CommentItem](#commentitem), [CommentMarkStyle](#commentmarkstyle), [LabelLine](#labelline), [LabelStyle](#labelstyle), [MarkAreaData](#markareadata), [MarkLineData](#marklinedata), [StateStyle](#statestyle), [VisualMapRange](#visualmaprange), [ViewControl](#viewcontrol), [UIComponentTheme](#uicomponenttheme), [SerieData](#seriedata), [SerieDataLink](#seriedatalink), [ComponentTheme](#componenttheme), [SerieTheme](#serietheme), [ThemeStyle](#themestyle) ## Comment @@ -3399,6 +3399,8 @@ class in XCharts.Runtime / 继承自: [StateStyle](#statestyle), [ISerieComponen class in XCharts.Runtime / 继承自: [BaseSerie](#baseserie), [IComparable](https://docs.unity3d.com/ScriptReference/30_search.html?q=IComparable) / 子类: [SerieHandler<T>](#seriehandlert), [Bar](#bar), [SimplifiedBar](#simplifiedbar), [Candlestick](#candlestick), [SimplifiedCandlestick](#simplifiedcandlestick), [Heatmap](#heatmap), [Line](#line), [SimplifiedLine](#simplifiedline), [Parallel](#parallel), [Pie](#pie), [Radar](#radar), [Ring](#ring), [BaseScatter](#basescatter) +系列。系列一般由数据和配置组成,用来表示具体的图表图形,如折线图的一条折线,柱图的一组柱子等。一个图表中可以包含多个不同类型的系列。 + ### Serie.align [Align](#align) diff --git a/Runtime/Component/Tooltip/Tooltip.cs b/Runtime/Component/Tooltip/Tooltip.cs index 68e797a9..593784c6 100644 --- a/Runtime/Component/Tooltip/Tooltip.cs +++ b/Runtime/Component/Tooltip/Tooltip.cs @@ -549,37 +549,6 @@ namespace XCharts.Runtime SetContentActive(flag); } - /// - /// 更新文本框位置 - /// - /// - public void UpdateContentPos(Vector2 pos, float width, float height) - { - if (view != null) - { - switch (m_Position) - { - case Position.Auto: -#if UNITY_ANDROID || UNITY_IOS - if (m_FixedY == 0) pos.y = ChartHelper.GetActualValue(0.7f, height); - else pos.y = ChartHelper.GetActualValue(m_FixedY, height); -#endif - break; - case Position.Custom: - pos.x = ChartHelper.GetActualValue(m_FixedX, width); - pos.y = ChartHelper.GetActualValue(m_FixedY, height); - break; - case Position.FixedX: - pos.x = ChartHelper.GetActualValue(m_FixedX, width); - break; - case Position.FixedY: - pos.y = ChartHelper.GetActualValue(m_FixedY, height); - break; - } - view.UpdatePosition(pos); - } - } - /// /// 设置文本框是否显示 /// diff --git a/Runtime/Component/Tooltip/TooltipHelper.cs b/Runtime/Component/Tooltip/TooltipHelper.cs index ffefaffc..777f9ace 100644 --- a/Runtime/Component/Tooltip/TooltipHelper.cs +++ b/Runtime/Component/Tooltip/TooltipHelper.cs @@ -90,7 +90,44 @@ namespace XCharts.Runtime if (screenPos.y > Screen.height - screenGap) pos.y -= Mathf.Abs(screenPos.y - Screen.height) + screenGap; - tooltip.UpdateContentPos(pos, chartRect.width / 2, chartRect.height / 2); + Debug.Log("rect: " + chartRect); + UpdateContentPos(tooltip, pos, chartRect); + } + + /// + /// 更新文本框位置 + /// + /// + private static void UpdateContentPos(Tooltip tooltip, Vector2 pos, Rect chartRect) + { + if (tooltip.view != null) + { + var width = chartRect.width; + var height = chartRect.height; + switch (tooltip.position) + { + case Tooltip.Position.Auto: +#if UNITY_ANDROID || UNITY_IOS + if (tooltip.fixedY == 0) pos.y = chartRect.x + ChartHelper.GetActualValue(0.7f, height); + else pos.y = chartRect.y + ChartHelper.GetActualValue(tooltip.fixedY, height); +#endif + break; + case Tooltip.Position.Custom: + pos = new Vector2(chartRect.x, chartRect.y); + pos.x += ChartHelper.GetActualValue(tooltip.fixedX, width); + pos.y += ChartHelper.GetActualValue(tooltip.fixedY, height); + break; + case Tooltip.Position.FixedX: + pos = new Vector2(chartRect.x, pos.y); + pos.x += ChartHelper.GetActualValue(tooltip.fixedX, width); + break; + case Tooltip.Position.FixedY: + pos = new Vector2(pos.x, chartRect.y); + pos.y += ChartHelper.GetActualValue(tooltip.fixedY, height); + break; + } + tooltip.view.UpdatePosition(pos); + } } public static string GetItemNumericFormatter(Tooltip tooltip, Serie serie, SerieData serieData) From 1bdb756ad1864516e1f01c44ed88cb81c778876e Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sat, 30 Nov 2024 23:48:53 +0800 Subject: [PATCH 19/20] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`Tooltip`=E5=9C=A8?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E8=AE=BE=E7=BD=AE=E5=85=B6=E4=BB=96=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E6=97=B6=E6=89=8B=E6=9C=BA=E4=B8=8A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Component/Tooltip/TooltipHelper.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Runtime/Component/Tooltip/TooltipHelper.cs b/Runtime/Component/Tooltip/TooltipHelper.cs index 777f9ace..4b42b71d 100644 --- a/Runtime/Component/Tooltip/TooltipHelper.cs +++ b/Runtime/Component/Tooltip/TooltipHelper.cs @@ -90,7 +90,6 @@ namespace XCharts.Runtime if (screenPos.y > Screen.height - screenGap) pos.y -= Mathf.Abs(screenPos.y - Screen.height) + screenGap; - Debug.Log("rect: " + chartRect); UpdateContentPos(tooltip, pos, chartRect); } From 19744ec12423ac7305249687cfa1b0ac4c7a0134 Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Sun, 1 Dec 2024 10:22:23 +0800 Subject: [PATCH 20/20] 3.12.1 --- Documentation~/en/changelog.md | 23 +++++++++++++++++++++++ Documentation~/zh/changelog.md | 12 ++++++++++++ Runtime/Internal/XChartsMgr.cs | 4 ++-- package.json | 6 +++--- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/Documentation~/en/changelog.md b/Documentation~/en/changelog.md index 691d6f91..4acc2e5c 100644 --- a/Documentation~/en/changelog.md +++ b/Documentation~/en/changelog.md @@ -6,6 +6,7 @@ slug: /changelog # Changelog [master](#master) +[v3.12.1](#v3121) [v3.12.0](#v3120) [v3.11.2](#v3112) [v3.11.1](#v3111) @@ -76,6 +77,28 @@ slug: /changelog ## master +## v3.12.1 + +Version Highlights: + +* Enhanced Chinese and English support for the official website documentation. +* Optimized the rendering performance of line charts when data points are densely packed. +* Other issue fixes. + +Log Details: + +* (2024.12.01) Released `v3.12.1` version. +* (2024.11.30) Fixed an issue where the `Tooltip` displayed incorrectly on mobile devices when setting other anchors in charts. +* (2024.11.27) Resolved some code warning issues in `Unity6`. +* (2024.11.26) Fixed a problem where the `Tooltip` might exceed the screen and appear incomplete under specific circumstances. +* (2024.11.24) Fixed an issue where `UITable` would also select items during dragging. +* (2024.11.22) Fixed an abnormal effect issue when dynamically changing the `Time` timeline with `Animation` enabled. +* (2024.11.18) Optimized `Line` rendering for better performance when data points are densely packed. +* (2024.11.16) Fixed an issue where `Animation` could not be enabled through code (#334). +* (2024.11.13) Fixed a problem where dynamically modifying the `start` and `end` of `DataZoom` through code did not refresh the chart. +* (2024.11.05) Fixed an issue where the `Title` remained visible after being set to hidden. +* (2024.11.01) Improved `website` documentation in both English and Chinese. + ## v3.12.0 Version Highlights: diff --git a/Documentation~/zh/changelog.md b/Documentation~/zh/changelog.md index 37bebb7c..8743b88d 100644 --- a/Documentation~/zh/changelog.md +++ b/Documentation~/zh/changelog.md @@ -6,6 +6,7 @@ slug: /changelog # 更新日志 [master](#master) +[v3.12.1](#v3121) [v3.12.0](#v3120) [v3.11.2](#v3112) [v3.11.1](#v3111) @@ -77,6 +78,17 @@ slug: /changelog ## master +## v3.12.1 + +版本要点: + +* 完善官网文档的中英文支持 +* 优化折线图数据密集时的绘制效果 +* 其他问题修复 + +日志详情: + +* (2024.12.01) 发布`v3.12.1`版本 * (2024.11.30) 修复`Tooltip`在图表设置其他锚点时手机上显示位置异常的问题 * (2024.11.27) 修复`Unity6`的一些代码警告问题 * (2024.11.26) 修复`Tooltip`在特殊情况下可能会超出屏幕显示不完整的问题 diff --git a/Runtime/Internal/XChartsMgr.cs b/Runtime/Internal/XChartsMgr.cs index 3f4a9c70..98e73c7f 100644 --- a/Runtime/Internal/XChartsMgr.cs +++ b/Runtime/Internal/XChartsMgr.cs @@ -21,8 +21,8 @@ namespace XCharts.Runtime [ExecuteInEditMode] public static class XChartsMgr { - public static readonly string version = "3.12.0"; - public static readonly int versionDate = 20240930; + public static readonly string version = "3.12.1"; + public static readonly int versionDate = 20241201; public static string fullVersion { get { return version + "-" + versionDate; } } internal static List chartList = new List(); diff --git a/package.json b/package.json index 7aa27dcf..8c498357 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "displayName": "XCharts", "author": "monitor1394", "license": "MIT", - "version": "3.12.0", - "date": "20240930", - "checkdate": "20240930", + "version": "3.12.1", + "date": "20241201", + "checkdate": "20241201", "unity": "2018.3", "description": "A charting and data visualization library for Unity. Support line chart, bar chart, pie chart, radar chart, scatter chart, heatmap chart, ring chart, candlestick chart, polar chart and parallel coordinates.", "keywords": [