Compare commits

...

52 Commits

Author SHA1 Message Date
monitor1394
71cfbc15f3 Merge branch 'master' into 3.0 2022-07-12 07:43:08 +08:00
monitor1394
96a49f2b11 v3.1.0 2022-07-12 07:38:42 +08:00
monitor1394
131aabc76a [bug][line] fix ignoreLineBreak of line serie not work 2022-07-12 07:26:07 +08:00
monitor1394
e42afe8d47 [optimize][axis] support auto float min-max range 2022-07-11 07:04:34 +08:00
monitor1394
69243b7cd0 [optimize][axis] support float when Axis MinMaxType set to MinMax 2022-07-11 07:02:02 +08:00
monitor1394
12757eb4db [doc] update doc 2022-07-07 07:42:53 +08:00
monitor1394
945a69ba70 [doc] update doc 2022-07-07 07:08:02 +08:00
monitor1394
9aa8431432 [bug] fix multipe grid error (#210) 2022-07-05 21:43:09 +08:00
monitor1394
a499002426 [code] add example of test dynamic chart 2022-07-05 08:07:52 +08:00
monitor1394
4d5e2481b0 [feature][axis] support Settings.axisMaxSplitNumber 2022-07-04 13:37:16 +08:00
monitor1394
2248b61d03 [bug][axis] fix axis tick error (#209) 2022-07-04 13:14:23 +08:00
monitor1394
419715bb2a [doc] update doc 2022-07-04 08:32:01 +08:00
monitor1394
f5c2e73098 [code] add comment 2022-07-04 08:30:43 +08:00
monitor1394
197402dcb7 [code] refactor the code 2022-07-03 21:09:49 +08:00
monitor1394
33fd4aa9f3 [feature][axis] support AxisName.onZero (#207) 2022-07-03 10:02:22 +08:00
monitor1394
9b263c883b [bug][pie] fix piechart create error with code (#206) 2022-07-02 23:10:11 +08:00
monitor1394
06574a201a [bug] fix AxisLabel.onZero not work in YAxis 2022-07-02 16:51:45 +08:00
monitor1394
fbdb51d847 [bug] fix axislabel distance error 2022-07-02 16:43:52 +08:00
monitor1394
47c9b99931 [bug] fix chart not being created correctly at runtime 2022-06-30 08:31:09 +08:00
monitor1394
bb9f28dd5c [feature][tooltip] support {c0} for itemFormatter (#205) 2022-06-29 13:33:38 +08:00
monitor1394
0f2f55e436 [optimize][pie] avoid label overlap (#56) 2022-06-28 13:23:32 +08:00
monitor1394
6c9528cf19 [optimize][line]smooth line (#169) 2022-06-26 08:35:59 +08:00
monitor1394
91b9055039 [doc] doc link 2022-06-25 19:41:35 +08:00
monitor1394
564ff2e178 [bug] fix tooltip show data error when datazoom enable (#203) 2022-06-25 19:32:50 +08:00
monitor1394
2a03e71312 [bug] fix tooltip draw error when axis data is empty (#204) 2022-06-25 17:07:26 +08:00
monitor1394
0dbcc4ab2b [optimize][tooltip] serie placeHolder 2022-06-25 16:33:50 +08:00
monitor1394
f19b61f1f2 [doc] add since version 2022-06-25 11:45:22 +08:00
monitor1394
9a1c76c236 [optimize][painter] add upper and top painter layer 2022-06-24 22:17:01 +08:00
monitor1394
7c07499e44 [optimize][legend] support background and padding 2022-06-24 22:15:49 +08:00
monitor1394
8a6253621b [optimize][textstyle] support sprite asset of TextMeshPro (#201) 2022-06-21 08:15:48 +08:00
monitor1394
5bc14dd37a [optimaze][tooltip] content rect limit (#202) 2022-06-20 13:41:28 +08:00
monitor1394
b11e8fcb3a [bug]fix TextMeshPro compile error 2022-06-20 13:05:44 +08:00
monitor1394
df0a87c935 [bug] fix fadeout animation 2022-06-20 08:24:00 +08:00
monitor1394
8fbda1fa73 v3.0.1 2022-06-16 08:18:07 +08:00
monitor1394
431cf7de74 v3.0.1 2022-06-16 08:14:02 +08:00
monitor1394
87049b5170 [doc] update comment and doc 2022-06-15 07:36:05 +08:00
monitor1394
c24d89c8ab [optimaze][label] icon and emphasis label 2022-06-14 07:28:24 +08:00
monitor1394
e8c46b676f [optimaze][background] rename hideThemeBackgroundColor to autoColor 2022-06-14 07:01:46 +08:00
monitor1394
0880b2f3f9 [optimize][legend]support textstyle autoColor 2022-06-10 21:00:58 +08:00
monitor1394
1d1ad6fa57 [bug] fix axis label active 2022-06-08 08:32:29 +08:00
monitor1394
6e87f82131 3.0 2022-06-01 07:59:00 +08:00
monitor1394
9549159a58 3.0 2022-05-31 08:33:54 +08:00
monitor1394
e370bedc09 3.0 2022-05-31 08:17:54 +08:00
monitor1394
5740882d1c 3.0 2022-05-29 17:25:45 +08:00
monitor1394
63166e5cd1 3.0 2022-05-26 21:33:05 +08:00
monitor1394
6ba6a7929d 3.0 2022-05-24 13:43:15 +08:00
monitor1394
e0a596d02a 3.0 2022-05-24 13:39:19 +08:00
monitor1394
9b7ebea827 3.0 2022-05-24 13:36:23 +08:00
monitor1394
0ad4a47c36 3.0 2022-05-23 08:23:58 +08:00
monitor1394
1ac59dff86 3.0 2022-05-22 22:27:20 +08:00
monitor1394
bafe032bb9 3.0 2022-05-22 22:17:38 +08:00
monitor1394
003f4da9de [bug] fix create chart error 2022-05-06 13:07:50 +08:00
410 changed files with 6892 additions and 4698 deletions

2
.github/FUNDING.yml vendored
View File

@@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://www.paypal.com/paypalme/monitor1394','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/alipay.png']
custom: ['https://www.paypal.me/monitor1394','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/alipay.png','https://github.com/XCharts-Team/XCharts/blob/master/Documentation/res/wechat.png']

View File

@@ -2,6 +2,9 @@
# 更新日志
[master](#master)
[v3.1.0](#v3.1.0)
[v3.0.1](#v3.0.1)
[v3.0.0](#v3.0.0)
[v3.0.0-preivew9](#v3.0.0-preivew9)
[v3.0.0-preivew8](#v3.0.0-preivew8)
[v3.0.0-preivew7](#v3.0.0-preivew7)
@@ -11,6 +14,8 @@
[v3.0.0-preivew3](#v3.0.0-preivew3)
[v3.0.0-preivew2](#v3.0.0-preivew2)
[v3.0.0-preivew1](#v3.0.0-preivew1)
[v2.8.1](#v2.8.1)
[v2.8.0](#v2.8.0)
[v2.7.0](#v2.7.0)
[v2.6.0](#v2.6.0)
[v2.5.0](#v2.5.0)
@@ -52,6 +57,66 @@
## master
## 3.1.0
* (2022.07.12) 发布`v3.1.0`版本
* (2022.07.12) 修复`Serie``ignoreLineBreak`不生效的问题
* (2022.07.07) 优化`Axis``minMaxType`指定为`MinMax`时支持精确到小数
* (2022.07.05) 修复`Chart`里有多个坐标系时绘制异常的问题 (#210)
* (2022.07.04) 增加`Settings``axisMaxSplitNumber`参数设置`Axis`的最大分隔段数
* (2022.07.04) 修复`Axis`在设置`offset``Tick`绘制位置异常的问题 (#209)
* (2022.07.03) 优化`AxisLabel``formatterFunction`自定义委托
* (2022.07.03) 增加`AxisName``onZero`参数支持设置坐标轴名称位置是否和Y轴0刻度一致 (#207)
* (2022.07.02) 修复`PieChart`用代码动态创建时`Legend`不正常的问题 (#206)
* (2022.07.02) 修复`YAxis``AxisLabel`设置`onZero`不生效的问题
* (2022.07.02) 修复`AxisLabel`代码设置`distance`属性后一直刷新的问题
* (2022.06.30) 修复`Runtime`下代码创建图表时组件无法初始化的问题
* (2022.06.29) 增加`Tooltip``itemFormatter`支持`{c0}`显示各维度数据 (#205)
* (2022.06.28) 优化`Pie`设置`avoidLabelOverlap`时的文本表现 (#56)
* (2022.06.25) 优化`Line`的平滑曲线表现 (#169)
* (2022.06.25) 修复`DataZoom`开启时`Tooltip`显示数据不一致的问题 (#203)
* (2022.06.25) 修复`Toolip`在类目轴无数据时绘制异常的问题 (#204)
* (2022.06.25) 优化`Serie`设置`PlaceHolder`时的`Tooltip`表现
* (2022.06.25) 增加`Since`标识配置参数从哪个版本开始支持
* (2022.06.24) 优化`Painter`绘制层,`Top`层细分为`Upper``Top`
* (2022.06.24) 增加`Legend``Background``Padding`的支持
* (2022.06.21) 增加`TextStyle``TextMeshPro``Sprite Asset`支持 (#201)
* (2022.06.20) 优化`Tooltip`的边界限制 (#202)
* (2022.06.20) 修复`TextMeshPro`开启时编译错误
* (2022.06.20) 修复`Animation`的渐出动画不生效的问题
## v3.0.1
* (2022.06.16) 发布`v3.0.1`版本
* (2022.06.16) 修复`Inspector`上部分`foldout`箭头点击无法展开的问题
* (2022.06.15) 优化`Doc`自动生成,完善代码注释和配置项手册文档
* (2022.06.14) 优化`SerieLabelStyle`,支持动态调整`Icon`
* (2022.06.13) 优化`Background`背景设置
* (2022.06.10) 增加`Legend``AxisLabel`支持`autoColor`
* (2022.06.08) 修复`Axis``AxisLabel`在设置不显示时还显示首尾两个`label`的问题
## v3.0.0
* 更健壮的底层框架。
* 更强大的性能。
* 更小的序列化文件。
* 更好的交互体验。
* 更多的组件支持。
* 更强大的文本自述能力。
* 更合理的组件调整。
* 更灵活的组件插拔。
* 更高效的二次开发。
* 更丰富的Demo示例。
* 增加`Time`时间轴。
* 增加`SingleAxis`单轴。
* 增加`Comment`文本组件。
* 增加`Widgets`小组件。
* 增加多种坐标系:`Grid``Polar``Radar``SingleAxis`
* 增加多种动画方式。
* 增加多种图表交互。
* 增加国际化支持。
* 增加多种扩展图表。
## v3.0.0-preivew9
* (2022.05.06) 发布`v3.0.0-preivew9`版本
@@ -111,6 +176,22 @@
* (2022.01.07) 发布`v3.0.0-preivew1`版本
## v2.8.1
* (2022.05.06) 发布`v2.8.1`版本
* (2022.05.03) 增加`Legend``onLegendClick`,`onLegendEnter``onLegendExit`委托回调
* (2022.04.21) 修复`RingChart``Tooltip`异常的问题 #192
* (2022.04.21) 修复`DataZoom`设置`minShowNum`时可能会报错的问题
## v2.8.0
* (2022.04.10) 发布`v2.8.0`版本
* (2022.04.10) 增加`Debug`调试信息面板
* (2022.04.09) 修复`VisualMap`某些情况下不生效的问题
* (2022.04.08) 优化`XCharts`初始化 #190
* (2022.04.08) 修复`Radar`的颜色异常问题 #187
* (2022.03.24) 修复`Axis`的精度问题 #184
## v2.7.0
* (2022.03.20) 发布`v2.7.0`版本

View File

@@ -2,6 +2,24 @@
# 更新日志
[master](#master)
[v3.1.0](#v3.1.0)
[v3.0.1](#v3.0.1)
[v3.0.0](#v3.0.0)
[v3.0.0-preivew9](#v3.0.0-preivew9)
[v3.0.0-preivew8](#v3.0.0-preivew8)
[v3.0.0-preivew7](#v3.0.0-preivew7)
[v3.0.0-preivew6](#v3.0.0-preivew6)
[v3.0.0-preivew5](#v3.0.0-preivew5)
[v3.0.0-preivew4](#v3.0.0-preivew4)
[v3.0.0-preivew3](#v3.0.0-preivew3)
[v3.0.0-preivew2](#v3.0.0-preivew2)
[v3.0.0-preivew1](#v3.0.0-preivew1)
[v2.8.1](#v2.8.1)
[v2.8.0](#v2.8.0)
[v2.7.0](#v2.7.0)
[v2.6.0](#v2.6.0)
[v2.5.0](#v2.5.0)
[v2.4.0](#v2.4.0)
[v2.3.0](#v2.3.0)
[v2.2.3](#v2.2.3)
[v2.2.2](#v2.2.2)
@@ -39,13 +57,146 @@
## master
* (2022.04.23) Remove `Serie` `IconStyle` component
* (2022.04.23) Enhance `LabelStyle`, all components `TextStyle` will be upgraded to `LabelStyle`
* (2022.04.19) Added `Label` `rotate` to support setting rotation
* (2022.04.17) Fixed animation invalidation of `Bar` when the value is negative
* (2022.04.17) Added `BorderGap` support for `ItemStyle` to set border spacing
* (2022.04.16) Optimize the `Border` and `Capsule` histogram of `Bar`
* (2021.08.15) Fixed the problem of displaying exceptions after adding data again when `DataZoom` is enable (#163)
## 3.1.0
* (2022.07.12) Release `v3.1.0` version
* (2022.07.12) Fixed `Serie` `ignoreLineBreak` not working
* (2022.07.07) Optimized `Axis` `minMaxType` to support precision to decimals when specified as `MinMax`
* (2022.07.05) Fixed drawing exception when there are multiple coordinate systems in `Chart` (#210)
* (2022.07.04) Added the axisMaxSplitNumber parameter of `Settings` to set the maximum number of partitions for `Axis`
* (2022.07.04) Fixed Axis` Tick `drawing position after setting `offset`(#209)
* (2022.07.03) Optimize the `AxisLabel` formatterFunction custom delegate
* (2022.07.03) added the `onZero` parameter of `AxisName` to support setting the coordinate AxisName and position to match the Y-axis 0 scale (#207)
* (2022.07.02) Fixed bug where `Legend` was not working when `PieChart` was being created dynamically with code (#206)
* (2022.07.02) Fixed `YAxis` AxisLabel setting `onZero` not working
* (2022.07.02) Fixed `AxisLabel` code refreshing after setting `distance` property
* (2022.06.30) Fixed an issue where components could not be initialized when creating diagrams under `Runtime` code
* (2022.06.29) Added `itemFormatter` support for `{c0}` in `Tooltip` to display dimension data (#205)
* (2022.06.28) Optimize text performance when `Pie` sets up `avoidLabelOverlap` (#56)
* (2022.06.25) Optimize smooth curve representation of `Line` (#169)
* (2022.06.25) Fixed inconsistent display of `Tooltip` when `DataZoom` is enabled (#203)
* (2022.06.25) Fixed `Toolip` drawing exception when there is no data in the category axis (#204)
* (2022.06.25) Optimize `Serie` setting `PlaceHolder` for `Tooltip` performance
* (2022.06.25) Added `Since` to identify the version from which the configuration parameter is supported
* (2022.06.24) Optimize `Painter` drawing layer, `Top` layer is subdivided into `Upper` and `Top` layers
* (2022.06.24) Added `Legend` support for `Background` and `Padding`
* (2022.06.21) Added `TextStyle` support for `Sprite Asset` of `TextMeshPro` (#201)
* (2022.06.20) Optimize boundary limits for `Tooltip` (#202)
* (2022.06.20) Fixes compilation error when `TextMeshPro` is turned on
* (2022.06.20) Fixed issue where the fade Animation of `Animation` would not work
## v3.0.1
* (2022.06.16) Release `v3.0.1` version
* (2022.06.16) Fixed an issue where the `foldout` arrow on `Inspector` could not be expanded
* (2022.06.15) Optimized `Doc` auto-generation, improved code comments and configuration item manual documentation
* (2022.06.14) Optimized `SerieLabelStyle` to support dynamic adjustment of `Icon`
* (2022.06.13) Optimized `Background` setting
* (2022.06.10) Added `Legend` AxisLabel support for `autoColor`
* (2022.06.08) Fixed issue where `Axis` `AxisLabel` still shows the first and last two labels when not displayed
## v3.0.0
* More robust underlying framework.
* More powerful performance.
* Smaller serialized files.
* Better interactive experience.
* More component support.
* More powerful ability to self-report text.
* More reasonable component adjustments.
* More flexible component insertion and removal.
* More efficient secondary development.
* Richer Demo examples.
* Added `Time` axis.
* Added `SingleAxis`.
* Added multiple coordinate systems: `Grid`, `Polar`, `Radar`, `SingleAxis`.
* Added multiple animation methods.
* Added multiple chart interactions.
* Added internationalization support.
* Added `Widgets`.
* Added multiple extension charts.
## v3.0.0_preview9
## v3.0.0_preview8
## v3.0.0_preview7
## v3.0.0_preview6
## v3.0.0_preview5
## v3.0.0_preview4
## v3.0.0_preview3
## v3.0.0_preview2
## v3.0.0_preview1
## v2.8.1
* (2022.05.03) Added `onLegendClick`, `onLegendEnter` and `onLegendExit` delegate callbacks for `Legend`
* (2022.04.21) Fixed bug #192 with `RingChart` `Tooltip` exception
* (2022.04.21) Fixed error when setting `minShowNum` in `DataZoom`
## v2.8.0
* (2022.04.10) Added the debug information panel
* (2022.04.09) Fixed `VisualMap` not working in some cases
* (2022.04.08) Optimized `XCharts` initialization #190
* (2022.04.08) Fixed color error #187 in `Radar`
* (2022.03.24) Fixed `Axis` precision issue #184
## v2.7.0
* (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 `YAxis` `AxisLabel`'s `onZero` does not work
* (2022.01.06) Improved `Zebra` bar chart
## v2.6.0
* (2021.12.30) Release `v2.6.0` version
* (2021.12.21) Fixed `Emphasis` dont work
* (2021.12.17) Fixed `MarkLine` does not auto refresh label active when serie hide #178
* (2021.12.10) Improved `Radar`'s `AxisLine` and `SplitLine` to be controlled separately
* (2021.12.08) Fixed y axis does not refresh when serie hidden
* (2021.12.04) Added `Symbol` new types: `EmptyRect`, `EmptyTriangle`, `EmptyDiamond`
* (2021.12.04) Added setting symbol empty area color by itemStyle's backgroundColor
* (2021.12.03) Fixed formatter `{c}` not work #175
* (2021.12.03) Fixed axis `boundaryGap` display error in some cases #174
* (2021.11.30) Fixed serie `ignore` display error in some cases #173
## v2.5.0
* (2021.11.27) Release `v2.5.0` version
* (2021.11.27) Added `Tooltip` delegate function `positionFunction`
* (2021.10.29) Removed settings for `TextMeshPro` when package first imported
* (2021.10.29) Added support for `{e}` in `Tooltip` #170
* (2021.09.08) Improved `RadarChart`
* (2021.09.07) Fixed bug where `label` does not disappear at the end of `PieChart` fade animation #168
* (2021.09.06) Fixed bug where `GaugeChart` changing `splitNumber` with code does not refresh `label` #167
## v2.4.0
### Main points
* LineChart support the line of ignore data is disconnected or connected
* LineChart support animation at a constant speed
* Other optimizations and bug fixes
### Details
* (2021.08.31) Release `v2.4.0` version
* (2021.08.31) Optimized the gradient effect of `RingChart`
* (2021.08.31) Fixed bug where `SerieLabel` does not refresh when `DataZoom` is dragged (#165)
* (2021.08.25) Fixed an issue where the theme switch could not be save to the scene (#166)
* (2021.08.24) Added `Animation`'s `alongWithLinePath`
* (2021.08.22) Added `Serie`'s `ignoreLineBreak` (#164)
* (2021.08.22) Fixed `Axis` label may not be updated when `DataZoom` is turn on (#164)
* (2021.08.15) Improved `Axis`'s `AxisLabel` text rotate setting to avoid inconsistency offset in `DataZoom` (#163)
* (2021.08.14) Added `Legend`'s `textAutoColor` to set the text color match with `Serie` color (#163)
* (2021.08.12) Optimize `BarChart` setting `Corner` when the positive and negative columns are fillet symmetric

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 01f7eaa065d094f1f8955111a9bc447b
guid: 7425bc5c378354c95bb116c36dc1b5f8
TextScriptImporter:
externalObjects: {}
userData:

141
Documentation/README.md Normal file
View File

@@ -0,0 +1,141 @@
<p align="center">
<a href="">
<img src="" alt="" width="" height="">
</a>
</p>
<h2 align="center">XCharts</h3>
<p align="center">
A powerful, easy-to-use, configurable charting and data visualization library for Unity.
<br>
Unity数据可视化图表插件。
<br>
<a href="https://github.com/XCharts-Team/XCharts">中文</a>
</p>
<p align="center">
<a href="https://github.com/XCharts-Team/XCharts/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/XCharts-Team/XCharts">
</a>
<a href="https://github.com/XCharts-Team/XCharts/releases">
<img src="https://img.shields.io/github/v/release/XCharts-Team/XCharts?include_prereleases">
</a>
<a href="">
<img src="https://img.shields.io/github/repo-size/monitor1394/unity-ugui-xcharts">
</a>
<a href="">
<img src="https://img.shields.io/github/languages/code-size/monitor1394/unity-ugui-xcharts">
</a>
<a href="">
<img src="https://img.shields.io/badge/Unity-5.6+-green">
</a>
<a href="">
<img src="https://img.shields.io/badge/TextMeshPro-YES-green">
</a>
</p>
<p align="center">
<a href="">
<img src="https://img.shields.io/github/stars/XCharts-Team/XCharts?style=social">
</a>
<a href="">
<img src="https://img.shields.io/github/forks/XCharts-Team/XCharts?style=social">
</a>
<a href="">
<img src="https://img.shields.io/github/issues-closed/XCharts-Team/XCharts?color=green&label=%20%20%20%20issues&logoColor=green&style=social">
</a>
</p>
A powerful, easy-to-use, configurable charting and data visualization library for Unity. Supporting line, bar, pie, radar, scatter, heatmap, ring, candlestick, polar, liquid and other common chart. Also support 3d pie, 3d bar, 3d pyramid, funnel, gauge, liquid, pictorialbar, gantt, treemap and ther extended chart.
[XCharts3.0 Tutorial](XChartsTutorial01-EN.md)
[XCharts3.0 API](XChartsAPI-EN.md)
[XCharts3.0 FAQ](XChartsFAQ-EN.md)
[XCharts3.0 Configurate](XChartsConfiguration-EN.md)
[XCharts3.0 Changelog](CHANGELOG.md)
[XCharts3.0 Support](SUPPORT.md)
## Features
* Rich built-in examples and templates, parameter visualization configuration, effect real-time preview, pure code drawing.
* Support line, bar, pie, radar, scatter, heatmaps, gauge, ring, polar, liquid and other common chart.
* Support line graph, curve graph, area graph, step graph and other LineChart.
* Support parallel bar, stack bar, stack percentage bar, zebra bar and other BarChart.
* Support ring, rose and other PieChart.
* Support line-bar chart, scatter-line chart and other combination chart.
* Support solid line, curve, ladder line, dotted line, dash line, dot line, double dot line and other lines.
* Support custom theme, built-in theme switching.
* Support custom chart content drawing, drawing points, line, curve, triangle, quadrilateral, circle, ring, sector, border, arrow and other drawing API.
* Support interactive operations such as data filtering, view zooming and detail display on PC and mobile terminals.
* Support 10,000-level big data rendering.
* Support TextMeshPro.
## XCharts3.0 new feature
* Added `Time` axis.
* Added `SingleAxis`.
* Added multiple coordinate systems: `Grid`, `Polar`, `Radar`, `SingleAxis`.
* Added multiple animation methods.
* Added multiple chart interactions.
* Added internationalization support.
* Added `Widgets`.
* Added multiple extension charts.
## XCharts3.0 improvements over XCharts2.0
* More robust underlying framework.
* More powerful performance.
* Smaller serialized files.
* Better interactive experience.
* More component support.
* More powerful ability to self-report text.
* More reasonable component adjustments.
* More flexible component insertion and removal.
* More efficient secondary development.
* Richer Demo examples.
## XCharts3.0 and 2.0 data comparison
| Case | XCharts2.0 | XCharts3.0 | Note |
| -- | -- | -- | -- |
| Fps of 2000 data line chart | ` 20 ` | ` 83 ` | Performance improvements `3` times |
| Vertices of 2000 data line chart | ` 36.5 k ` | ` 6.7 k ` | Vertices reduce `4` times |
| Prefab size of 2000 data line chart | ` 11.1 MB ` | ` 802 KB ` | Serialized file size to reduce `10` times |
| Max data of a single line chart | ` 4.1 k ` | ` 19 k ` | Single Serie data capacity improvement `4` times |
| Num of chart support | ` 11 ` | ` 23 ` | More than `1` times as many chart are supported |
## Screenshots
![buildinchart](https://github.com/XCharts-Team/XCharts-Demo/blob/master/buildinchart.png)
![extendchart](https://github.com/XCharts-Team/XCharts-Demo/blob/master/extendchart.png)
For more examples, see [XCharts-Demo](https://github.com/XCharts-Team/XCharts-Demo), You can also go to [Online Demo](https://xcharts-team.github.io/demo/) to see the running effect of `WebGL`.
## Use
1. Import `XCharts` unitypackage or source code into the project.
2. Right-click `Hierarchy` view and choose `XCharts->LineChart` to create a default LineChart.
3. You can adjust the parameters of each component in `Inspector` and see the real-time effects in `Game` view.
See more tutorial: [XCharts tutorial: 5 minutes overhand tutorial](XChartsTutorial01-EN.md)
## FAQ
1. Is `XCharts` free to use?
A: `XCharts` uses the `MIT` licence and is free to use. You can also subscribe to `VIP` to enjoy more value-added services.
2. Does `XCharts` support code to dynamically add and modify data? Does it support getting data from `Excel` or a database?
A: Support code to dynamically add and modify data, but data needs to be parsed or retrieved by itself, and then added to `XCharts` by calling the public interface of `XCharts`.
3. Does this plugin work on other platforms (e.g. Winform or WPF) besides Unity?
A: It is currently only supported on Unity. Theoretically any version of Unity that supports `UGUI` can run `XCharts`.
## Changelog
[Changelog](CHANGELOG.md)
## Licenses
[MIT License](LICENSE.md)
## Other
email: `monitor1394@gmail.com`

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 29f30ecf23bb44bc5b0820dc5ee7a23e
guid: 56516e67d6e88401e949d4e63792c638
TextScriptImporter:
externalObjects: {}
userData:

View File

@@ -1,22 +1,36 @@
## 技术支持
# 订阅服务
如需技术支持可订阅VIP服务。扫后面的支付宝二维码后可加VIP群`867291970`,验证信息请输入支付宝账号。企业VIP可加官方群私聊群主了解详情。
如需技术支持,可订阅`个人VIP`服务。扫后面的二维码后可加VIP群`867291970`,验证信息请输入付费的账号。
企业商务合作可联系QQ3525422251XCharts技术支持
## 订阅服务
## 订阅VIP服务
| |免费用户|付费咨询|个人`1``VIP`|个人`2``VIP` | 个人长期`VIP` |
订阅服务分个人订阅和企业订阅:
- `个人`订阅:`个人VIP`属于个人,不可转让,`XCharts`团队只服务于订阅当事人。
- `企业`订阅:`企业VIP`属于企业,席位内可安排固定职员,职员离职后席位可重新安排,`XCharts`团队通过专属企业群为企业服务。
订阅服务的优势?
- 提高工作效率,节省时间成本。一方面,`XCharts`功能强大,相关配置项非常多,`VIP`服务可快速帮您定位,节省去查找和核对的时间;另一方面,`VIP`的即时回答服务可快速为您答疑解惑,避免中断开发流程。总之,订阅`VIP`可让您能快速上手,快速处理问题,至少能提高`10`倍以上的工作效率。
- 更多技术交流,更多经验交流。`XCharts`团队成员从业多年,有丰富的技术和工作经验。`VIP`服务不仅可以交流`XCharts`相关的内容,也可以咨询其他方面的技术。`VIP`群也有更多的交流。
- 扩展图表的需要订阅`VIP`服务后才能购买扩展图表超过1年后的更新支持也需要持续订阅`VIP`服务。
- `VIP`用户可加入`XCharts``GitHub`组织,参与`XCharts`社区构建,访问专有仓库。
| |免费用户|付费咨询|个人`VIP` | 个人`SVIP` | 企业`VIP` |
| ----- |--|--|--|--|--|
| 订阅费用 | -- | `98`¥ | `298`¥ | `498`¥ | `888`¥ |
| 席位时长 | -- | `1`个席位<br>`7`天,`7`小时* | `1`个席位<br>`1`年 | `1`个席位<br>`2`年 | `1`个席位<br>`长期` |
| <b>`服务方式:`</b>|
| 订阅费用 | -- | `98`¥ | `298`¥ | 首年`1298`¥</br>后续`298¥`* | `联系我们` |
| 订阅时长 | -- | `7`天* | `1`年 | `1`年* | `1`
| 订阅席位 | -- | `1`个席位 | `1`个席位 |`1`个席位|`5`个以上席位|
| __`服务方式:`__|
| 官方QQ群交流 | √ | √ | √ | √ | √ |
| 即时一对一交流 | | √ | √ | √ | √ |
| 专属VIP群交流 | | | √ | √ | √ |
| <b>`服务内容:`</b>|
| 可商用 | √ | √ | √ | √ | √ |
| 可二次开发 | √ | √ | √ | √ | √ |
| 专属VIP群交流 | | | √ | √ | √(专属企业群) |
| __`服务内容:`__|
| 可商用 | √ | √ | √ | √ | √ |
| 可二次开发 | √ | √ | √ | √ | √ |
| 有问必答 | | √ | √ | √ | √ |
| 即时回 | | √ | √ | √ | √ |
| 即时回 | | √ | √ | √ | √ |
| 新手指导 | | √ | √ | √ | √ |
| 开发指导 | | √ | √ | √ | √ |
| 优化指导 | | √ | √ | √ | √ |
@@ -25,16 +39,39 @@
| 需求优先考虑 | | | √ | √ | √ |
| 可另付费定制 | | | √ | √ | √ |
| 可另付费加急 | | | √ | √ | √ |
| 付费图表优惠 | | | 95折 | 95折 | 85折 |
| VIP专有功能教程和文档 | | | √待开放 | √待开放 | √待开放 |
| 扩展图表购买 | | | 按需购买 | __全部免费__ | 按需购买 |
| 扩展图表源码 | | | 永久持有 | 永久持有 | 永久持有 |
| 扩展图表更新 | | | 1年更新支持 | 1年更新支持 | 1年更新支持 |
## 购买扩展图表
扩展图表为另付费购买图表,只对订阅了`VIP`服务的用户开放购买。对于`SVIP`的订阅用户,所有扩展图表仓库可免费使用,不用再单独购买。
对所有已购买的扩展图表,源码可永久持有,并获得持续一年的更新支持,一年后如需更新支持服务,可继续订阅`VIP`服务。
|编号|扩展图表|价格|备注|
|--|--|--|--|
| 101 | PictorialBarChart | 98¥ | 象形柱图 |
| 102 | FunnelChart | 98¥ | 漏斗图 |
| 103 | PyramidChart | 98¥ | 3D金字塔 |
| 104 | TreemapChart | 98¥ | 树形矩图 |
| 201 | Bar3DChart | 198¥ | 3D柱图 |
| 202 | Pie3DChart | 198¥ | 3D饼图 |
| 203 | GanttChart | 198¥ | 甘特图 |
| 204 | GaugeChart | 198¥ | 仪表盘 |
| 205 | LiquidChart | 198¥ | 水位图 |
## 备注说明
1. __`付费定制`__ 是指用户可根据自己的需求定制不同的图表或新功能,只有`VIP`用户才享有`付费定制`权利。
2. __`付费加急`__ 是指用户可对自己非常紧急的需求进行付费,将开发优先级提到最高,并可要求在`Deadline`内交付,只有`VIP`用户才享有`付费加急`权利。
3. __`付费咨询`__ 付费咨询有效期`7`天,且总咨询时长不超过`7`个小时。
4. __`扩展图表`__ 购买后代码可永久持有和商用1年的更新支持。
## 捐助支持
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任金额的助,非常感谢
如果这个项目对您有帮助,请右上方点 `Star` 予以支持!也欢迎任金额的助,非常您的支持
![alipay-qrcode](res/alipay.png)
![alipay-qrcode](res/alipay.png)
![wechat-qrcode](res/wechat.png)

View File

@@ -33,6 +33,7 @@
- [FormatterHelper](#FormatterHelper)
- [GridCoordContext](#GridCoordContext)
- [HeatmapChart](#HeatmapChart)
- [IgnoreDoc](#IgnoreDoc)
- [InteractData](#InteractData)
- [LayerHelper](#LayerHelper)
- [LegendContext](#LegendContext)
@@ -65,6 +66,8 @@
- [SerieContext](#SerieContext)
- [SerieConvertAttribute](#SerieConvertAttribute)
- [SerieDataContext](#SerieDataContext)
- [SerieDataExtraComponentAttribute](#SerieDataExtraComponentAttribute)
- [SerieDataExtraFieldAttribute](#SerieDataExtraFieldAttribute)
- [SerieExtraComponentAttribute](#SerieExtraComponentAttribute)
- [SerieHandler](#SerieHandler)
- [SerieHandler<T>](#SerieHandler<T>)
@@ -77,6 +80,7 @@
- [SimplifiedBarChart](#SimplifiedBarChart)
- [SimplifiedCandlestickChart](#SimplifiedCandlestickChart)
- [SimplifiedLineChart](#SimplifiedLineChart)
- [Since](#Since)
- [SVG](#SVG)
- [SVGImage](#SVGImage)
- [SVGPath](#SVGPath)
@@ -117,7 +121,7 @@ Inherits or Implemented: [MainComponentHandler](#MainComponentHandler)
|public method|description|
|--|--|
| `AdjustCircleLabelPos()` |public static void AdjustCircleLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)</br> |
| `AdjustMinMaxValue()` |public static void AdjustMinMaxValue(Axis axis, ref double minValue, ref double maxValue, bool needFormat, int ceilRate = 0)</br>调整最大最小值 |
| `AdjustMinMaxValue()` |public static void AdjustMinMaxValue(Axis axis, ref double minValue, ref double maxValue, bool needFormat, double ceilRate = 0)</br>调整最大最小值 |
| `AdjustRadiusAxisLabelPos()` |public static void AdjustRadiusAxisLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)</br> |
| `GetAxisLineArrowOffset()` |public static float GetAxisLineArrowOffset(Axis axis)</br>包含箭头偏移的轴线长度 |
| `GetAxisPosition()` |public static float GetAxisPosition(GridCoord grid, Axis axis, double value, int dataCount = 0, DataZoom dataZoom = null)</br> |
@@ -144,10 +148,12 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
|public method|description|
|--|--|
| `AddChartComponent()` |public MainComponent AddChartComponent(Type type)</br> |
| `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)</br>Add a (time,y) data to serie. |
| `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)</br>Add a data to serie. |
| `AddData()` |public SerieData AddData(int serieIndex, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
| `AddData()` |public SerieData AddData(int serieIndex, double xValue, double yValue, string dataName = null, string dataId = null)</br>Add a (x,y) data to serie. |
| `AddData()` |public SerieData AddData(int serieIndex, List<double> multidimensionalData, string dataName = null, string dataId = null)</br>Add an arbitray dimension data to serie,such as (x,y,z,...). |
| `AddData()` |public SerieData AddData(string serieName, DateTime time, double yValue, string dataName = null, string dataId = null)</br>Add a (time,y) data to serie. |
| `AddData()` |public SerieData AddData(string serieName, double data, string dataName = null, string dataId = null)</br>Add a data to serie. |
| `AddData()` |public SerieData AddData(string serieName, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
| `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)</br>Add a (x,y) data to serie. |
@@ -232,6 +238,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `RefreshPainter()` |public void RefreshPainter(int index)</br> |
| `RefreshPainter()` |public void RefreshPainter(Serie serie)</br> |
| `RefreshTopPainter()` |public void RefreshTopPainter()</br> |
| `RefreshUpperPainter()` |public void RefreshUpperPainter()</br> |
| `RemoveAllChartComponent()` |public void RemoveAllChartComponent()</br> |
| `RemoveChartComponent()` |public bool RemoveChartComponent(MainComponent component)</br> |
| `RemoveChartComponent()` |public bool RemoveChartComponent(Type type, int index = 0)</br> |
@@ -252,6 +259,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `SetSerieActive()` |public void SetSerieActive(string serieName, bool active)</br>Whether to show serie. |
| `SetSeriePainterMaterial()` |public void SetSeriePainterMaterial(Material material)</br>设置Serie Painter的材质球 |
| `SetTopPainterMaterial()` |public void SetTopPainterMaterial(Material material)</br>设置Top Painter的材质球 |
| `SetUpperPainterMaterial()` |public void SetUpperPainterMaterial(Material material)</br>设置Upper Painter的材质球 |
| `TryAddChartComponent()` |public bool TryAddChartComponent(Type type)</br> |
| `TryGetChartComponent<T>()` |public bool TryGetChartComponent<T>(out T component, int index = 0)</br> |
| `UdpateXAxisIcon()` |public void UdpateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)</br>Update xAxis icon. |
@@ -335,10 +343,10 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `GetFullName()` |public static string GetFullName(Transform transform)</br> |
| `GetHighlightColor()` |public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)</br> |
| `GetLastValue()` |public static Vector3 GetLastValue(List<Vector3> list)</br> |
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, int ceilRate)</br> |
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, double ceilRate)</br> |
| `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, int ceilRate)</br> |
| `GetMinLogValue()` |public static float GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, double ceilRate)</br> |
| `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
@@ -368,6 +376,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `SetActive()` |public static void SetActive(Image image, bool active)</br> |
| `SetActive()` |public static void SetActive(Text text, bool active)</br> |
| `SetActive()` |public static void SetActive(Transform transform, bool active)</br>通过设置scale实现是否显示优化性能减少GC |
| `SetBackground()` |public static void SetBackground(Image background, ImageStyle imageStyle)</br> |
| `SetColorOpacity()` |public static void SetColorOpacity(ref Color32 color, float opacity)</br> |
## `ChartLabel`
@@ -483,6 +492,7 @@ Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `NeedFormat()` |public static bool NeedFormat(string content)</br> |
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value)</br> |
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string value)</br> |
| `TrimAndReplaceLine()` |public static string TrimAndReplaceLine(string content)</br> |
@@ -496,6 +506,14 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
Inherits or Implemented: [BaseChart](#BaseChart)
## `IgnoreDoc`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `IgnoreDoc()` |public IgnoreDoc()</br> |
## `InteractData`
|public method|description|
@@ -529,9 +547,10 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
|--|--|
| `CheckDataHighlighted()` |public static bool CheckDataHighlighted(Serie serie, string legendName, bool heighlight)</br> |
| `CheckDataShow()` |public static bool CheckDataShow(Serie serie, string legendName, bool show)</br> |
| `GetContentColor()` |public static Color GetContentColor(int legendIndex, Legend legend, ThemeStyle theme, bool active)</br> |
| `GetContentColor()` |public static Color GetContentColor(BaseChart chart, int legendIndex, string legendName, Legend legend, ThemeStyle theme, bool active)</br> |
| `GetIconColor()` |public static Color GetIconColor(BaseChart chart, Legend legend, int readIndex, string legendName, bool active)</br> |
| `ResetItemPosition()` |public static void ResetItemPosition(Legend legend, Vector3 chartPos, float chartWidth, float chartHeight)</br> |
| `SetLegendBackground()` |public static void SetLegendBackground(Legend legend, ImageStyle style)</br> |
## `LegendItem`
@@ -540,6 +559,7 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
| `GetIconColor()` |public Color GetIconColor()</br> |
| `GetIconRect()` |public Rect GetIconRect()</br> |
| `SetActive()` |public void SetActive(bool active)</br> |
| `SetBackground()` |public void SetBackground(ImageStyle imageStyle)</br> |
| `SetButton()` |public void SetButton(Button button)</br> |
| `SetContent()` |public bool SetContent(string content)</br> |
| `SetContentBackgroundColor()` |public void SetContentBackgroundColor(Color color)</br> |
@@ -691,7 +711,6 @@ Inherits or Implemented: [BaseChart](#BaseChart)
|public method|description|
|--|--|
| `CopyFolder()` |public static bool CopyFolder(string sourPath, string destPath)</br> |
| `GetAllAssemblyTypes()` |public static IEnumerable<Type> GetAllAssemblyTypes()</br> |
| `GetAllTypesDerivedFrom()` |public static IEnumerable<Type> GetAllTypesDerivedFrom(Type type)</br> |
| `GetAllTypesDerivedFrom<T>()` |public static IEnumerable<Type> GetAllTypesDerivedFrom<T>()</br> |
@@ -721,6 +740,38 @@ Inherits or Implemented: [Attribute](#Attribute)
|--|--|
| `Reset()` |public void Reset()</br> |
## `SerieDataExtraComponentAttribute`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Contains()` |public bool Contains(Type type)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)</br> |
## `SerieDataExtraFieldAttribute`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Contains()` |public bool Contains(string field)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute()</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)</br> |
## `SerieExtraComponentAttribute`
Inherits or Implemented: [Attribute](#Attribute)
@@ -745,6 +796,7 @@ Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#
|public method|description|
|--|--|
| `GetSerieDataAutoColor()` |public virtual Color GetSerieDataAutoColor(SerieData serieData)</br> |
| `GetSerieDataLabelOffset()` |public virtual Vector3 GetSerieDataLabelOffset(SerieData serieData, LabelStyle label)</br> |
| `GetSerieDataLabelPosition()` |public virtual Vector3 GetSerieDataLabelPosition(SerieData serieData, LabelStyle label)</br> |
| `GetSerieDataTitlePosition()` |public virtual Vector3 GetSerieDataTitlePosition(SerieData serieData, TitleStyle titleStyle)</br> |
@@ -772,18 +824,18 @@ Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, int ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAreaColor()` |public static Color32 GetAreaColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> |
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> |
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
@@ -806,7 +858,7 @@ Inherits or Implemented: [Attribute](#Attribute)
| `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> |
| `UpdateCenter()` |public static void UpdateCenter(Serie serie, Vector3 chartPosition, float chartWidth, float chartHeight)</br>更新运行时中心点和半径 |
| `UpdateFilterData()` |public static void UpdateFilterData(Serie serie, DataZoom dataZoom)</br>根据dataZoom更新数据列表缓存 |
| `UpdateMinMaxData()` |public static void UpdateMinMaxData(Serie serie, int dimension, int ceilRate = 0, DataZoom dataZoom = null)</br>获得指定维数的最大最小值 |
| `UpdateMinMaxData()` |public static void UpdateMinMaxData(Serie serie, int dimension, double ceilRate = 0, DataZoom dataZoom = null)</br>获得指定维数的最大最小值 |
| `UpdateRect()` |public static void UpdateRect(Serie serie, Vector3 chartPosition, float chartWidth, float chartHeight)</br> |
| `UpdateSerieRuntimeFilterData()` |public static void UpdateSerieRuntimeFilterData(Serie serie, bool filterInvisible = true)</br> |
@@ -839,7 +891,6 @@ Inherits or Implemented: [Attribute](#Attribute)
| `GetLegalSerieNameList()` |public static List<string> GetLegalSerieNameList(List<Serie> series)</br> |
| `GetMaxSerieDataCount()` |public static int GetMaxSerieDataCount(List<Serie> series)</br> |
| `GetNameColor()` |public static Color GetNameColor(BaseChart chart, int index, string name)</br> |
| `GetSerieByVesselIndex()` |public static Serie GetSerieByVesselIndex(List<Serie> series, int vesselIndex)</br> |
| `GetStackSeries()` |public static void GetStackSeries(List<Serie> series, ref Dictionary<int, List<Serie>> stackSeries)</br>获得堆叠系列列表 |
| `IsAnyClipSerie()` |public static bool IsAnyClipSerie(List<Serie> series)</br>是否有需裁剪的serie。 |
| `IsLegalLegendName()` |public static bool IsLegalLegendName(string name)</br> |
@@ -859,6 +910,14 @@ Inherits or Implemented: [BaseChart](#BaseChart)
Inherits or Implemented: [BaseChart](#BaseChart)
## `Since`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Since()` |public Since(string version)</br> |
## `SVG`
|public method|description|
@@ -895,7 +954,7 @@ Inherits or Implemented: [MaskableGraphic](#MaskableGraphic)
|--|--|
| `GetItemNumericFormatter()` |public static string GetItemNumericFormatter(Tooltip tooltip, Serie serie, SerieData serieData)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Tooltip tooltip, ThemeStyle theme)</br> |
| `IsIgnoreItemFormatter()` |public static bool IsIgnoreItemFormatter(string itemFormatter)</br> |
| `IsIgnoreFormatter()` |public static bool IsIgnoreFormatter(string itemFormatter)</br> |
| `LimitInRect()` |public static void LimitInRect(Tooltip tooltip, Rect chartRect)</br> |
## `TooltipView`

View File

@@ -33,6 +33,7 @@
- [FormatterHelper](#FormatterHelper)
- [GridCoordContext](#GridCoordContext)
- [HeatmapChart](#HeatmapChart)
- [IgnoreDoc](#IgnoreDoc)
- [InteractData](#InteractData)
- [LayerHelper](#LayerHelper)
- [LegendContext](#LegendContext)
@@ -65,6 +66,8 @@
- [SerieContext](#SerieContext)
- [SerieConvertAttribute](#SerieConvertAttribute)
- [SerieDataContext](#SerieDataContext)
- [SerieDataExtraComponentAttribute](#SerieDataExtraComponentAttribute)
- [SerieDataExtraFieldAttribute](#SerieDataExtraFieldAttribute)
- [SerieExtraComponentAttribute](#SerieExtraComponentAttribute)
- [SerieHandler](#SerieHandler)
- [SerieHandler<T>](#SerieHandler<T>)
@@ -77,6 +80,7 @@
- [SimplifiedBarChart](#SimplifiedBarChart)
- [SimplifiedCandlestickChart](#SimplifiedCandlestickChart)
- [SimplifiedLineChart](#SimplifiedLineChart)
- [Since](#Since)
- [SVG](#SVG)
- [SVGImage](#SVGImage)
- [SVGPath](#SVGPath)
@@ -117,7 +121,7 @@ Inherits or Implemented: [MainComponentHandler](#MainComponentHandler)
|public method|description|
|--|--|
| `AdjustCircleLabelPos()` |public static void AdjustCircleLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)</br> |
| `AdjustMinMaxValue()` |public static void AdjustMinMaxValue(Axis axis, ref double minValue, ref double maxValue, bool needFormat, int ceilRate = 0)</br>调整最大最小值 |
| `AdjustMinMaxValue()` |public static void AdjustMinMaxValue(Axis axis, ref double minValue, ref double maxValue, bool needFormat, double ceilRate = 0)</br>调整最大最小值 |
| `AdjustRadiusAxisLabelPos()` |public static void AdjustRadiusAxisLabelPos(ChartLabel txt, Vector3 pos, Vector3 cenPos, float txtHig, Vector3 offset)</br> |
| `GetAxisLineArrowOffset()` |public static float GetAxisLineArrowOffset(Axis axis)</br>包含箭头偏移的轴线长度 |
| `GetAxisPosition()` |public static float GetAxisPosition(GridCoord grid, Axis axis, double value, int dataCount = 0, DataZoom dataZoom = null)</br> |
@@ -144,10 +148,12 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
|public method|description|
|--|--|
| `AddChartComponent()` |public MainComponent AddChartComponent(Type type)</br> |
| `AddData()` |public SerieData AddData(int serieIndex, DateTime time, double yValue, string dataName = null, string dataId = null)</br>添加time,y数据到指定的系列中。 |
| `AddData()` |public SerieData AddData(int serieIndex, double data, string dataName = null, string dataId = null)</br>添加一个数据到指定的系列中。 |
| `AddData()` |public SerieData AddData(int serieIndex, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
| `AddData()` |public SerieData AddData(int serieIndex, double xValue, double yValue, string dataName = null, string dataId = null)</br>添加x,y数据到指定系列中。 |
| `AddData()` |public SerieData AddData(int serieIndex, List<double> multidimensionalData, string dataName = null, string dataId = null)</br>添加多维数据x,y,z...)到指定的系列中。 |
| `AddData()` |public SerieData AddData(string serieName, DateTime time, double yValue, string dataName = null, string dataId = null)</br>添加time,y数据到指定的系列中。 |
| `AddData()` |public SerieData AddData(string serieName, double data, string dataName = null, string dataId = null)</br>If serieName doesn't exist in legend,will be add to legend. |
| `AddData()` |public SerieData AddData(string serieName, double open, double close, double lowest, double heighest, string dataName = null, string dataId = null)</br> |
| `AddData()` |public SerieData AddData(string serieName, double xValue, double yValue, string dataName = null, string dataId = null)</br>添加x,y数据到指定系列中。 |
@@ -232,6 +238,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `RefreshPainter()` |public void RefreshPainter(int index)</br> |
| `RefreshPainter()` |public void RefreshPainter(Serie serie)</br> |
| `RefreshTopPainter()` |public void RefreshTopPainter()</br> |
| `RefreshUpperPainter()` |public void RefreshUpperPainter()</br> |
| `RemoveAllChartComponent()` |public void RemoveAllChartComponent()</br> |
| `RemoveChartComponent()` |public bool RemoveChartComponent(MainComponent component)</br> |
| `RemoveChartComponent()` |public bool RemoveChartComponent(Type type, int index = 0)</br> |
@@ -252,6 +259,7 @@ Inherits or Implemented: [BaseGraph](#BaseGraph),[ISerializationCallbackReceiver
| `SetSerieActive()` |public void SetSerieActive(string serieName, bool active)</br>设置指定系列是否显示。 |
| `SetSeriePainterMaterial()` |public void SetSeriePainterMaterial(Material material)</br>设置Serie Painter的材质球 |
| `SetTopPainterMaterial()` |public void SetTopPainterMaterial(Material material)</br>设置Top Painter的材质球 |
| `SetUpperPainterMaterial()` |public void SetUpperPainterMaterial(Material material)</br>设置Upper Painter的材质球 |
| `TryAddChartComponent()` |public bool TryAddChartComponent(Type type)</br> |
| `TryGetChartComponent<T>()` |public bool TryGetChartComponent<T>(out T component, int index = 0)</br> |
| `UdpateXAxisIcon()` |public void UdpateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)</br>更新X轴图标。 |
@@ -335,10 +343,10 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `GetFullName()` |public static string GetFullName(Transform transform)</br> |
| `GetHighlightColor()` |public static Color32 GetHighlightColor(Color32 color, float rate = 0.8f)</br> |
| `GetLastValue()` |public static Vector3 GetLastValue(List<Vector3> list)</br> |
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, int ceilRate)</br> |
| `GetMaxDivisibleValue()` |public static double GetMaxDivisibleValue(double max, double ceilRate)</br> |
| `GetMaxLogValue()` |public static double GetMaxLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, int ceilRate)</br> |
| `GetMinLogValue()` |public static float GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetMinDivisibleValue()` |public static double GetMinDivisibleValue(double min, double ceilRate)</br> |
| `GetMinLogValue()` |public static double GetMinLogValue(double value, float logBase, bool isLogBaseE, out int splitNumber)</br> |
| `GetPointList()` |public static void GetPointList(ref List<Vector3> posList, Vector3 sp, Vector3 ep, float k = 30f)</br> |
| `GetPos()` |public static Vector3 GetPos(Vector3 center, float radius, float angle, bool isDegree = false)</br> |
| `GetPosition()` |public static Vector3 GetPosition(Vector3 center, float angle, float radius)</br> |
@@ -368,6 +376,7 @@ Inherits or Implemented: [BaseChart](#BaseChart)
| `SetActive()` |public static void SetActive(Image image, bool active)</br> |
| `SetActive()` |public static void SetActive(Text text, bool active)</br> |
| `SetActive()` |public static void SetActive(Transform transform, bool active)</br>通过设置scale实现是否显示优化性能减少GC |
| `SetBackground()` |public static void SetBackground(Image background, ImageStyle imageStyle)</br> |
| `SetColorOpacity()` |public static void SetColorOpacity(ref Color32 color, float opacity)</br> |
## `ChartLabel`
@@ -483,6 +492,7 @@ Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `NeedFormat()` |public static bool NeedFormat(string content)</br> |
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string numericFormatter, double value)</br> |
| `ReplaceAxisLabelContent()` |public static void ReplaceAxisLabelContent(ref string content, string value)</br> |
| `TrimAndReplaceLine()` |public static string TrimAndReplaceLine(string content)</br> |
@@ -496,6 +506,14 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
Inherits or Implemented: [BaseChart](#BaseChart)
## `IgnoreDoc`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `IgnoreDoc()` |public IgnoreDoc()</br> |
## `InteractData`
|public method|description|
@@ -529,9 +547,10 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
|--|--|
| `CheckDataHighlighted()` |public static bool CheckDataHighlighted(Serie serie, string legendName, bool heighlight)</br> |
| `CheckDataShow()` |public static bool CheckDataShow(Serie serie, string legendName, bool show)</br> |
| `GetContentColor()` |public static Color GetContentColor(int legendIndex, Legend legend, ThemeStyle theme, bool active)</br> |
| `GetContentColor()` |public static Color GetContentColor(BaseChart chart, int legendIndex, string legendName, Legend legend, ThemeStyle theme, bool active)</br> |
| `GetIconColor()` |public static Color GetIconColor(BaseChart chart, Legend legend, int readIndex, string legendName, bool active)</br> |
| `ResetItemPosition()` |public static void ResetItemPosition(Legend legend, Vector3 chartPos, float chartWidth, float chartHeight)</br> |
| `SetLegendBackground()` |public static void SetLegendBackground(Legend legend, ImageStyle style)</br> |
## `LegendItem`
@@ -540,6 +559,7 @@ Inherits or Implemented: [MainComponentContext](#MainComponentContext)
| `GetIconColor()` |public Color GetIconColor()</br> |
| `GetIconRect()` |public Rect GetIconRect()</br> |
| `SetActive()` |public void SetActive(bool active)</br> |
| `SetBackground()` |public void SetBackground(ImageStyle imageStyle)</br> |
| `SetButton()` |public void SetButton(Button button)</br> |
| `SetContent()` |public bool SetContent(string content)</br> |
| `SetContentBackgroundColor()` |public void SetContentBackgroundColor(Color color)</br> |
@@ -691,7 +711,6 @@ Inherits or Implemented: [BaseChart](#BaseChart)
|public method|description|
|--|--|
| `CopyFolder()` |public static bool CopyFolder(string sourPath, string destPath)</br> |
| `GetAllAssemblyTypes()` |public static IEnumerable<Type> GetAllAssemblyTypes()</br> |
| `GetAllTypesDerivedFrom()` |public static IEnumerable<Type> GetAllTypesDerivedFrom(Type type)</br> |
| `GetAllTypesDerivedFrom<T>()` |public static IEnumerable<Type> GetAllTypesDerivedFrom<T>()</br> |
@@ -721,6 +740,38 @@ Inherits or Implemented: [Attribute](#Attribute)
|--|--|
| `Reset()` |public void Reset()</br> |
## `SerieDataExtraComponentAttribute`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Contains()` |public bool Contains(Type type)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute()</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6)</br> |
| `SerieDataExtraComponentAttribute()` |public SerieDataExtraComponentAttribute(Type type1, Type type2, Type type3, Type type4, Type type5, Type type6, Type type7)</br> |
## `SerieDataExtraFieldAttribute`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Contains()` |public bool Contains(string field)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute()</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6)</br> |
| `SerieDataExtraFieldAttribute()` |public SerieDataExtraFieldAttribute(string field1, string field2, string field3, string field4, string field5, string field6, string field7)</br> |
## `SerieExtraComponentAttribute`
Inherits or Implemented: [Attribute](#Attribute)
@@ -745,6 +796,7 @@ Inherits or Implemented: [SerieHandler where T](#SerieHandler where T),[Serie](#
|public method|description|
|--|--|
| `GetSerieDataAutoColor()` |public virtual Color GetSerieDataAutoColor(SerieData serieData)</br> |
| `GetSerieDataLabelOffset()` |public virtual Vector3 GetSerieDataLabelOffset(SerieData serieData, LabelStyle label)</br> |
| `GetSerieDataLabelPosition()` |public virtual Vector3 GetSerieDataLabelPosition(SerieData serieData, LabelStyle label)</br> |
| `GetSerieDataTitlePosition()` |public virtual Vector3 GetSerieDataTitlePosition(SerieData serieData, TitleStyle titleStyle)</br> |
@@ -772,18 +824,18 @@ Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `CopySerie()` |public static void CopySerie(Serie oldSerie, Serie newSerie)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, int ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAllMinMaxData()` |public static void GetAllMinMaxData(Serie serie, double ceilRate = 0, DataZoom dataZoom = null)</br> |
| `GetAreaColor()` |public static Color32 GetAreaColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAreaStyle()` |public static AreaStyle GetAreaStyle(Serie serie, SerieData serieData)</br> |
| `GetAreaToColor()` |public static Color32 GetAreaToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetAverageData()` |public static double GetAverageData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetItemColor()` |public static Color32 GetItemColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetItemColor0()` |public static Color32 GetItemColor0(Serie serie, SerieData serieData, ThemeStyle theme, bool highlight, Color32 defaultColor)</br> |
| `GetItemFormatter()` |public static string GetItemFormatter(Serie serie, SerieData serieData, string defaultFormatter = null)</br> |
| `GetItemMarker()` |public static string GetItemMarker(Serie serie, SerieData serieData, string defaultMarker = null)</br> |
| `GetItemStyle()` |public static ItemStyle GetItemStyle(Serie serie, SerieData serieData, bool highlight = false)</br> |
| `GetItemStyleEmphasis()` |public static ItemStyle GetItemStyleEmphasis(Serie serie, SerieData serieData)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetItemToColor()` |public static Color32 GetItemToColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight, bool opacity = true)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Serie serie, SerieData serieData, ThemeStyle theme, int index, bool highlight)</br> |
| `GetLineStyle()` |public static LineStyle GetLineStyle(Serie serie, SerieData serieData)</br> |
| `GetMaxData()` |public static double GetMaxData(Serie serie, int dimension = 1, DataZoom dataZoom = null)</br> |
@@ -806,7 +858,7 @@ Inherits or Implemented: [Attribute](#Attribute)
| `IsDownPoint()` |public static bool IsDownPoint(Serie serie, int index)</br> |
| `UpdateCenter()` |public static void UpdateCenter(Serie serie, Vector3 chartPosition, float chartWidth, float chartHeight)</br>更新运行时中心点和半径 |
| `UpdateFilterData()` |public static void UpdateFilterData(Serie serie, DataZoom dataZoom)</br>根据dataZoom更新数据列表缓存 |
| `UpdateMinMaxData()` |public static void UpdateMinMaxData(Serie serie, int dimension, int ceilRate = 0, DataZoom dataZoom = null)</br>获得指定维数的最大最小值 |
| `UpdateMinMaxData()` |public static void UpdateMinMaxData(Serie serie, int dimension, double ceilRate = 0, DataZoom dataZoom = null)</br>获得指定维数的最大最小值 |
| `UpdateRect()` |public static void UpdateRect(Serie serie, Vector3 chartPosition, float chartWidth, float chartHeight)</br> |
| `UpdateSerieRuntimeFilterData()` |public static void UpdateSerieRuntimeFilterData(Serie serie, bool filterInvisible = true)</br> |
@@ -839,7 +891,6 @@ Inherits or Implemented: [Attribute](#Attribute)
| `GetLegalSerieNameList()` |public static List<string> GetLegalSerieNameList(List<Serie> series)</br> |
| `GetMaxSerieDataCount()` |public static int GetMaxSerieDataCount(List<Serie> series)</br> |
| `GetNameColor()` |public static Color GetNameColor(BaseChart chart, int index, string name)</br> |
| `GetSerieByVesselIndex()` |public static Serie GetSerieByVesselIndex(List<Serie> series, int vesselIndex)</br> |
| `GetStackSeries()` |public static void GetStackSeries(List<Serie> series, ref Dictionary<int, List<Serie>> stackSeries)</br>获得堆叠系列列表 |
| `IsAnyClipSerie()` |public static bool IsAnyClipSerie(List<Serie> series)</br>是否有需裁剪的serie。 |
| `IsLegalLegendName()` |public static bool IsLegalLegendName(string name)</br> |
@@ -859,6 +910,14 @@ Inherits or Implemented: [BaseChart](#BaseChart)
Inherits or Implemented: [BaseChart](#BaseChart)
## `Since`
Inherits or Implemented: [Attribute](#Attribute)
|public method|description|
|--|--|
| `Since()` |public Since(string version)</br> |
## `SVG`
|public method|description|
@@ -895,7 +954,7 @@ Inherits or Implemented: [MaskableGraphic](#MaskableGraphic)
|--|--|
| `GetItemNumericFormatter()` |public static string GetItemNumericFormatter(Tooltip tooltip, Serie serie, SerieData serieData)</br> |
| `GetLineColor()` |public static Color32 GetLineColor(Tooltip tooltip, ThemeStyle theme)</br> |
| `IsIgnoreItemFormatter()` |public static bool IsIgnoreItemFormatter(string itemFormatter)</br> |
| `IsIgnoreFormatter()` |public static bool IsIgnoreFormatter(string itemFormatter)</br> |
| `LimitInRect()` |public static void LimitInRect(Tooltip tooltip, Rect chartRect)</br> |
## `TooltipView`

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -32,7 +32,6 @@
[QA 26: How do I use the background component? What are the conditions?](#How-do-I-use-the-background-component-What-are-the-conditions)
[QA 27: Mesh can not have more than 65000 vertices?](#Mesh-cannot-have-more-than-65000-vertices)
[QA 28: Why are the parameters set in Serie reset after they run?](#Why-are-the-parameters-set-in-Serie-reset-after-they-run)
[QA 29: Why are many custom colors lost after upgrading to 1.6.0? How should I upgrade?](#Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade)
## How-to-adjust-the-margin-between-the-axis-and-the=-background
@@ -146,16 +145,6 @@ A: This is the limit of `UGUI` on the number of vertices for a single `Graphic`.
A: 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.
## Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade
A: In version `1.6.0`, in order to reduce implicit conversion, all drawing related `Color` was changed to `Color32`, so some custom colors were lost. The main components affected are: `ItemStyle`, `LineStyle`, `AreaStyle`, `Vessel`, `VisualMap`, `AxisSplitArea`, `AxisSplitLine`, `GaugeAxis`,`SerieLabel`, etc. Can use the script [UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) to upgrade.
The upgrade steps are as follows:
1. Back up the project.
2. Download or copy the script [UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) in the old project `Editor`, Change the `color` field inside to `color.clear` (because some fields may not exist in the old version).
3. After compilation, the old version of color configuration file is exported through `menu bar -> XCharts-> ExportColorConfig` (the configuration file is saved by default to `color.config` under `Assets`).
4. Upgrade `XCharts` to the latest version.
5. The custom color can be restored by importing `color.config` through `menu bar -> XCharts-> ImportColorConfig` (if `color.config` is not under `Assets` of the upgraded project, copy it to this directory).
[XCharts Homepage](https://github.com/XCharts-Team/XCharts)</br>
[XCharts API](XChartsAPI-EN.md)</br>
[XCharts Configuration](XChartsConfiguration-EN.md)

View File

@@ -32,7 +32,9 @@
[QA 26如何使用背景组件有什么条件限制](#如何使用背景组件_有什么条件限制)
[QA 27Mesh can not have more than 65000 vertices?](#Mesh_cannot_have_more_than_65000_vertices)
[QA 28为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
[QA 29为什么升级到1.6.0版本后很多自定义颜色丢失了?应该如何升级?](#为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级)
[QA 29如何修改Serie的Symbol的颜色?](#如何修改Serie的Symbol的颜色)
[QA 30导入或更新XCharts时TMP报错怎么办?](#导入或更新XCharts时TMP报错怎么办)
[QA 31支持空数据吗如何实现折线图断开的效果?](#支持空数据吗_如何实现折线图断开的效果)
## 如何调整坐标轴与背景的边距
@@ -68,7 +70,7 @@
## 如何调整图表的对齐方式
答:默认为左下角对齐暂不支持调整。可以通过包一层parent来辅助控制。最新版本`1.5.0`及以上已支持任意锚点可和做UI一样任意调整对其方式
答:调整RectTransform的锚点和UGUI的其他组件的用法一致
## 可以显示超过1000以上的大数据吗
@@ -88,7 +90,7 @@
## 如何在数据项顶上显示文本
答:通过设置`Serie`下的`Label`
答:通过设置`Serie`下的`Label`3.0版本需要先添加`LabelStyle`组件。
## 如何给数据项自定义图标
@@ -124,7 +126,7 @@
## 如何做成预设
答:请删除chart下所有的子组件再拖成预设
答:做成prefab前执行一下`Rebuild Chart Object`重新刷新节点,避免有冗余的节点存在
## 如何在图表上画点画线等自定义内容
@@ -150,17 +152,20 @@
答:检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
## 为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级
## 如何修改Serie的Symbol的颜色
答:1.6.0版本为了减少隐式转换,将所有的绘制相关的`Color`都改为了`Color32`,所以会导致一些自定义的颜色的丢失。影响到的主要组件有:`ItemStyle``LineStyle``AreaStyle``Vessel``VisualMap``AxisSplitArea``AxisSplitLine``GaugeAxis``SerieLabel`等。可以用脚本[UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级
升级步骤如下:
1. 备份好你的项目。
2. 先不升级`XCharts`,只下载或拷贝脚本[UpgradeChartColor.cs](https://github.com/XCharts-Team/XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)放到旧项目的`Editor`由于旧版本可能不存在某些新版本才有的图表或者属性配置可能会编译错误需要处理按34步骤处理一下。
3. 若是由`itemStyle.toColor2`引起的编译报错,可将导出地方的`itemStyle.toColor2`改为`Color.clear`;导入的地方注释掉即可。
4. 若是由`LiquidChart`引起的编译报错,将所有涉及`LiquidChart`的地方都注释掉即可。
5. 编译通过后,通过`菜单栏->XCharts->ExportColorConfig`导出旧版本的颜色配置文件(配置文件默认保存到`Assets`下的`color.config`)。
6. 升级`XCharts`到最新版本。
7. 通过`菜单栏->XCharts->ImportColorConfig``color.config`导入即可恢复自定义的颜色(如果`color.config`不在升级后的项目的`Assets`下的话需要拷贝到此目录下)。
答:`Symbol` 的颜色是使用的 `ItemStyle``color`
## 导入或更新XCharts时TMP报错怎么办
XCharts默认时不开启TMP所以asmdef上没有TMP的引用。当本地开启TMP后再更新XCharts可能会出现这个问题。可通过以下两种方式解决
1. 找到`XCharts.Runtime.asmdef``XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用
2. 移除`PlayerSetting``Scripting Define Symbols``dUI_TextMeshPro`
## 支持空数据吗_如何实现折线图断开的效果
答:`Serie``data``double`类型,所以无法表示空数据。可通过开启`Serie``ignore`和指定`ignoreValue`来达到空数据的效果。也可以每个`SerieData`设置`ignore`参数。忽略数据后断开还是连接可设置`ignoreLineBreak`参数。
[XCharts主页](https://github.com/XCharts-Team/XCharts)
[XChartsAPI](XChartsAPI-ZH.md)

View File

@@ -7,56 +7,58 @@
## 获取和导入 XCharts
1. 直接放入XCharts源码到项目
XCharts可通过以下任意一种方式导入到项目
- 直接将XCharts源码到项目
下载好XCharts源码后直接将XCharts目录拷贝到Unity项目工程的Assets目录下。
2. 通过`Assets/Import Package`导入XCharts
- 通过`Assets/Import Package`导入XCharts
下载好XCharts的.unitypackage文件后打开Unity菜单栏 Assets-->Import Package-->选中.unitypackage导入即可开始使用XCharts。
3. 通过`Package Manager`导入XCharts
- 通过`Package Manager`导入XCharts
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts打开Package Manager后通过 `Add package form git URL...`输入XCharts的github URL: https://github.com/XCharts-Team/XCharts.git#master 稍等片刻后即可使用XCharts。
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts打开Package Manager后通过 `Add package form git URL...`输入XCharts3.0的GitHub URL: `https://github.com/XCharts-Team/XCharts.git#3.0` 稍等片刻后即可使用XCharts。
也可以直接将package加入到`manifest.json`文件:打开`Packages`目录下的`manifest.json`文件,在`dependencies`下加入:
``` json
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#master",
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#3.0",
```
如需更新`XCharts`,删除`manifest.json`文件部分Unity版本可能是packages-lock.json文件的`lock`下的`com.monitor1394.xcharts`相关内容即会重新下载编译。
## 添加一个简单图表
在`Hierarchy`图下右键或菜单栏`GameObject`下拉`XCharts->LineChart`
![op_addchart](res/op_addchart.png)
即可快速创建一个简单的折线图出来:
在`Hierarchy`图下右键或菜单栏`GameObject`下拉选择`XCharts->LineChart`,即可快速创建一个默认的折线图出来
![linechart1](res/linechart1.png)
## 添加多个Seire
如何在上图的基础上添加两条折线呢,只需`Add Serie`按钮,选择对应的`Serie`类型即可
在`Inspector`视图,找到`LineChart`的面板,通过`Add Serie`按钮,可以添加第二条`Line`折线
![op_addserie](res/op_addserie.png)
![linechart2](res/linechart2.png)
## 添加其他组件
默认图表没有`Legend`,需要`Legend`组件可通过`Add Component`按钮添加:
![op_addcomponent](res/op_addcomponent.png)
## 添加Serie组件
如果需要给折线图区域填充颜色,可单独给`Serie`添加`Component`
Serie只自带了几个常见的组件其他组件按需额外添加。比如需要给折线图区域填充颜色,可单独给`Serie`添加`AreaStyle`组件
![op_addseriecomponent](res/op_addseriecomponent.png)
![linechart3](res/linechart3.png)
## 添加SerieData组件
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给第一个折线图的第二个数据单独显示`Label`
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给折线图的第二个数据单独显示`Label`
![op_addseriedatacomponent](res/op_addseriedatacomponent.png)
![linechart4](res/linechart4.png)
@@ -68,11 +70,17 @@
## 如何快速调整参数
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的。你改了也会变还原
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的,即使改了也会在刷新时被还原回来
快速定位你想要改的效果对应的组件。这就需要对组件有一定的了解。比如我们想要让X轴的轴线末端显示箭头如何定位第一步X轴定位到`XAxis0`;第二步,轴线定位到`AxisLine`;最后,再去看`AxisLine`组件下有没有这样的参数可以实现这个效果。
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色例,如果`SerieData`的`ItemStyle`配置有颜色值,则优先用这个颜色值。
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色为例:
1. 如果`SerieData`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
2. 如果`Serie`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
3. 否则颜色值取自主题`Theme`的`Color Palette`。
通常颜色值为0000时表示用主题默认颜色配置为0或null时表示用主题默认配置。
## 用代码添加折线图
@@ -140,6 +148,7 @@ for (int i = 0; i < 10; i++)
```
这样一个简单的折线图就出来了:
![linechart-simple](res/linechart-simple.png)
如果一个Chart里面有多个系列时则Axis的data只需要加一次不要多个循环加重复了。记住Axis的数据个数要和Serie的数据个数一致。
@@ -148,16 +157,38 @@ for (int i = 0; i < 10; i++)
你还可以用代码控制更多的参数,`Examples`下还有更多的其他例子,凡是`Inspector`上看到的可配置的参数,都可以通过代码来设置。[XCharts配置项手册](XChartsConfiguration-ZH.md)里面的所有参数都是可以通过代码控制的。
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/XCharts-Team/XCharts/master/Documentation/XChartsAPI-ZH.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
另外,除非定制,建议调用`Chart`下提供的`public`接口,特别是数据相关操作部分。这些接口内部会做一些关联处理,比如刷新图表等。常见的接口有:
1. `chart.ClearData()`清空图表数据不移除Series
2. `chart.RemoveData()`清除图表数据会移除所有Serie
3. `chart.AddSerie()`添加Serie
4. `chart.AddXAxisData()`添加X轴数据
5. `chart.AddData()`添加Serie数据
6. `chart.UpdateData()`更新Serie数据
7. `chart.UpdateXAxisData()`更新X轴数据
8. `chart.UpdateDataName()`更新Serie数据的名字
XCharts内部有自动刷新机制但也是在一定条件下。如果自己调用了内部组件的接口碰到组件没有刷新确实找不到原因的话可以用以下两个接口强制刷新
1. `chart.RefreshAllComponent()`:刷新图表组件,会重新初始化所有组件,不建议频繁待用。
2. `chart.RefreshChart()`:刷新图表绘制,只刷新绘制部分,不会刷新组件文本,位置等部分。
## 使用TextMeshPro
XCharts支持TextMeshPro但默认是不开启的需要自己手动切换。可通过一下两种方式开启和关闭:
XCharts支持TextMeshPro但默认是不开启的需要自己手动切换。可通过以下方式开启和关闭:
![textmeshpro1](res/op_textmeshpro.png)
![textmeshpro2](res/op_textmeshpro2.png)
开启后需要设置好TextMeshPro要用的全局字体也可以在主题Theme里单独设置
![textmeshpro-font](res/op_textmeshpro3.png)
建议在项目初就规划好是否使用TextMeshPro在有很多图表的情况下再切换可能导致某些图表无法正常初始化这时可能需要每个图表单独的使用`Remove All Chart Object`来清理让图表重新初始化。
建议在项目初就规划好是否使用TextMeshPro并设置好字体。在已有很多图表的情况下切换TMP时可能某些图表无法自动刷新可以手动点击`Rebuild Chart Object`按钮来重建图表,即可正常初始化。
开启了TMP项目在更新XCharts时可能会碰到丢失了TMP引用而无法编译通过的问题可通过以下两种方式解决
1. 找到`XCharts.Runtime.asmdef`和`XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用
2. 移除`PlayerSetting`中`Scripting Define Symbols`的`dUI_TextMeshPro`宏
## 用代码改图表参数
@@ -180,7 +211,7 @@ xAxis.type = Axis.AxisType.Category;
### 改Serie的参数
新添加Serie
新添加Serie
```C#
var serie = chart.AddSerie<Pie>();
@@ -220,7 +251,7 @@ var serieData = chart.AddData(0, 20);
//var serieData = serie.GetSerieData(0); //从已有数据中获取
serieData.radius = 10;
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //启用SerieData的Component
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件
itemStyle.color = Color.blue;
```

View File

@@ -7,56 +7,58 @@
## 获取和导入 XCharts
1. 直接放入XCharts源码到项目
XCharts可通过以下任意一种方式导入到项目
- 直接将XCharts源码到项目
下载好XCharts源码后直接将XCharts目录拷贝到Unity项目工程的Assets目录下。
2. 通过`Assets/Import Package`导入XCharts
- 通过`Assets/Import Package`导入XCharts
下载好XCharts的.unitypackage文件后打开Unity菜单栏 Assets-->Import Package-->选中.unitypackage导入即可开始使用XCharts。
3. 通过`Package Manager`导入XCharts
- 通过`Package Manager`导入XCharts
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts打开Package Manager后通过 `Add package form git URL...`输入XCharts的github URL: https://github.com/XCharts-Team/XCharts.git#master 稍等片刻后即可使用XCharts。
对于Unity 2018.3以上版本,可通过 Package Manager来导入XCharts打开Package Manager后通过 `Add package form git URL...`输入XCharts3.0的GitHub URL: `https://github.com/XCharts-Team/XCharts.git#3.0` 稍等片刻后即可使用XCharts。
也可以直接将package加入到`manifest.json`文件:打开`Packages`目录下的`manifest.json`文件,在`dependencies`下加入:
``` json
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#master",
"com.monitor1394.xcharts": "https://github.com/XCharts-Team/XCharts.git#3.0",
```
如需更新`XCharts`,删除`manifest.json`文件部分Unity版本可能是packages-lock.json文件的`lock`下的`com.monitor1394.xcharts`相关内容即会重新下载编译。
## 添加一个简单图表
在`Hierarchy`图下右键或菜单栏`GameObject`下拉`XCharts->LineChart`
![op_addchart](res/op_addchart.png)
即可快速创建一个简单的折线图出来:
在`Hierarchy`图下右键或菜单栏`GameObject`下拉选择`XCharts->LineChart`,即可快速创建一个默认的折线图出来
![linechart1](res/linechart1.png)
## 添加多个Seire
如何在上图的基础上添加两条折线呢,只需`Add Serie`按钮,选择对应的`Serie`类型即可
在`Inspector`视图,找到`LineChart`的面板,通过`Add Serie`按钮,可以添加第二条`Line`折线
![op_addserie](res/op_addserie.png)
![linechart2](res/linechart2.png)
## 添加其他组件
默认图表没有`Legend`,需要`Legend`组件可通过`Add Component`按钮添加:
![op_addcomponent](res/op_addcomponent.png)
## 添加Serie组件
如果需要给折线图区域填充颜色,可单独给`Serie`添加`Component`
Serie只自带了几个常见的组件其他组件按需额外添加。比如需要给折线图区域填充颜色,可单独给`Serie`添加`AreaStyle`组件
![op_addseriecomponent](res/op_addseriecomponent.png)
![linechart3](res/linechart3.png)
## 添加SerieData组件
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给第一个折线图的第二个数据单独显示`Label`
如果需要个性化定制每个数据项的配置,可以单独给每个`SerieData`添加`Component`。比如我们给折线图的第二个数据单独显示`Label`
![op_addseriedatacomponent](res/op_addseriedatacomponent.png)
![linechart4](res/linechart4.png)
@@ -68,11 +70,17 @@
## 如何快速调整参数
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的。你改了也会变还原
`XCharts`是配置参数驱动。想要什么效果,你只需要去调整对应组件下的配置参数就可以,不需要去改`Hierarchy`图下的节点,因为那些节点是由`XCharts`内部根据配置参数生成的,即使改了也会在刷新时被还原回来
快速定位你想要改的效果对应的组件。这就需要对组件有一定的了解。比如我们想要让X轴的轴线末端显示箭头如何定位第一步X轴定位到`XAxis0`;第二步,轴线定位到`AxisLine`;最后,再去看`AxisLine`组件下有没有这样的参数可以实现这个效果。
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色例,如果`SerieData`的`ItemStyle`配置有颜色值,则优先用这个颜色值。
`XCharts`提供从全局`Theme`、系列`Serie`、单个数据项`SerieData`全方位的参数配置。优先级从大到小为:`SerieData`->`Serie`->`Theme`。以`ItemStyle`的颜色为例:
1. 如果`SerieData`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
2. 如果`Serie`的`ItemStyle`配置有非`0000`颜色值,则优先用这个颜色值。
3. 否则颜色值取自主题`Theme`的`Color Palette`。
通常颜色值为0000时表示用主题默认颜色配置为0或null时表示用主题默认配置。
## 用代码添加折线图
@@ -140,6 +148,7 @@ for (int i = 0; i < 10; i++)
```
这样一个简单的折线图就出来了:
![linechart-simple](res/linechart-simple.png)
如果一个Chart里面有多个系列时则Axis的data只需要加一次不要多个循环加重复了。记住Axis的数据个数要和Serie的数据个数一致。
@@ -148,16 +157,39 @@ for (int i = 0; i < 10; i++)
你还可以用代码控制更多的参数,`Examples`下还有更多的其他例子,凡是`Inspector`上看到的可配置的参数,都可以通过代码来设置。[XCharts配置项手册](XChartsConfiguration-ZH.md)里面的所有参数都是可以通过代码控制的。
另外,除非定制,建议调用[XChartsAPI接口](https://github.com/XCharts-Team/XCharts/master/Documentation/XChartsAPI-ZH.md) 里面的接口,这些接口内部会做一些关联处理,比如刷新图表等。如果自己调用了内部组件的接口,需要自己处理刷新等其他问题。
另外,除非定制,建议调用`Chart`下提供的`public`接口,特别是数据相关操作部分。这些接口内部会做一些关联处理,比如刷新图表等。常见的接口有:
1. `chart.ClearData()`清空图表数据不移除Series
2. `chart.RemoveData()`清除图表数据会移除所有Serie
3. `chart.AddSerie()`添加Serie
4. `chart.AddXAxisData()`添加X轴数据
5. `chart.AddData()`添加Serie数据
6. `chart.UpdateData()`更新Serie数据
7. `chart.UpdateXAxisData()`更新X轴数据
8. `chart.UpdateDataName()`更新Serie数据的名字
XCharts内部有自动刷新机制但也是在一定条件下。如果自己调用了内部组件的接口碰到组件没有刷新确实找不到原因的话可以用以下两个接口强制刷新
1. `chart.RefreshAllComponent()`:刷新图表组件,会重新初始化所有组件,不建议频繁待用。
2. `chart.RefreshChart()`:刷新图表绘制,只刷新绘制部分,不会刷新组件文本,位置等部分。
3. 各个组件也可以通过`SetAllDirty()`只刷新自己。
## 使用TextMeshPro
XCharts支持TextMeshPro但默认是不开启的需要自己手动切换。可通过一下两种方式开启和关闭:
XCharts支持TextMeshPro但默认是不开启的需要自己手动切换。可通过以下方式开启和关闭:
![textmeshpro1](res/op_textmeshpro.png)
![textmeshpro2](res/op_textmeshpro2.png)
开启后需要设置好TextMeshPro要用的全局字体也可以在主题Theme里单独设置
![textmeshpro-font](res/op_textmeshpro3.png)
建议在项目初就规划好是否使用TextMeshPro在有很多图表的情况下再切换可能导致某些图表无法正常初始化这时可能需要每个图表单独的使用`Remove All Chart Object`来清理让图表重新初始化。
建议在项目初就规划好是否使用TextMeshPro并设置好字体。在已有很多图表的情况下切换TMP时可能某些图表无法自动刷新可以手动点击`Rebuild Chart Object`按钮来重建图表,即可正常初始化。
开启了TMP项目在更新XCharts时可能会碰到丢失了TMP引用而无法编译通过的问题可通过以下两种方式解决
1. 找到`XCharts.Runtime.asmdef`和`XCharts.Editor.asmdef`,手动加上 `TextMeshPro`的引用
2. 移除`PlayerSetting`中`Scripting Define Symbols`的`dUI_TextMeshPro`宏
## 用代码改图表参数
@@ -180,7 +212,7 @@ xAxis.type = Axis.AxisType.Category;
### 改Serie的参数
新添加Serie
新添加Serie
```C#
var serie = chart.AddSerie<Pie>();
@@ -220,7 +252,7 @@ var serieData = chart.AddData(0, 20);
//var serieData = serie.GetSerieData(0); //从已有数据中获取
serieData.radius = 10;
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //启用SerieData的Component
var itemStyle = serieData.GetOrAddComponent<ItemStyle>(); //给数据项添加ItemStyle组件
itemStyle.color = Color.blue;
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 33ca1e807bf9b44daa62fa68040f7a17
guid: c62c735b2989c4367b8c97b8ca75c216
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5b533c6dca4e643c0a3cf0152ea053c3
guid: d824662da0d024d1f95c8d10c870e3ca
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}

View File

@@ -1,5 +1,3 @@
using System;
namespace XCharts.Editor

View File

@@ -1,5 +1,3 @@
using System;
namespace XCharts.Editor

View File

@@ -1,4 +1,3 @@

using System;
using System.Collections.Generic;
using System.Text;
@@ -45,7 +44,7 @@ namespace XCharts.Editor
protected virtual void OnEnable()
{
if (target == null) return;
m_Chart = (BaseChart)target;
m_Chart = (BaseChart) target;
m_Script = serializedObject.FindProperty("m_Script");
m_EnableTextMeshPro = serializedObject.FindProperty("m_EnableTextMeshPro");
m_ChartName = serializedObject.FindProperty("m_ChartName");
@@ -172,7 +171,7 @@ namespace XCharts.Editor
{
m_Series.Add(prop.GetArrayElementAtIndex(i));
}
m_Series.Sort(delegate (SerializedProperty a, SerializedProperty b)
m_Series.Sort(delegate(SerializedProperty a, SerializedProperty b)
{
var index1 = a.FindPropertyRelative("m_Index").intValue;
var index2 = b.FindPropertyRelative("m_Index").intValue;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -23,7 +22,6 @@ namespace XCharts.Editor
PropertyField(prop, "m_DataChangeEnable");
PropertyField(prop, "m_DataChangeDuration");
PropertyField(prop, "m_ActualDuration");
PropertyField(prop, "m_AlongWithLinePath");
--EditorGUI.indentLevel;
}
}

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -110,7 +109,7 @@ namespace XCharts.Editor
{
if (IngorePropertys.Contains(relativePropName)) return;
if (!ChartEditorHelper.PropertyFieldWithMinValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
relativePropName, minValue))
relativePropName, minValue))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
}
@@ -119,7 +118,7 @@ namespace XCharts.Editor
{
if (IngorePropertys.Contains(relativePropName)) return;
if (!ChartEditorHelper.PropertyFieldWithMaxValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
relativePropName, maxValue))
relativePropName, maxValue))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
}
@@ -163,25 +162,40 @@ namespace XCharts.Editor
}
}
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, bool relativePropEnable,
params HeaderMenuInfo[] menus)
params HeaderMenuInfo[] menus)
{
if (string.IsNullOrEmpty(relativePropName))
{
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, null, relativePropEnable, menus);
m_DisplayName, null, null, relativePropEnable, menus);
}
else
{
{
var relativeProp = prop.FindPropertyRelative(relativePropName);
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, relativeProp, relativePropEnable, menus);
m_DisplayName, relativeProp, null, relativePropEnable, menus);
}
}
protected virtual void DrawExtendeds(SerializedProperty prop)
protected bool MakeComponentFoldout(SerializedProperty prop, string relativePropName, string relativePropName2,
bool relativePropEnable, params HeaderMenuInfo[] menus)
{
if (string.IsNullOrEmpty(relativePropName))
{
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, null, null, relativePropEnable, menus);
}
else
{
var relativeProp = prop.FindPropertyRelative(relativePropName);
var relativeProp2 = prop.FindPropertyRelative(relativePropName2);
return ChartEditorHelper.MakeComponentFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, relativeProp, relativeProp2, relativePropEnable, menus);
}
}
protected virtual void DrawExtendeds(SerializedProperty prop) { }
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
var key = GetKeyName(prop);

View File

@@ -0,0 +1,26 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(CommentItem), true)]
public class CommentItemDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "CommentItem"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", "m_Content", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Content");
PropertyField(prop, "m_Position");
//PropertyField(prop, "m_MarkRect");
//PropertyField(prop, "m_MarkStyle");
PropertyField(prop, "m_LabelStyle");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 418b81a68e59a4572ab57787b5362d5a
guid: d485d6a729a1449cdb5032f380fba70f
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,22 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(CommentMarkStyle), true)]
public class CommentMarkStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "MarkStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_LineStyle");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a6d8757fbd847419aaed450e020e827c
guid: d74ed458b24774b129611ed816b6b6cd
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,4 +1,3 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -59,6 +58,7 @@ namespace XCharts.Editor
{
public override string ClassName { get { return "Axis"; } }
}
[CustomPropertyDrawer(typeof(RadiusAxisTheme), true)]
public class RadiusAxisThemeDrawer : BaseAxisThemeDrawer
{
@@ -67,8 +67,9 @@ namespace XCharts.Editor
{
get
{
return new List<string> {
"m_TextBackgroundColor" ,
return new List<string>
{
"m_TextBackgroundColor",
"m_LineLength",
"m_SplitLineLength",
};

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -23,4 +22,22 @@ namespace XCharts.Editor
}
}
}
[CustomPropertyDrawer(typeof(EmphasisItemStyle), true)]
public class EmphasisItemStyleDrawer : ItemStyleDrawer
{
public override string ClassName { get { return "EmphasisItemStyle"; } }
}
[CustomPropertyDrawer(typeof(EmphasisLabelStyle), true)]
public class EmphasisLabelStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "EmphasisLabel"; } }
}
[CustomPropertyDrawer(typeof(EmphasisLabelLine), true)]
public class EmphasisLabelLineDrawer : LabelLineDrawer
{
public override string ClassName { get { return "EmphasisLabelLine"; } }
}
}

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -24,7 +23,7 @@ namespace XCharts.Editor
}
}
}
[CustomPropertyDrawer(typeof(LineArrow), true)]
public class LineArrowStyleDrawer : BasePropertyDrawer
{

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -47,6 +46,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_AutoColor");
}
}
[CustomPropertyDrawer(typeof(AxisTick), true)]
public class AxisTickDrawer : BaseLineDrawer
{

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,25 +0,0 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(SerieDataBaseInfo), true)]
public class SerieDataBaseInfoDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "BaseInfo"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", false))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_Selected");
PropertyField(prop, "m_Radius");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -1,4 +1,3 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -16,7 +15,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SymbolType.Custom)
{
@@ -28,7 +27,7 @@ namespace XCharts.Editor
}
PropertyField(prop, "m_Gap");
PropertyField(prop, "m_SizeType");
switch ((SymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
switch ((SymbolSizeType) prop.FindPropertyRelative("m_SizeType").enumValueIndex)
{
case SymbolSizeType.Custom:
PropertyField(prop, "m_Size");

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -13,21 +12,23 @@ namespace XCharts.Editor
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset", () =>
{
var chart = prop.serializedObject.targetObject as BaseChart;
chart.settings.Reset();
})))
{
var chart = prop.serializedObject.targetObject as BaseChart;
chart.settings.Reset();
})))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_ReversePainter");
PropertyField(prop, "m_MaxPainter");
PropertyField(prop, "m_BasePainterMaterial");
PropertyField(prop, "m_SeriePainterMaterial");
PropertyField(prop, "m_UpperPainterMaterial");
PropertyField(prop, "m_TopPainterMaterial");
PropertyField(prop, "m_LineSmoothStyle");
PropertyField(prop, "m_LineSmoothness");
PropertyField(prop, "m_LineSegmentDistance");
PropertyField(prop, "m_CicleSmoothness");
PropertyField(prop, "m_AxisMaxSplitNumber");
PropertyField(prop, "m_LegendIconLineWidth");
PropertyListField(prop, "m_LegendIconCornerRadius", true);
--EditorGUI.indentLevel;

View File

@@ -1,4 +1,3 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -16,7 +15,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SymbolType.Custom)
{

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,12 +1,11 @@

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(TextPadding), true)]
public class TextPaddingDrawer : BasePropertyDrawer
[CustomPropertyDrawer(typeof(Padding), true)]
public class PaddingDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Padding"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
@@ -23,4 +22,9 @@ namespace XCharts.Editor
}
}
}
[CustomPropertyDrawer(typeof(TextPadding), true)]
public class TextPaddingDrawer : PaddingDrawer
{
}
}

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using UnityEngine;
#if dUI_TextMeshPro
@@ -30,6 +29,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_LineSpacing");
#if dUI_TextMeshPro
PropertyField(prop, "m_TMPFontStyle");
PropertyField(prop, "m_TMPSpriteAsset");
PropertyField(prop, "m_TMPAlignment");
#else
PropertyField(prop, "m_FontStyle");

View File

@@ -1,4 +1,3 @@

using System.IO;
using UnityEditor;
using UnityEngine;
@@ -20,17 +19,17 @@ namespace XCharts.Editor
var defaultX = pos.x;
var chart = prop.serializedObject.targetObject as BaseChart;
if (MakeComponentFoldout(prop, "m_Show", false, new HeaderMenuInfo("Reset|Reset to theme default color", () =>
{
chart.theme.sharedTheme.ResetTheme();
chart.RefreshAllComponent();
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
{
ExportThemeWindow.target = chart;
EditorWindow.GetWindow(typeof(ExportThemeWindow));
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
{
chart.theme.SyncSharedThemeColorToCustom();
})))
{
chart.theme.sharedTheme.ResetTheme();
chart.RefreshAllComponent();
}), new HeaderMenuInfo("Export|Export theme to asset for a new theme", () =>
{
ExportThemeWindow.target = chart;
EditorWindow.GetWindow(typeof(ExportThemeWindow));
}), new HeaderMenuInfo("Sync color to custom|Sync shared theme color to custom color", () =>
{
chart.theme.SyncSharedThemeColorToCustom();
})))
{
++EditorGUI.indentLevel;
var chartNameList = XCThemeMgr.GetAllThemeNames();
@@ -46,12 +45,12 @@ namespace XCharts.Editor
PropertyField(prop, "m_SharedTheme");
PropertyField(prop, "m_TransparentBackground");
PropertyField(prop, "m_EnableCustomTheme");
using (new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
{
PropertyField(prop, "m_CustomBackgroundColor");
PropertyField(prop, "m_CustomColorPalette");
}
--EditorGUI.indentLevel;
using(new EditorGUI.DisabledScope(!prop.FindPropertyRelative("m_EnableCustomTheme").boolValue))
{
PropertyField(prop, "m_CustomBackgroundColor");
PropertyField(prop, "m_CustomColorPalette");
}
--EditorGUI.indentLevel;
}
}
@@ -71,7 +70,7 @@ namespace XCharts.Editor
private string m_ChartName;
static void Init()
{
window = (ExportThemeWindow)EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
window = (ExportThemeWindow) EditorWindow.GetWindow(typeof(ExportThemeWindow), false, "Export Theme", true);
window.minSize = new Vector2(600, 50);
window.maxSize = new Vector2(600, 50);
window.Show();
@@ -117,14 +116,14 @@ namespace XCharts.Editor
}
else if (IsAssetsExist(XCThemeMgr.GetThemeAssetPath(m_ChartName)))
{
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath="
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
ShowNotification(new GUIContent("ERROR:The asset is exist! \npath=" +
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
}
else
{
XCThemeMgr.ExportTheme(target.theme.sharedTheme, m_ChartName);
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath="
+ XCThemeMgr.GetThemeAssetPath(m_ChartName)));
ShowNotification(new GUIContent("SUCCESS:The theme is exported. \npath=" +
XCThemeMgr.GetThemeAssetPath(m_ChartName)));
}
}
}

View File

@@ -1,4 +1,4 @@
using UnityEditor;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -13,7 +12,7 @@ namespace XCharts.Editor
var m_Type = baseProperty.FindPropertyRelative("m_Type");
var m_LogBase = baseProperty.FindPropertyRelative("m_LogBase");
var m_MinMaxType = baseProperty.FindPropertyRelative("m_MinMaxType");
var type = (Axis.AxisType)m_Type.enumValueIndex;
var type = (Axis.AxisType) m_Type.enumValueIndex;
EditorGUI.indentLevel++;
if (component is ParallelAxis)
{
@@ -41,7 +40,7 @@ namespace XCharts.Editor
if (type == Axis.AxisType.Value || type == Axis.AxisType.Time)
{
PropertyField("m_MinMaxType");
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType) m_MinMaxType.enumValueIndex;
switch (minMaxType)
{
case Axis.AxisMinMaxType.Default:
@@ -95,13 +94,11 @@ namespace XCharts.Editor
[ComponentEditor(typeof(XAxis))]
public class XAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(YAxis))]
public class YAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(SingleAxis))]
public class SingleAxisEditor : AxisEditor
@@ -132,13 +129,11 @@ namespace XCharts.Editor
[ComponentEditor(typeof(RadiusAxis))]
public class RadiusAxisEditor : AxisEditor
{
}
{ }
[ComponentEditor(typeof(ParallelAxis))]
public class ParallelAxisEditor : AxisEditor
{
}
{ }
[CustomPropertyDrawer(typeof(AxisLabel), true)]
public class AxisLabelDrawer : BasePropertyDrawer
@@ -159,6 +154,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_ShowEndLabel");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
@@ -168,6 +164,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_TextPadding");
PropertyField(prop, "m_TextLimit");
--EditorGUI.indentLevel;
}
}
@@ -184,6 +181,7 @@ namespace XCharts.Editor
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_OnZero");
PropertyField(prop, "m_LabelStyle");
--EditorGUI.indentLevel;
}

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using XCharts.Runtime;
@@ -15,7 +13,7 @@ namespace XCharts.Editor
PropertyField("m_Image");
PropertyField("m_ImageType");
PropertyField("m_ImageColor");
PropertyField("m_HideThemeBackgroundColor");
PropertyField("m_AutoColor");
--EditorGUI.indentLevel;
}
}

View File

@@ -0,0 +1,18 @@
using UnityEditor;
using XCharts.Runtime;
namespace XCharts.Editor
{
[ComponentEditor(typeof(Comment))]
public class CommentEditor : MainComponentEditor<Comment>
{
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
PropertyField("m_LabelStyle");
//PropertyField("m_MarkStyle");
PropertyListField("m_Items", true);
--EditorGUI.indentLevel;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f2364066bf3174aa39b79020266ce72d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;
@@ -15,12 +14,16 @@ namespace XCharts.Editor
PropertyField("m_ItemHeight");
PropertyField("m_ItemGap");
PropertyField("m_ItemAutoColor");
PropertyField("m_ItemOpacity");
PropertyField("m_SelectedMode");
PropertyField("m_Orient");
PropertyField("m_Formatter");
PropertyField("m_Location");
PropertyField("m_LabelStyle");
PropertyField("m_Background");
PropertyField("m_Padding");
PropertyListField("m_Icons");
PropertyListField("m_Colors");
PropertyListField("m_Data");
--EditorGUI.indentLevel;
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.Assertions;
@@ -28,12 +27,10 @@ namespace XCharts.Editor
}
public virtual void OnEnable()
{
}
{ }
public virtual void OnDisable()
{
}
{ }
internal void OnInternalInspectorGUI()
{
@@ -42,12 +39,10 @@ namespace XCharts.Editor
}
public virtual void OnInspectorGUI()
{
}
{ }
protected virtual void DrawExtendeds()
{
}
{ }
public virtual string GetDisplayTitle()
{

View File

@@ -1,10 +1,8 @@
using XCharts.Runtime;
namespace XCharts.Editor
{
public class MainComponentEditor<T> : MainComponentBaseEditor
where T : MainComponent
{
}
where T : MainComponent
{ }
}

View File

@@ -1,9 +1,8 @@
using System;
using System.Collections.Generic;
using UnityEngine.Assertions;
using UnityEditor;
using System.Linq;
using UnityEditor;
using UnityEngine.Assertions;
using XCharts.Runtime;
namespace XCharts.Editor
@@ -84,7 +83,7 @@ namespace XCharts.Editor
editor.showProperty,
() => { ResetComponentEditor(id); },
() => { RemoveComponentEditor(id); }
);
);
if (displayContent)
{
editor.OnInternalInspectorGUI();
@@ -120,7 +119,7 @@ namespace XCharts.Editor
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
editorType = typeof(MainComponentBaseEditor);
var editor = (MainComponentBaseEditor)Activator.CreateInstance(editorType);
var editor = (MainComponentBaseEditor) Activator.CreateInstance(editorType);
editor.Init(chart, component, property, m_BaseEditor);
if (index < 0)

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -31,7 +30,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
var type = (MarkAreaType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
var type = (MarkAreaType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Name");
switch (type)

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -28,7 +27,7 @@ namespace XCharts.Editor
if (MakeComponentFoldout(prop, "", true))
{
++EditorGUI.indentLevel;
var type = (MarkLineType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
var type = (MarkLineType) (prop.FindPropertyRelative("m_Type")).enumValueIndex;
var group = prop.FindPropertyRelative("m_Group").intValue;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Name");

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -12,7 +10,14 @@ namespace XCharts.Editor
[CustomEditor(typeof(Theme))]
public class ThemeEditor : UnityEditor.Editor
{
static class Styles
{
internal static GUIContent btnReset = new GUIContent("Reset", "Reset to default theme");
internal static GUIContent btnSync = new GUIContent("Sync Font", "Sync main theme font to sub theme font");
}
private Theme m_Theme;
void OnEnable()
{
m_Theme = target as Theme;
@@ -20,15 +25,15 @@ namespace XCharts.Editor
public override void OnInspectorGUI()
{
// serializedObject.Update();
// EditorGUILayout.PropertyField(m_BackgroundColor);
// EditorGUILayout.PropertyField(m_ColorPalette);
// serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
if (GUILayout.Button(new GUIContent("Reset", "Reset to default theme")))
if (GUILayout.Button(Styles.btnReset))
{
m_Theme.ResetTheme();
}
if (GUILayout.Button(Styles.btnSync))
{
m_Theme.SyncFontToSubComponent();
}
}
}
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -11,7 +10,7 @@ namespace XCharts.Editor
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
var type = (VisualMap.Type)baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
var type = (VisualMap.Type) baseProperty.FindPropertyRelative("m_Type").enumValueIndex;
var isPiece = type == VisualMap.Type.Piecewise;
PropertyField("m_Type");
PropertyField("m_SerieIndex");
@@ -39,19 +38,19 @@ namespace XCharts.Editor
PropertyField("m_Location");
}
PropertyListField("m_OutOfRange");
PropertyListField(isPiece ? "m_Pieces" : "m_InRange");
PropertyListField("m_InRange");
--EditorGUI.indentLevel;
}
}
[CustomPropertyDrawer(typeof(VisualMapPieces), true)]
public class PiecesDrawer : BasePropertyDrawer
[CustomPropertyDrawer(typeof(VisualMapRange), true)]
public class VisualMapRangeDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Pieces"; } }
public override string ClassName { get { return "Range"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
if (MakeFoldout(prop, "m_Color"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Min");

View File

@@ -1,4 +1,3 @@
using XCharts.Runtime;
namespace XCharts.Editor

View File

@@ -11,17 +11,14 @@ namespace XCharts.Editor
PropertyField("m_Gap");
PropertyTwoFiled("m_Center");
PropertyTwoFiled("m_Radius");
//PropertyField("m_StartAngle");
PropertyField("m_AvoidLabelOverlap");
PropertyFiledMore(() =>
{
PropertyField("m_MinAngle");
PropertyField("m_RoundCap");
PropertyField("m_Ignore");
PropertyField("m_IgnoreValue");
PropertyField("m_AvoidLabelOverlap");
});
PropertyField("m_ItemStyle");
PropertyField("m_Animation");
}

View File

@@ -9,7 +9,7 @@ namespace XCharts.Editor
{
PropertyField("m_RadarType");
PropertyField("m_RadarIndex");
PropertyField("m_Symbol");
PropertyField("m_LineStyle");
PropertyField("m_ItemStyle");

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using UnityEditor;
@@ -17,6 +16,7 @@ namespace XCharts.Editor
internal SerializedProperty baseProperty;
internal SerializedProperty showProperty;
internal List<HeaderMenuInfo> menus = new List<HeaderMenuInfo>();
internal List<HeaderMenuInfo> serieDataMenus = new List<HeaderMenuInfo>();
protected Dictionary<string, Type> m_CoordOptionsDic;
protected List<string> m_CoordOptionsNames;
private string m_DisplayName;
@@ -62,12 +62,10 @@ namespace XCharts.Editor
}
public virtual void OnEnable()
{
}
{ }
public virtual void OnDisable()
{
}
{ }
internal void OnInternalInspectorGUI()
{
@@ -76,12 +74,10 @@ namespace XCharts.Editor
}
public virtual void OnInspectorGUI()
{
}
{ }
protected virtual void DrawExtendeds()
{
}
{ }
public virtual string GetDisplayTitle()
{
@@ -136,11 +132,11 @@ namespace XCharts.Editor
{
case SerializedPropertyType.Float:
if (prop.floatValue < min)
prop.floatValue = (float)min;
prop.floatValue = (float) min;
break;
case SerializedPropertyType.Integer:
if (prop.intValue < min)
prop.intValue = (int)min;
prop.intValue = (int) min;
break;
}
@@ -152,11 +148,11 @@ namespace XCharts.Editor
{
case SerializedPropertyType.Float:
if (prop.floatValue > max)
prop.floatValue = (float)max;
prop.floatValue = (float) max;
break;
case SerializedPropertyType.Integer:
if (prop.intValue > max)
prop.intValue = (int)max;
prop.intValue = (int) max;
break;
}
}

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -36,12 +35,11 @@ namespace XCharts.Editor
}
public virtual void OnCustomInspectorGUI()
{
}
{ }
private void OnExtraInspectorGUI()
{
foreach (var kv in Serie.extraComponentFieldNameDict)
foreach (var kv in Serie.extraComponentMap)
{
var prop = FindProperty(kv.Value);
if (prop.arraySize > 0)
@@ -52,11 +50,11 @@ namespace XCharts.Editor
private void PropertyFieldData()
{
m_DataFoldout = ChartEditorHelper.DrawHeader("Data", m_DataFoldout, false, null, null,
new HeaderMenuInfo("Import ECharts Data", () =>
{
PraseExternalDataEditor.UpdateData(chart, serie, null);
PraseExternalDataEditor.ShowWindow();
}));
new HeaderMenuInfo("Import ECharts Data", () =>
{
PraseExternalDataEditor.UpdateData(chart, serie, null);
PraseExternalDataEditor.ShowWindow();
}));
if (!m_DataFoldout) return;
EditorGUI.indentLevel++;
var m_Datas = FindProperty("m_Data");
@@ -75,7 +73,7 @@ namespace XCharts.Editor
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
}
if (listSize > 30)// && !XCSettings.editorShowAllListData)
if (listSize > 30) // && !XCSettings.editorShowAllListData)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
@@ -117,69 +115,69 @@ namespace XCharts.Editor
}
var fieldCount = dimension + (showName ? 1 : 0);
m_DataElementFoldout[index] = ChartEditorHelper.DrawHeader("SerieData " + index, flag, false, null,
delegate (Rect drawRect)
{
//drawRect.width -= 2f;
var maxX = drawRect.xMax;
var currentWidth = drawRect.width;
var lastX = drawRect.x;
var lastWid = drawRect.width;
var lastFieldWid = EditorGUIUtility.fieldWidth;
var lastLabelWid = EditorGUIUtility.labelWidth;
var serieData = m_Datas.GetArrayElementAtIndex(index);
var sereName = serieData.FindPropertyRelative("m_Name");
var data = serieData.FindPropertyRelative("m_Data");
delegate(Rect drawRect)
{
//drawRect.width -= 2f;
var maxX = drawRect.xMax;
var currentWidth = drawRect.width;
var lastX = drawRect.x;
var lastWid = drawRect.width;
var lastFieldWid = EditorGUIUtility.fieldWidth;
var lastLabelWid = EditorGUIUtility.labelWidth;
var serieData = m_Datas.GetArrayElementAtIndex(index);
var sereName = serieData.FindPropertyRelative("m_Name");
var data = serieData.FindPropertyRelative("m_Data");
#if UNITY_2019_3_OR_NEWER
var gap = 2;
var namegap = 3;
var gap = 2;
var namegap = 3;
#else
var gap = 0;
var namegap = 0;
var gap = 0;
var namegap = 0;
#endif
if (fieldCount <= 1)
{
while (2 > data.arraySize)
if (fieldCount <= 1)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
SerializedProperty element = data.GetArrayElementAtIndex(1);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
drawRect.x = startX;
drawRect.xMax = maxX;
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
else
{
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 2;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
while (2 > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 25;
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
SerializedProperty element = data.GetArrayElementAtIndex(1);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
drawRect.x = startX;
drawRect.xMax = maxX;
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
if (showName)
else
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 2;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 25;
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
if (showName)
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40 + dimension * namegap - 2.5f;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
}
EditorGUIUtility.fieldWidth = lastFieldWid;
EditorGUIUtility.labelWidth = lastLabelWid;
}
EditorGUIUtility.fieldWidth = lastFieldWid;
EditorGUIUtility.labelWidth = lastLabelWid;
}
});
});
if (m_DataElementFoldout[index])
{
if (!(serie is ISimplifiedSerie))
@@ -192,113 +190,53 @@ namespace XCharts.Editor
EditorGUI.indentLevel++;
var serieData = m_Datas.GetArrayElementAtIndex(index);
var m_Name = serieData.FindPropertyRelative("m_Name");
var m_Id = serieData.FindPropertyRelative("m_Id");
var m_ParentId = serieData.FindPropertyRelative("m_ParentId");
var m_BaseInfo = serieData.FindPropertyRelative("m_BaseInfos");
var m_Label = serieData.FindPropertyRelative("m_Labels");
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyles");
var m_Emphasis = serieData.FindPropertyRelative("m_Emphases");
var m_Symbol = serieData.FindPropertyRelative("m_Symbols");
var m_LineStyle = serieData.FindPropertyRelative("m_LineStyles");
var m_AreaStyle = serieData.FindPropertyRelative("m_AreaStyles");
var m_TitleStyle = serieData.FindPropertyRelative("m_TitleStyles");
PropertyField(m_Name);
PropertyField(m_Id);
PropertyField(m_ParentId);
if (serie.GetType().IsDefined(typeof(SerieDataExtraFieldAttribute), false))
{
var attribute = serie.GetType().GetAttribute<SerieDataExtraFieldAttribute>();
foreach (var field in attribute.fields)
{
PropertyField(serieData.FindPropertyRelative(field));
}
}
var componentNum = m_BaseInfo.arraySize + m_Label.arraySize + m_ItemStyle.arraySize + m_Emphasis.arraySize
+ m_Symbol.arraySize + m_LineStyle.arraySize + m_AreaStyle.arraySize;
var title = "Component";
if (componentNum == 0) title += " (None)";
m_DataComponentFoldout = ChartEditorHelper.DrawHeader(title, m_DataComponentFoldout, false, null, null,
new HeaderMenuInfo("Add BaseInfo", () =>
serieDataMenus.Clear();
if (serie.GetType().IsDefined(typeof(SerieDataExtraComponentAttribute), false))
{
serie.GetSerieData(index).GetOrAddComponent<SerieDataBaseInfo>();
}, m_BaseInfo.arraySize == 0),
new HeaderMenuInfo("Add ItemStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<ItemStyle>();
}, m_ItemStyle.arraySize == 0),
new HeaderMenuInfo("Add Label", () =>
{
serie.GetSerieData(index).GetOrAddComponent<LabelStyle>();
}, m_Label.arraySize == 0),
new HeaderMenuInfo("Add Emphasis", () =>
{
serie.GetSerieData(index).GetOrAddComponent<Emphasis>();
}, m_Emphasis.arraySize == 0),
new HeaderMenuInfo("Add Symbol", () =>
{
serie.GetSerieData(index).GetOrAddComponent<SerieSymbol>();
}, m_Symbol.arraySize == 0),
new HeaderMenuInfo("Add LineStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<LineStyle>();
}, m_LineStyle.arraySize == 0),
new HeaderMenuInfo("Add AreaStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<AreaStyle>();
}, m_AreaStyle.arraySize == 0),
new HeaderMenuInfo("Add TitleStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<TitleStyle>();
}, m_TitleStyle.arraySize == 0),
new HeaderMenuInfo("Remove BaseInfo", () =>
{
serie.GetSerieData(index).RemoveComponent<SerieDataBaseInfo>();
}, m_BaseInfo.arraySize > 0),
new HeaderMenuInfo("Remove ItemStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<ItemStyle>();
}, m_ItemStyle.arraySize > 0),
new HeaderMenuInfo("Remove Label", () =>
{
serie.GetSerieData(index).RemoveComponent<LabelStyle>();
}, m_Label.arraySize > 0),
new HeaderMenuInfo("Remove Emphasis", () =>
{
serie.GetSerieData(index).RemoveComponent<Emphasis>();
}, m_Emphasis.arraySize > 0),
new HeaderMenuInfo("Remove Symbol", () =>
{
serie.GetSerieData(index).RemoveComponent<SerieSymbol>();
}, m_Symbol.arraySize > 0),
new HeaderMenuInfo("Remove LineStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<LineStyle>();
}, m_LineStyle.arraySize > 0),
new HeaderMenuInfo("Remove AreaStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<AreaStyle>();
}, m_AreaStyle.arraySize > 0),
new HeaderMenuInfo("Remove TitleStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<TitleStyle>();
}, m_TitleStyle.arraySize > 0),
new HeaderMenuInfo("Remove All", () =>
var attribute = serie.GetType().GetAttribute<SerieDataExtraComponentAttribute>();
foreach (var type in attribute.types)
{
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
serieDataMenus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
{
serie.GetSerieData(index).GetOrAddComponent(type);
EditorUtility.SetDirty(chart);
}, size == 0));
}
foreach (var type in attribute.types)
{
var size = serieData.FindPropertyRelative(SerieData.extraComponentMap[type]).arraySize;
serieDataMenus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
{
serie.GetSerieData(index).RemoveComponent(type);
EditorUtility.SetDirty(chart);
}, size > 0));
}
}
serieDataMenus.Add(new HeaderMenuInfo("Remove All", () =>
{
serie.GetSerieData(index).RemoveAllComponent();
}, componentNum > 0));
}, true));
m_DataComponentFoldout = ChartEditorHelper.DrawHeader("Component", m_DataComponentFoldout, false, null, null, serieDataMenus);
if (m_DataComponentFoldout)
{
if (m_BaseInfo.arraySize > 0)
PropertyField(m_BaseInfo.GetArrayElementAtIndex(0));
if (m_Label.arraySize > 0)
PropertyField(m_Label.GetArrayElementAtIndex(0));
if (m_ItemStyle.arraySize > 0)
PropertyField(m_ItemStyle.GetArrayElementAtIndex(0));
if (m_Emphasis.arraySize > 0)
PropertyField(m_Emphasis.GetArrayElementAtIndex(0));
if (m_Symbol.arraySize > 0)
PropertyField(m_Symbol.GetArrayElementAtIndex(0));
if (m_LineStyle.arraySize > 0)
PropertyField(m_LineStyle.GetArrayElementAtIndex(0));
if (m_AreaStyle.arraySize > 0)
PropertyField(m_AreaStyle.GetArrayElementAtIndex(0));
if (m_TitleStyle.arraySize > 0)
PropertyField(m_TitleStyle.GetArrayElementAtIndex(0));
foreach (var kv in SerieData.extraComponentMap)
{
var prop = serieData.FindPropertyRelative(kv.Value);
if (prop.arraySize > 0)
PropertyField(prop.GetArrayElementAtIndex(0));
}
}
EditorGUI.indentLevel--;
}

View File

@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using UnityEngine.Assertions;
using UnityEditor;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine.Assertions;
using XCharts.Runtime;
namespace XCharts.Editor
@@ -22,7 +21,6 @@ namespace XCharts.Editor
List<SerieBaseEditor> m_Editors;
private bool m_SerieFoldout;
public SerieListEditor(BaseChartEditor editor)
{
Assert.IsNotNull(editor);
@@ -136,7 +134,7 @@ namespace XCharts.Editor
if (!m_EditorTypes.TryGetValue(settingsType, out editorType))
editorType = typeof(SerieBaseEditor);
var editor = (SerieBaseEditor)Activator.CreateInstance(editorType);
var editor = (SerieBaseEditor) Activator.CreateInstance(editorType);
editor.Init(chart, serie, property, m_BaseEditor);
editor.menus.Clear();
editor.menus.Add(new HeaderMenuInfo("Clone", () =>
@@ -176,7 +174,7 @@ namespace XCharts.Editor
var attribute = editor.serie.GetType().GetAttribute<SerieExtraComponentAttribute>();
foreach (var type in attribute.types)
{
var size = editor.FindProperty(Serie.extraComponentFieldNameDict[type]).arraySize;
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
editor.menus.Add(new HeaderMenuInfo("Add " + type.Name, () =>
{
editor.serie.AddExtraComponent(type);
@@ -187,7 +185,7 @@ namespace XCharts.Editor
}
foreach (var type in attribute.types)
{
var size = editor.FindProperty(Serie.extraComponentFieldNameDict[type]).arraySize;
var size = editor.FindProperty(Serie.extraComponentMap[type]).arraySize;
editor.menus.Add(new HeaderMenuInfo("Remove " + type.Name, () =>
{
editor.serie.RemoveExtraComponent(type);

View File

@@ -1,4 +1,3 @@
using XCharts.Runtime;
namespace XCharts.Editor

View File

@@ -1,8 +1,7 @@

using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
@@ -53,7 +52,7 @@ namespace XCharts.Editor
public static void SecondField(Rect drawRect, SerializedProperty prop)
{
RectOffset offset = new RectOffset(-(int)EditorGUIUtility.labelWidth, 0, 0, 0);
RectOffset offset = new RectOffset(-(int) EditorGUIUtility.labelWidth, 0, 0, 0);
drawRect = offset.Add(drawRect);
EditorGUI.PropertyField(drawRect, prop, GUIContent.none);
drawRect = offset.Remove(drawRect);
@@ -166,7 +165,7 @@ namespace XCharts.Editor
}
public static bool MakeComponentFoldout(ref Rect drawRect, Dictionary<string, float> heights,
Dictionary<string, bool> moduleToggle, string key, string content, SerializedProperty prop,
bool propEnable, params HeaderMenuInfo[] menus)
SerializedProperty prop2, bool propEnable, params HeaderMenuInfo[] menus)
{
var sourRect = drawRect;
float defaultWidth = drawRect.width;
@@ -181,10 +180,16 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Boolean)
{
if (!propEnable)
using (new EditorGUI.DisabledScope(true))
MakeBool(drawRect, prop);
using(new EditorGUI.DisabledScope(true))
MakeBool(drawRect, prop);
else
MakeBool(drawRect, prop);
if (prop2 != null && !moduleToggle[key])
{
drawRect.x = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + ARROW_WIDTH + BOOL_WIDTH;
drawRect.width = defaultWidth - drawRect.x + ARROW_WIDTH;
EditorGUI.PropertyField(drawRect, prop2, GUIContent.none);
}
}
else
{
@@ -201,8 +206,6 @@ namespace XCharts.Editor
return moduleToggle[key];
}
public static void MakeBool(Rect drawRect, SerializedProperty boolProp, int index = 0, string name = null)
{
float defaultWidth = drawRect.width;
@@ -378,9 +381,9 @@ namespace XCharts.Editor
{
var temp = INDENT_WIDTH + GAP_WIDTH + iconGap;
var isSerie = "Serie".Equals(element.type);
var elementRect = isSerie
? new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - 2 * iconGap, drawRect.height)
: new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
var elementRect = isSerie ?
new Rect(drawRect.x, drawRect.y, drawRect.width + INDENT_WIDTH - 2 * iconGap, drawRect.height) :
new Rect(drawRect.x, drawRect.y, drawRect.width - 3 * iconWidth, drawRect.height);
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
var iconRect = new Rect(drawRect.width - 3 * iconWidth + temp, drawRect.y, iconWidth, drawRect.height);
var oldColor = GUI.contentColor;
@@ -436,7 +439,7 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue < minValue)
prop.floatValue = minValue;
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue < minValue)
prop.intValue = (int)minValue;
prop.intValue = (int) minValue;
var hig = EditorGUI.GetPropertyHeight(prop);
drawRect.y += hig;
heights[key] += hig;
@@ -451,7 +454,7 @@ namespace XCharts.Editor
if (prop.propertyType == SerializedPropertyType.Float && prop.floatValue > maxValue)
prop.floatValue = maxValue;
if (prop.propertyType == SerializedPropertyType.Integer && prop.intValue > maxValue)
prop.intValue = (int)maxValue;
prop.intValue = (int) maxValue;
var hig = EditorGUI.GetPropertyHeight(prop);
drawRect.y += hig;
heights[key] += hig;
@@ -540,7 +543,7 @@ namespace XCharts.Editor
Action<Rect> drawCallback, params HeaderMenuInfo[] menus)
{
var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT);
var labelRect = DrawHeaderInternal(rect, title, state, drawBackground, activeField);
var labelRect = DrawHeaderInternal(rect, title, ref state, drawBackground, activeField);
DrawMenu(rect, menus);
if (drawCallback != null)
{
@@ -565,7 +568,7 @@ namespace XCharts.Editor
Action<Rect> drawCallback, List<HeaderMenuInfo> menus)
{
var rect = GUILayoutUtility.GetRect(1f, HEADER_HEIGHT);
var labelRect = DrawHeaderInternal(rect, title, state, drawBackground, activeField);
var labelRect = DrawHeaderInternal(rect, title, ref state, drawBackground, activeField);
DrawMenu(rect, menus);
if (drawCallback != null)
{
@@ -586,7 +589,7 @@ namespace XCharts.Editor
return state;
}
private static Rect DrawHeaderInternal(Rect rect, string title, bool state, bool drawBackground, SerializedProperty activeField)
private static Rect DrawHeaderInternal(Rect rect, string title, ref bool state, bool drawBackground, SerializedProperty activeField)
{
var splitRect = rect;
splitRect.x = EditorGUI.indentLevel * INDENT_WIDTH + 4;

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using UnityEngine;
@@ -9,12 +7,11 @@ namespace XCharts.Editor
{
static readonly Color splitterDark = new Color(0.12f, 0.12f, 0.12f, 0.5f);
static readonly Color splitterLight = new Color(0.6f, 0.6f, 0.6f, 0.5f);
static readonly Texture2D paneOptionsIconDark = (Texture2D)EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png");
static readonly Texture2D paneOptionsIconLight = (Texture2D)EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png");
static readonly Texture2D paneOptionsIconDark = (Texture2D) EditorGUIUtility.Load("Builtin Skins/DarkSkin/Images/pane options.png");
static readonly Texture2D paneOptionsIconLight = (Texture2D) EditorGUIUtility.Load("Builtin Skins/LightSkin/Images/pane options.png");
static readonly Color headerBackgroundDark = new Color(0.1f, 0.1f, 0.1f, 0.2f);
static readonly Color headerBackgroundLight = new Color(1f, 1f, 1f, 0.2f);
public static readonly GUIStyle headerStyle = UnityEditor.EditorStyles.boldLabel;
public static readonly GUIStyle foldoutStyle = new GUIStyle(UnityEditor.EditorStyles.foldout)
{
@@ -28,7 +25,6 @@ namespace XCharts.Editor
public static readonly GUIStyle invisibleButton = "InvisibleButton";
public static readonly GUIStyle smallTickbox = new GUIStyle("ShurikenToggle");
public static Color splitter { get { return EditorGUIUtility.isProSkin ? splitterDark : splitterLight; } }
public static Texture2D paneOptionsIcon { get { return EditorGUIUtility.isProSkin ? paneOptionsIconDark : paneOptionsIconLight; } }
public static Color headerBackground { get { return EditorGUIUtility.isProSkin ? headerBackgroundDark : headerBackgroundLight; } }

View File

@@ -1,4 +1,3 @@
using System.IO;
using UnityEditor;
using UnityEngine;

View File

@@ -1,4 +1,3 @@

using UnityEditor;
using XCharts.Runtime;

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using UnityEditor;
@@ -194,8 +193,7 @@ namespace XCharts.Editor
else if (a.StartsWith("selected:"))
{
string selected = a.Substring(9, a.Length - 9);
var baseInfo = serieData.GetOrAddComponent<SerieDataBaseInfo>();
baseInfo.selected = bool.Parse(selected);
serieData.selected = bool.Parse(selected);
}
}
serie.AddSerieData(serieData);

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -20,10 +19,8 @@ namespace XCharts.Editor
{
XCResourcesImporter m_ResourceImporter;
public XCResourceImporterProvider()
: base("Project/XCharts", SettingsScope.Project)
{
}
public XCResourceImporterProvider() : base("Project/XCharts", SettingsScope.Project)
{ }
public override void OnGUI(string searchContext)
{

View File

@@ -1,8 +1,7 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using XCharts.Runtime;
namespace XCharts.Editor
@@ -21,13 +20,18 @@ namespace XCharts.Editor
var canvasObject = new GameObject();
canvasObject.name = "Canvas";
canvas = canvasObject.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
canvas.renderMode = RenderMode.ScreenSpaceCamera;
var mainCamera = GameObject.FindGameObjectWithTag("MainCamera");
canvas.worldCamera = mainCamera == null? null : mainCamera.GetComponent<Camera>();
canvasObject.AddComponent<CanvasScaler>();
canvasObject.AddComponent<GraphicRaycaster>();
var eventSystem = new GameObject();
eventSystem.name = "EventSystem";
eventSystem.AddComponent<EventSystem>();
eventSystem.AddComponent<StandaloneInputModule>();
if (GameObject.Find("EventSystem") == null)
{
var eventSystem = new GameObject();
eventSystem.name = "EventSystem";
eventSystem.AddComponent<EventSystem>();
eventSystem.AddComponent<StandaloneInputModule>();
}
return canvas.transform;
}
}
@@ -134,6 +138,7 @@ namespace XCharts.Editor
{
AddChart<CandlestickChart>("CandlestickChart");
}
[MenuItem("XCharts/PolarChart", priority = 54)]
[MenuItem("GameObject/XCharts/PolarChart", priority = 54)]
public static void PolarChart()

Some files were not shown because too many files have changed in this diff Show More