Compare commits

...

115 Commits

Author SHA1 Message Date
monitor1394
b3320bd2cd Merge branch 'master' into 3.0 2022-08-16 08:31:50 +08:00
monitor1394
9e07fa1db3 v3.2.0 2022-08-16 07:43:22 +08:00
monitor1394
990c6dad90 [API][chart] RemoveAllSerie() 2022-08-15 08:21:28 +08:00
monitor1394
99dc2af42a [optimize] optimize smooth curve 2022-08-15 07:30:56 +08:00
monitor1394
f32808a36d [bug][datazoom] fix chart display error when datazoom enable. 2022-08-13 13:38:02 +08:00
monitor1394
ca5470a351 [feature][tooltip] support ignoreDataDefaultContent 2022-08-11 08:11:43 +08:00
monitor1394
34b132735d [bug] fix chart.RemoveSerie (#219) 2022-08-10 13:19:26 +08:00
monitor1394
0f31f057df [bug] fix rotation 2022-08-10 13:18:44 +08:00
monitor1394
65d32f7aec [improve][editor] improve editor edit 2022-08-10 08:16:19 +08:00
monitor1394
fcc1314f17 [optimize][axis] set chart default layer to UI 2022-08-10 07:22:41 +08:00
monitor1394
9981ce2d23 [optimize][axis] optimize minor split line of time axis 2022-08-09 13:38:23 +08:00
monitor1394
f1f2ea78be [feature][AreaStyle] support innerFill 2022-08-09 08:29:06 +08:00
monitor1394
d1f9c77571 [bug] fix serieData.index error 2022-08-09 08:01:19 +08:00
monitor1394
19914586ae [optimize][serie] optimize index of serieData 2022-08-08 07:43:19 +08:00
monitor1394
e7f19e72a5 update serie label 2022-08-02 13:03:33 +08:00
monitor1394
35220a1026 scheduled release date for v3.2.0 2022-08-02 08:01:22 +08:00
monitor1394
b9812a4f98 [feature][bug] fix import packge error 2022-07-29 13:25:05 +08:00
monitor1394
74b078c926 [feature][axis] support minorTick and minorSplitLine of time axis 2022-07-29 07:49:15 +08:00
monitor1394
44dc1f7b16 [feature][UGL] add UGL.DrawPolyon API 2022-07-28 13:33:38 +08:00
monitor1394
cdf0bc81e1 [feature][serie] support the colorBy of serie 2022-07-28 07:21:46 +08:00
monitor1394
5b2b2d4059 [feature][symbol] support symbol settings for StateStyle 2022-07-27 08:00:57 +08:00
monitor1394
b3b0c0b3aa v3.2.0 2022-07-27 08:00:11 +08:00
monitor1394
4f93628667 [feature][serie] support EmphasisStle,BlurStyle and SelectStyle 2022-07-25 07:46:03 +08:00
monitor1394
8dde322c04 [doc] class doc support since version 2022-07-20 08:15:27 +08:00
monitor1394
47ee421913 [bug][axis] fix showStartLabel and showEndLabel not work 2022-07-20 07:38:18 +08:00
monitor1394
0355e3ed46 [feature][axis] support minor tick and minor split line 2022-07-19 08:22:42 +08:00
monitor1394
eedafa7011 [feature][radar] support smooth line 2022-07-17 20:57:38 +08:00
monitor1394
aee49322b7 [feature][datazoom] support time axis 2022-07-15 08:37:14 +08:00
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
monitor1394
d77e1c3d91 v3.0.0-preivew9 2022-05-06 08:14:49 +08:00
monitor1394
d4b3f5eaa8 3.0.0-preview9 2022-05-06 08:12:15 +08:00
monitor1394
8a78867961 [doc] update doc 2022-05-05 13:23:33 +08:00
monitor1394
d9266b3c9c [refactor][optimize] item color 2022-05-05 13:10:04 +08:00
monitor1394
0801069f72 [add][line] line support dash (#197) 2022-05-04 20:47:02 +08:00
monitor1394
e92afac0de [add][legend] add the delegate callback for legend 2022-05-04 09:19:45 +08:00
monitor1394
d1fd4dcf44 [refactor] refactor symbol and label 2022-05-04 08:45:19 +08:00
monitor1394
43c31405b8 [bug][ring] fix ring label formatter (#195) 2022-05-01 10:54:14 +08:00
monitor1394
4e4d0bc85d [optimize][bar] bar support clip and min-max (#196) 2022-05-01 10:30:58 +08:00
monitor1394
96b0ec45d2 [optimize][tooltip] support background image 2022-04-29 15:54:47 +08:00
monitor1394
8c02ce14ac [bug] fix change color in runtime did not refresh 2022-04-27 08:26:05 +08:00
monitor1394
419c704b23 v3.0.0-preivew8 2022-04-26 08:26:37 +08:00
monitor1394
9dedc1db68 v3.0.0-preivew8 2022-04-26 08:24:45 +08:00
monitor1394
f11ee84517 [optimize][label] support label rotate 2022-04-19 13:30:24 +08:00
monitor1394
dfa978afe0 [optimize][visualmap] support horizontal gradient 2022-04-19 07:22:47 +08:00
monitor1394
4e6658ad70 [optimize][bar] optimize border and capsule 2022-04-18 08:20:16 +08:00
monitor1394
ef5988a851 [enhancement][liquid] support round rect vessel 2022-04-15 13:12:19 +08:00
monitor1394
5d6c5b5f79 [doc] update api doc 2022-04-14 21:42:40 +08:00
monitor1394
80e4475f65 [enhancement][line] line support end label 2022-04-14 21:32:44 +08:00
monitor1394
84cf39df4d [doc] update doc 2022-04-13 22:04:45 +08:00
monitor1394
d44bf55a87 [add][VisualMap] add workOnLine and workOnArea (#191) 2022-04-13 22:03:23 +08:00
monitor1394
ad273cf1b1 [optimize] optimize interact and performance 2022-04-13 13:33:09 +08:00
monitor1394
a3d2d3f1d5 [optimize] optimize interact and performance 2022-04-13 13:26:46 +08:00
monitor1394
7ca4ddcb88 [optimize] radar support area tooltip 2022-04-12 08:09:18 +08:00
monitor1394
9a3461084c [doc] update readme 2022-04-11 21:54:09 +08:00
monitor1394
09df6fa73d [doc] update doc 2022-04-11 21:49:18 +08:00
monitor1394
be4ed41ca6 [optimize] visualmap 2022-04-09 21:30:28 +08:00
monitor1394
e2b0c935e0 [optimize] tooltip 2022-04-09 11:03:41 +08:00
monitor1394
e4fac71987 v3.0.0-preivew7 2022-04-07 08:38:17 +08:00
monitor1394
20825c148f [doc] update api and configuration 2022-04-07 08:36:14 +08:00
monitor1394
5476fa8d09 [setting] update setting 2022-04-07 08:35:20 +08:00
monitor1394
80c77fc69a [optimize] Pie support startAngle 2022-04-07 08:35:03 +08:00
monitor1394
621bc3dcfd [bug] Fix pie color 2022-04-07 08:16:50 +08:00
monitor1394
1ed0ff377a fix add main component error 2022-03-31 21:54:34 +08:00
monitor1394
426d437e6d fixed axis label custom color 2022-03-30 13:15:24 +08:00
426 changed files with 12430 additions and 8235 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

@@ -1,11 +1,26 @@
# 更新日志
[master](#master)
[master](#master)
[v3.2.0](#v3.2.0)
[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.4.0](#v2.4.0)
[v2.3.0](#v2.3.0)
[v2.2.3](#v2.2.3)
[v2.2.2](#v2.2.2)
@@ -43,12 +58,194 @@
## master
## v3.2.0
### 版本要点
* `Serie`支持高亮,淡出和选中三状态配置:`EmphasisStyle`,`BlurStyle``SelectStyle`
* `Axis`支持坐标轴次刻度和次分割线:`MinorTick``MinorSplitLine`
* `Serie`支持不同的取色策略:`colorBy`
* `Radar`支持平滑曲线:`smooth`
* `Line`支持当作凸多边形填充:`AreaStyle``innerFill`
* `DataZoom`支持时间轴
* 其他优化和修复
### 日志详情
* (2022.08.16) 发布`v3.2.0`版本
* (2022.08.15) 优化`Smooth`贝塞尔曲线算法
* (2022.08.13) 修复`DataZoom`组件开启时图表显示效果可能不正确的问题
* (2022.08.11) 优化`Tooltip`支持`ignoreDataDefaultContent`
* (2022.08.10) 修复`Chart`在3D相机下部分组件显示异常的问题
* (2022.08.10) 修复`RemoveSerie()`接口不生效的问题 (#219)
* (2022.08.10) 优化`Theme`的字体同步操作
* (2022.08.10) 优化`Chart`的默认`layer`设置为`UI`
* (2022.08.09) 优化`Axis``Time`时间轴的次分割线
* (2022.08.09) 增加`AreaStyle``innerFill`参数支持填充凸多边形
* (2022.08.08) 优化`Serie`的数据项索引维护,增加检测和修复功能,修复相关问题
* (2022.07.29) 修复`Unity`版本兼容:在某些版本导入后图表创建异常的问题
* (2022.07.29) 增加`Axis``Time`时间轴时,支持次刻度和次分割线
* (2022.07.28) 优化`Radar`雷达图效果
* (2022.07.28) 增加`Serie``colorBy`参数配置取色策略
* (2022.07.27) 增加`StateStyle``Symbol`用于配置状态下的标记样式
* (2022.07.27) 去掉`SerieSymbol``selectedSize`参数
* (2022.07.24) 增加`Serie``SerieData``state`设置默认状态
* (2022.07.22) 增加`Serie`的三种状态`EmphasisStyle`,`BlurStyle`,`SelectStyle`
* (2022.07.22) 去掉`AreaStyle``highlightColor``highlightToColor`参数
* (2022.07.22) 去掉`Emphasis`,`EmphasisItemStyle`,`EmphasisLabelStyle`,`EmphasisLabelLine`组件
* (2022.07.20) 增加`Since`特性对类的支持
* (2022.07.20) 修复`Axis``Value`轴时,`AxisLabel``showStartLabel``showEndLabel`参数设置不生效的问题
* (2022.07.19) 增加`Axis``MinorSplitLine`设置坐标轴次分割线
* (2022.07.19) 增加`Axis``MinorTick`设置坐标轴次刻度
* (2022.07.17) 增加`Radar``smooth`参数设置平滑曲线
* (2022.07.15) 增加`DataZoom``Time`时间轴的支持
## v3.1.0
### 版本要点
* 优化`Axis`
* 优化`Tooltip`
* 优化平滑曲线算法
* 优化代码动态创建图表
* 完善配置项手册
* 修复若干问题
### 日志详情
* (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`版本
* (2022.05.05) 优化`ItemStyle`设置`color`时的一致性
* (2022.05.05) 增加`Line``Dash`,`Dot`等的支持 (#197)
* (2022.05.04) 增加`Legend`的委托回调
* (2022.05.04) 优化`Symbol``Label`
* (2022.05.01) 增加`Bar``clip`的支持 (#196)
* (2022.05.01) 修复`RingChart``Label`不刷新的问题 (#195)
* (2022.04.29) 增加`Tooltip`支持自定义背景图
* (2022.04.27) 修复`ItemStyle`代码修改`color`不刷新的问题
## v3.0.0-preivew8
* (2022.04.26) 发布`v3.0.0-preivew8`版本
* (2022.04.23) 移除`Serie``IconStyle`组件
* (2022.04.23) 强化`LabelStyle`,所有组件的`TextStyle`都升级为`LabelStyle`
* (2022.04.19) 增加`Label``rotate`支持设置旋转
* (2022.04.17) 修复`Bar`在数值为负数时动画无效的问题
* (2022.04.17) 增加`ItemStyle``BorderGap`支持设置边框间距
* (2022.04.16) 优化`Bar``Border``Capsule`胶囊柱图
* (2022.04.15) 增加`Liquid``Round Rect`圆角矩形水位图的支持
* (2022.04.14) 增加`Line``EndLabel`的支持
* (2022.04.13) 增加`VisualMap``workOnLine``workOnArea`支持折线和区域映射功能 (#191)
* (2022.04.12) 优化`Radar`支持`Area`区域触发`Tooltip`
* (2022.04.09) 优化`VisualMap`
* (2022.04.09) 优化`Tooltip`
## v3.0.0-preivew7
* (2022.04.07) 发布`v3.0.0-preivew7`版本
* (2022.04.07) 修复`Pie`颜色不刷新的问题
* (2022.03.31) 修复`Add Main Component`添加组件异常的问题
* (2022.03.30) 修复`Axis`无法自定义`Label`颜色的问题
## v3.0.0-preivew6
* (2022.03.30) 发布`v3.0.0-preivew6`版本
## v3.0.0-preivew5
* (2022.03.26) 发布`v3.0.0-preivew5`版本
## v3.0.0-preivew4
* (2022.03.21) 发布`v3.0.0-preivew4`版本
## v3.0.0-preivew3
* (2022.03.09) 发布`v3.0.0-preivew3`版本
## v3.0.0-preivew2
* (2022.01.08) 发布`v3.0.0-preivew2`版本
## v3.0.0-preivew1
* (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,25 @@
# 更新日志
[master](#master)
[v3.2.0](#v3.2.0)
[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,7 +58,188 @@
## master
* (2021.08.15) Fixed the problem of displaying exceptions after adding data again when `DataZoom` is enable (#163)
## v3.2.0
### Main points
* `Serie` supports highlighting, EmphasisStyle, EmphasisStyle, BlurStyle, and SelectStyle
* `Axis` supports sub-scale and sub-partition of coordinate axes:`MinorTick` and `MinorSplitLine`
* `Serie` supports different color selection strategies: `colorBy`
* `Radar` supports smooth curves: `smooth`
* `Line` supports filling as a convex polygon: `AreaStyle` `innerFill`
* `DataZoom` supports timeline
* Other optimizations and issue fixes
### Log details
* (2022.08.16) Release `v3.2.0` version
* (2022.08.15) optimized `Smooth` Bezier curve algorithm
* (2022.08.13) Fixed an issue where the `DataZoom` component might not display correctly when opened
* (2022.08.11) Optimized Tooltip supports `ignoreDataDefaultContent`
* (2022.08.10) fixed abnormal display of some components of `Chart` under 3D camera
* (2022.08.10) Fix `RemoveSerie()` interface not working (#219)
* (2022.08.10) Optimized font synchronization for Theme
* (2022.08.10) optimizes the default `layer` of Chart to `UI`
* (2022.08.09) optimizes the `Time` timeline of `Axis`
* (2022.08.09) added AreaStyle `innerFill` parameter to support filling convex polygons
* (2022.08.08) Optimized the maintenance of data item indexes in `Serie`, added detection and repair functions, and fixed related problems
* (2022.07.29) Fixed `Unity` version compatibility: Chart creation exception after some versions import
* (2022.07.29) Add `Axis` to` Time `timeline, support sub-scale and sub-divider
* (2022.07.28) optimizes the `Radar` image
* (2022.07.28) increase `Serie` `colorBy` parameter configuration color taking strategy
* (2022.07.27) Adds StateStyle `Symbol` to configure the Symbol style in the state
* (2022.07.27) remove selectedSize from SerieSymbol
* (2022.07.24) adds default state Settings for `Serie` and `SerieData`
* (2022.07.22) add three states` EmphasisStyle `, `EmphasisStyle`, `SelectStyle` of `Serie`
* (2022.07.22) remove `highlightColor` and `highlightToColor` arguments from `AreaStyle`
* (2022.07.22) Omit the `Emphasis`,` EmphasisItemStyle `, `EmphasisLabelStyle`, `EmphasisLabelLine` component
* (2022.07.20) Added `Since` feature support for classes
* (2022.07.20) fixed the `showStartLabel` and `showEndLabel` parameter Settings for `AxisLabel` not taking effect when `Axis` is on the` Value `Axis
* (2022.07.19) added `Axis` to` MinorSplitLine `to set the Axis degree divider
* (2022.07.19) added `Axis` `MinorTick` to set the Axis sub-scale
* (2022.07.17) Add the `smooth` parameter for Radar to set the smooth curve
* (2022.07.15) added DataZoom support for the `Time` timeline
## v3.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,40 +1,77 @@
## 技术支持
# 订阅服务
如需技术支持可订阅VIP服务。扫后面的支付宝二维码后可加VIP群`867291970`,验证信息请输入支付宝账号。企业VIP可加官方群私聊群主了解详情。
如需技术支持,可订阅`个人VIP`服务。扫后面的二维码后可加VIP群`867291970`,验证信息请输入付费的账号。
企业商务合作可联系QQ3525422251XCharts技术支持
## 订阅服务
## 订阅VIP服务
| |免费用户|个人`1``VIP`|个人`2``VIP` | 个人长期`VIP` |
| ----- |--|--|--|--|
| 订阅费用 | -- | `298`¥ | `498`¥ | `888`¥ |
| 席位时长 | -- | `1`个席位<br>`1`年 | `1`个席位<br>`2`年 | `1`个席位<br>`长期` |
||
| <b>`服务方式:`</b>|
| 官方QQ群交流 | √ | √ | √ | √ |
| 专属VIP群交流 | | √ | √ | √ |
| 即时一对一交流 | | √ | √ | √ |
||
| <b>`服务内容:`</b>|
| 可商用 | √ | √ | √ | √ |
| 可二次开发 | √ | √ | √ | √ |
| 有问必答 | | √ | √ | √ |
| 新手指导 | | √ | √ | √ |
| 开发指导 | | √ | √ | √ |
| 优化指导 | | √ | √ | √ |
| 其他技术支持 | | √ | √ | √ |
| 问题及时处理 | | √ | √ | √ |
| 需求优先考虑 | | √ | √ | √ |
| 可另付费定制 | | √ | √ | √ |
| 可另付费加急 | | √ | √ | √ |
| 付费模块85折 | | | | √ |
订阅服务分个人订阅和企业订阅:
- `个人`订阅:`个人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`¥ | 首年`1298`¥</br>后续`298¥`* | `联系我们` |
| 订阅时长 | -- | `7`天* | `1`年 | `1`年* | `1`
| 订阅席位 | -- | `1`个席位 | `1`个席位 |`1`个席位|`5`个以上席位|
| __`服务方式:`__|
| 官方QQ群交流 | √ | √ | √ | √ | √ |
| 即时一对一交流 | | √ | √ | √ | √ |
| 专属VIP群交流 | | | √ | √ | √(专属企业群) |
| __`服务内容:`__|
| 可商用 | √ | √ | √ | √ | √ |
| 可二次开发 | √ | √ | √ | √ | √ |
| 有问必答 | | √ | √ | √ | √ |
| 即时回答 | | √ | √ | √ | √ |
| 新手指导 | | √ | √ | √ | √ |
| 开发指导 | | √ | √ | √ | √ |
| 优化指导 | | √ | √ | √ | √ |
| 其他技术支持 | | | √ | √ | √ |
| 问题及时处理 | | | √ | √ | √ |
| 需求优先考虑 | | | √ | √ | √ |
| 可另付费定制 | | | √ | √ | √ |
| 可另付费加急 | | | √ | √ | √ |
| 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`用户才享有`付费加急`权利。
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)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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;
@@ -18,9 +17,8 @@ namespace XCharts.Editor
PropertyField(prop, "m_Origin");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_ToColor");
PropertyField(prop, "m_HighlightColor");
PropertyField(prop, "m_HighlightToColor");
PropertyField(prop, "m_Opacity");
PropertyField(prop, "m_InnerFill");
--EditorGUI.indentLevel;
}
}

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: 7de9b5e4c5d474fdd88ebb89f0924305
guid: d485d6a729a1449cdb5032f380fba70f
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,24 +1,20 @@

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(Emphasis), true)]
public class EmphasisDrawer : BasePropertyDrawer
[CustomPropertyDrawer(typeof(CommentMarkStyle), true)]
public class CommentMarkStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Emphasis"; } }
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_Label");
PropertyField(prop, "m_LabelLine");
PropertyField(prop, "m_ItemStyle");
PropertyField(prop, "m_LineStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6e0b1690532674b24952a87e0aead6fa
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;
@@ -18,7 +17,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_FoldSeries");
PropertyField(prop, "m_ShowDebugInfo");
PropertyField(prop, "m_ShowAllChartObject");
PropertyField(prop, "m_DebugInfoTextStyle");
PropertyField(prop, "m_LabelStyle");
--EditorGUI.indentLevel;
}
}

View File

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

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -18,6 +17,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_Layer");
PropertyField(prop, "m_Align");
PropertyField(prop, "m_Sprite");
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");

View File

@@ -0,0 +1,27 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(ImageStyle), true)]
public class ImageStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "ImageStyle"; } }
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_Sprite");
PropertyField(prop, "m_Type");
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
--EditorGUI.indentLevel;
}
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 6e994b64b93384ae4bfa9a7a85ba8914
guid: 4649856b17dfd4f628eb975040fb791c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

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

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -24,6 +23,7 @@ namespace XCharts.Editor
PropertyField(prop, "m_CenterColor");
PropertyField(prop, "m_CenterGap");
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderGap");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_BorderColor0");
PropertyField(prop, "m_BorderToColor");

View File

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

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -17,10 +16,13 @@ namespace XCharts.Editor
++EditorGUI.indentLevel;
PropertyField(prop, "m_LineType");
PropertyField(prop, "m_LineColor");
PropertyField(prop, "m_LineAngle");
PropertyField(prop, "m_LineWidth");
PropertyField(prop, "m_LineGap");
PropertyField(prop, "m_LineLength1");
PropertyField(prop, "m_LineLength2");
PropertyField(prop, "m_StartSymbol");
PropertyField(prop, "m_EndSymbol");
--EditorGUI.indentLevel;
}
}

View File

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

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -16,18 +15,26 @@ namespace XCharts.Editor
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_AutoOffset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_BackgroundWidth");
PropertyField(prop, "m_BackgroundHeight");
PropertyField(prop, "m_PaddingLeftRight");
PropertyField(prop, "m_PaddingTopBottom");
PropertyField(prop, "m_AutoOffset");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Icon");
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_TextPadding");
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(EndLabelStyle), true)]
public class EndLabelStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "End Label"; } }
}
}

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,19 @@ namespace XCharts.Editor
PropertyField(prop, "m_AutoColor");
}
}
[CustomPropertyDrawer(typeof(AxisMinorSplitLine), true)]
public class AxisMinorSplitLineDrawer : BaseLineDrawer
{
public override string ClassName { get { return "MinorSplitLine"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
//PropertyField(prop, "m_Distance");
//PropertyField(prop, "m_AutoColor");
}
}
[CustomPropertyDrawer(typeof(AxisTick), true)]
public class AxisTickDrawer : BaseLineDrawer
{
@@ -63,4 +75,16 @@ namespace XCharts.Editor
PropertyField(prop, "m_AutoColor");
}
}
[CustomPropertyDrawer(typeof(AxisMinorTick), true)]
public class AxisMinorTickDrawer : BaseLineDrawer
{
public override string ClassName { get { return "MinorTick"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_SplitNumber");
//PropertyField(prop, "m_AutoColor");
}
}
}

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

@@ -0,0 +1,50 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(SerieSymbol), true)]
public class SerieSymbolDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Symbol"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
var type = (SymbolType) prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SymbolType.Custom)
{
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_Width");
// PropertyField(prop, "m_Height");
// PropertyField(prop, "m_Offset");
}
PropertyField(prop, "m_Gap");
PropertyField(prop, "m_SizeType");
switch ((SymbolSizeType) prop.FindPropertyRelative("m_SizeType").enumValueIndex)
{
case SymbolSizeType.Custom:
PropertyField(prop, "m_Size");
break;
case SymbolSizeType.FromData:
PropertyField(prop, "m_DataIndex");
PropertyField(prop, "m_DataScale");
break;
case SymbolSizeType.Function:
break;
}
PropertyField(prop, "m_StartIndex");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_ForceShowLast");
PropertyField(prop, "m_Repeat");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

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

@@ -0,0 +1,55 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(StateStyle), true)]
public class StateStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "StateStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
OnCustomGUI(prop);
PropertyField(prop, "m_Symbol");
PropertyField(prop, "m_ItemStyle");
PropertyField(prop, "m_Label");
PropertyField(prop, "m_LabelLine");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_AreaStyle");
--EditorGUI.indentLevel;
}
}
protected virtual void OnCustomGUI(SerializedProperty prop) { }
}
[CustomPropertyDrawer(typeof(EmphasisStyle), true)]
public class EmphasisStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "EmphasisStyle"; } }
protected override void OnCustomGUI(SerializedProperty prop)
{
PropertyField(prop, "m_Scale");
PropertyField(prop, "m_Focus");
PropertyField(prop, "m_BlurScope");
}
}
[CustomPropertyDrawer(typeof(BlurStyle), true)]
public class BlurStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "BlurStyle"; } }
}
[CustomPropertyDrawer(typeof(SelectStyle), true)]
public class SelectStyleDrawer : StateStyleDrawer
{
public override string ClassName { get { return "SelectStyle"; } }
}
}

View File

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

View File

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

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
@@ -16,36 +15,19 @@ 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)
{
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_Width");
// PropertyField(prop, "m_Height");
PropertyField(prop, "m_Height");
// PropertyField(prop, "m_Offset");
}
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Size");
PropertyField(prop, "m_Gap");
PropertyField(prop, "m_SizeType");
switch ((SymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
{
case SymbolSizeType.Custom:
PropertyField(prop, "m_Size");
PropertyField(prop, "m_SelectedSize");
break;
case SymbolSizeType.FromData:
PropertyField(prop, "m_DataIndex");
PropertyField(prop, "m_DataScale");
PropertyField(prop, "m_SelectedDataScale");
break;
case SymbolSizeType.Function:
break;
}
PropertyField(prop, "m_StartIndex");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_ForceShowLast");
PropertyField(prop, "m_Repeat");
--EditorGUI.indentLevel;
}
}

View File

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

using UnityEditor;
using UnityEngine;
using XCharts.Runtime;

View File

@@ -0,0 +1,30 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[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)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Right");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_Left");
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(TextPadding), true)]
public class TextPaddingDrawer : PaddingDrawer
{
}
}

View File

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

View File

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

using UnityEditor;
using UnityEngine;
#if dUI_TextMeshPro
@@ -15,7 +14,7 @@ namespace XCharts.Editor
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeComponentFoldout(prop, "", true))
if (MakeComponentFoldout(prop, "m_Show", true))
{
++EditorGUI.indentLevel;
#if dUI_TextMeshPro
@@ -24,22 +23,19 @@ namespace XCharts.Editor
PropertyField(prop, "m_Font");
#endif
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_ExtraWidth");
PropertyField(prop, "m_AutoColor");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_AutoBackgroundColor");
PropertyField(prop, "m_BackgroundColor");
PropertyField(prop, "m_FontSize");
PropertyField(prop, "m_LineSpacing");
#if dUI_TextMeshPro
PropertyField(prop, "m_TMPFontStyle");
PropertyField(prop, "m_TMPSpriteAsset");
PropertyField(prop, "m_TMPAlignment");
#else
PropertyField(prop, "m_FontStyle");
PropertyField(prop, "m_Alignment");
PropertyField(prop, "m_AutoWrap");
PropertyField(prop, "m_AutoAlign");
PropertyField(prop, "m_AutoWrap");
#endif
--EditorGUI.indentLevel;
}

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,23 +1,12 @@
using UnityEditor;
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
namespace XCharts.Editor
{
[CustomPropertyDrawer(typeof(TitleStyle), true)]
public class TitleStyleDrawer : BasePropertyDrawer
public class TitleStyleDrawer : LabelStyleDrawer
{
public override string ClassName { get { return "TitleStyle"; } }
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_OffsetCenter");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
}
}
}

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:
@@ -71,7 +70,6 @@ namespace XCharts.Editor
else
{
PropertyField("m_Interval");
PropertyField("m_BoundaryGap");
}
DrawExtendeds();
PropertyField("m_AxisLine");
@@ -80,7 +78,11 @@ namespace XCharts.Editor
PropertyField("m_AxisLabel");
PropertyField("m_SplitLine");
PropertyField("m_SplitArea");
PropertyField("m_IconStyle");
if (type != Axis.AxisType.Category)
{
PropertyField("m_MinorTick");
PropertyField("m_MinorSplitLine");
}
PropertyListField("m_Icons", true);
if (type == Axis.AxisType.Category)
{
@@ -95,14 +97,10 @@ namespace XCharts.Editor
}
[ComponentEditor(typeof(XAxis))]
public class XAxisEditor : AxisEditor
{
}
public class XAxisEditor : AxisEditor { }
[ComponentEditor(typeof(YAxis))]
public class YAxisEditor : AxisEditor
{
}
public class YAxisEditor : AxisEditor { }
[ComponentEditor(typeof(SingleAxis))]
public class SingleAxisEditor : AxisEditor
@@ -132,14 +130,10 @@ namespace XCharts.Editor
}
[ComponentEditor(typeof(RadiusAxis))]
public class RadiusAxisEditor : AxisEditor
{
}
public class RadiusAxisEditor : AxisEditor { }
[ComponentEditor(typeof(ParallelAxis))]
public class ParallelAxisEditor : AxisEditor
{
}
public class ParallelAxisEditor : AxisEditor { }
[CustomPropertyDrawer(typeof(AxisLabel), true)]
public class AxisLabelDrawer : BasePropertyDrawer
@@ -153,17 +147,24 @@ namespace XCharts.Editor
++EditorGUI.indentLevel;
PropertyField(prop, "m_Inside");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_ShowAsPositiveNumber");
PropertyField(prop, "m_OnZero");
PropertyField(prop, "m_ShowStartLabel");
PropertyField(prop, "m_ShowEndLabel");
PropertyField(prop, "m_TextLimit");
PropertyField(prop, "m_Rotate");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Distance");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_NumericFormatter");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Icon");
PropertyField(prop, "m_Background");
PropertyField(prop, "m_TextStyle");
PropertyField(prop, "m_TextPadding");
PropertyField(prop, "m_TextLimit");
--EditorGUI.indentLevel;
}
}
@@ -180,9 +181,8 @@ namespace XCharts.Editor
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_TextStyle");
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;
@@ -46,9 +45,9 @@ namespace XCharts.Editor
PropertyField("m_Bottom");
PropertyField("m_LineStyle");
PropertyField("m_AreaStyle");
PropertyField("m_LabelStyle");
PropertyListField("m_XAxisIndexs", true);
PropertyListField("m_YAxisIndexs", true);
PropertyField("m_TextStyle");
}
else
{

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_TextStyle");
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;
@@ -25,7 +24,7 @@ namespace XCharts.Editor
PropertyField("m_AxisName");
PropertyField("m_SplitLine");
PropertyField("m_SplitArea");
PropertyField("m_IndicatorList");
PropertyListField("m_IndicatorList");
--EditorGUI.indentLevel;
}
}

View File

@@ -1,5 +1,3 @@
using UnityEditor;
using UnityEngine;
using XCharts.Runtime;
@@ -12,7 +10,15 @@ namespace XCharts.Editor
[CustomEditor(typeof(Theme))]
public class ThemeEditor : UnityEditor.Editor
{
static class Styles
{
internal static GUIContent btnReset = new GUIContent("Reset to Default", "Reset to default theme");
internal static GUIContent btnSyncFontToSubTheme = new GUIContent("Sync Font to Sub Theme", "Sync main theme font to sub theme font");
internal static GUIContent btnSyncFontFromSetting = new GUIContent("Sync Font from Setting", "Sync main theme font and sub theme font from XCSetting font");
}
private Theme m_Theme;
void OnEnable()
{
m_Theme = target as Theme;
@@ -20,14 +26,38 @@ 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 (EditorUtility.DisplayDialog(Styles.btnReset.text, Styles.btnReset.tooltip, "Yes", "Cancel"))
{
m_Theme.ResetTheme();
Debug.Log("XCharts: Reset Finish.");
}
}
if (GUILayout.Button(Styles.btnSyncFontFromSetting))
{
if (EditorUtility.DisplayDialog(Styles.btnSyncFontFromSetting.text, Styles.btnSyncFontFromSetting.tooltip, "Yes", "Cancel"))
{
m_Theme.common.font = XCSettings.font;
m_Theme.SyncFontToSubComponent();
#if dUI_TextMeshPro
m_Theme.common.tmpFont = XCSettings.tmpFont;
m_Theme.SyncTMPFontToSubComponent();
#endif
Debug.Log("XCharts: Sync Finish.");
}
}
if (GUILayout.Button(Styles.btnSyncFontToSubTheme))
{
if (EditorUtility.DisplayDialog(Styles.btnSyncFontToSubTheme.text, Styles.btnSyncFontToSubTheme.tooltip, "Yes", "Cancel"))
{
m_Theme.SyncFontToSubComponent();
#if dUI_TextMeshPro
m_Theme.SyncTMPFontToSubComponent();
#endif
Debug.Log("XCharts: Sync Finish.");
}
}
}
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;
@@ -14,8 +13,8 @@ namespace XCharts.Editor
PropertyField("m_SubText");
PropertyField("m_ItemGap");
PropertyField("m_Location");
PropertyField("m_TextStyle");
PropertyField("m_SubTextStyle");
PropertyField("m_LabelStyle");
PropertyField("m_SubLabelStyle");
--EditorGUI.indentLevel;
}
}

View File

@@ -1,4 +1,3 @@
using UnityEditor;
using XCharts.Runtime;
@@ -17,16 +16,17 @@ namespace XCharts.Editor
PropertyField("m_TitleFormatter");
PropertyField("m_ItemFormatter");
PropertyField("m_NumericFormatter");
PropertyField("m_TitleHeight");
PropertyField("m_ItemHeight");
PropertyFiledMore(() =>
{
PropertyField("m_TitleHeight");
PropertyField("m_ItemHeight");
PropertyField("m_Marker");
PropertyField("m_BorderWidth");
PropertyField("m_BorderColor");
PropertyField("m_PaddingLeftRight");
PropertyField("m_PaddingTopBottom");
PropertyField("m_BackgroundImage");
PropertyField("m_BackgroundType");
PropertyField("m_BackgroundColor");
PropertyField("m_FixedWidth");
PropertyField("m_FixedHeight");
@@ -40,9 +40,9 @@ namespace XCharts.Editor
PropertyField("m_FixedY");
});
PropertyField("m_LineStyle");
PropertyField("m_LabelTextStyle");
PropertyField("m_TitleTextStyle");
PropertyListField("m_ColumnsTextStyle");
PropertyField("m_IndicatorLabelStyle");
PropertyField("m_TitleLabelStyle");
PropertyListField("m_ContentLabelStyles");
--EditorGUI.indentLevel;
}
}

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");
@@ -20,8 +19,10 @@ namespace XCharts.Editor
PropertyField("m_Max");
PropertyField("m_SplitNumber");
PropertyField("m_Dimension");
PropertyField("m_Show");
if (baseProperty.FindPropertyRelative("m_Show").boolValue)
PropertyField("m_WorkOnLine");
PropertyField("m_WorkOnArea");
PropertyField("m_ShowUI");
if (baseProperty.FindPropertyRelative("m_ShowUI").boolValue)
{
PropertyField("m_SelectedMode");
PropertyTwoFiled("m_Range");
@@ -37,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

@@ -7,6 +7,7 @@ namespace XCharts.Editor
{
public override void OnCustomInspectorGUI()
{
PropertyField("m_ColorBy");
PropertyField("m_Stack");
if (serie.IsUseCoord<PolarCoord>())
{
@@ -26,7 +27,7 @@ namespace XCharts.Editor
PropertyField("m_BarZebraWidth");
PropertyField("m_BarZebraGap");
}
PropertyField("m_Clip");
PropertyFiledMore(() =>
{
PropertyFieldLimitMin("m_MinShow", 0);
@@ -38,7 +39,6 @@ namespace XCharts.Editor
PropertyField("m_ShowAsPositiveNumber");
PropertyField("m_Large");
PropertyField("m_LargeThreshold");
PropertyField("m_Clip");
PropertyField("m_PlaceHolder");
});
PropertyField("m_ItemStyle");

View File

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

View File

@@ -18,6 +18,7 @@ namespace XCharts.Editor
PropertyField("m_YAxisIndex");
}
PropertyField("m_LineType");
//PropertyField("m_Clip");
PropertyFiledMore(() =>
{
PropertyFieldLimitMin("m_MinShow", 0);
@@ -32,7 +33,6 @@ namespace XCharts.Editor
PropertyField("m_ShowAsPositiveNumber");
PropertyField("m_Large");
PropertyField("m_LargeThreshold");
PropertyField("m_Clip");
});
PropertyField("m_Symbol");
PropertyField("m_LineStyle");

View File

@@ -11,16 +11,14 @@ namespace XCharts.Editor
PropertyField("m_Gap");
PropertyTwoFiled("m_Center");
PropertyTwoFiled("m_Radius");
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

@@ -7,9 +7,11 @@ namespace XCharts.Editor
{
public override void OnCustomInspectorGUI()
{
PropertyField("m_ColorBy");
PropertyField("m_RadarType");
PropertyField("m_RadarIndex");
PropertyField("m_Smooth");
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;
@@ -17,7 +16,6 @@ namespace XCharts.Editor
public override void OnInspectorGUI()
{
++EditorGUI.indentLevel;
//PropertyField("m_InsertDataToHead");
PropertyField("m_SerieName");
if (m_CoordOptionsNames != null && m_CoordOptionsNames.Count > 1)
{
@@ -29,6 +27,7 @@ namespace XCharts.Editor
serie.coordSystem = m_CoordOptionsDic[typeName].Name;
}
}
PropertyField("m_State");
OnCustomInspectorGUI();
OnExtraInspectorGUI();
PropertyFieldData();
@@ -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");
@@ -74,8 +72,9 @@ namespace XCharts.Editor
{
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
serie.ResetDataIndex();
}
if (listSize > 30)// && !XCSettings.editorShowAllListData)
if (listSize > 30) // && !XCSettings.editorShowAllListData)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
@@ -116,70 +115,72 @@ namespace XCharts.Editor
m_DataElementFoldout[index] = false;
}
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");
var serieData = m_Datas.GetArrayElementAtIndex(index);
var dataIndex = serieData.FindPropertyRelative("m_Index").intValue;
m_DataElementFoldout[index] = ChartEditorHelper.DrawHeader("SerieData " + dataIndex, 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");
#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 - 0;
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))
@@ -191,114 +192,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");
PropertyField(serieData.FindPropertyRelative("m_Name"));
//PropertyField(serieData.FindPropertyRelative("m_State"));
if (serie.GetType().IsDefined(typeof(SerieDataExtraFieldAttribute), false))
{
var attribute = serie.GetType().GetAttribute<SerieDataExtraFieldAttribute>();
foreach (var field in attribute.fields)
{
PropertyField(serieData.FindPropertyRelative(field));
}
}
var m_IconStyle = serieData.FindPropertyRelative("m_IconStyles");
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);
var componentNum = m_IconStyle.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 ItemStyle", () =>
serieDataMenus.Clear();
if (serie.GetType().IsDefined(typeof(SerieDataExtraComponentAttribute), false))
{
serie.GetSerieData(index).GetOrAddComponent<ItemStyle>();
}, m_ItemStyle.arraySize == 0),
new HeaderMenuInfo("Add IconStyle", () =>
{
serie.GetSerieData(index).GetOrAddComponent<IconStyle>();
}, m_IconStyle.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<SymbolStyle>();
}, 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 ItemStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<ItemStyle>();
}, m_ItemStyle.arraySize > 0),
new HeaderMenuInfo("Remove IconStyle", () =>
{
serie.GetSerieData(index).RemoveComponent<IconStyle>();
}, m_IconStyle.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<SymbolStyle>();
}, 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_IconStyle.arraySize > 0)
PropertyField(m_IconStyle.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", () =>
@@ -164,6 +162,13 @@ namespace XCharts.Editor
RefreshEditors();
}
}));
editor.menus.Add(new HeaderMenuInfo("Reset Data Index", () =>
{
if (chart.ResetDataIndex(id))
{
RefreshEditors();
}
}));
foreach (var type in GetCovertToSerie(editor.serie.GetType()))
{
editor.menus.Add(new HeaderMenuInfo("Covert to " + type.Name, () =>
@@ -176,7 +181,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 +192,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
@@ -12,6 +11,7 @@ namespace XCharts.Editor
PropertyField("m_YAxisIndex");
PropertyField("m_BarWidth");
PropertyField("m_BarGap");
PropertyField("m_Clip");
PropertyField("m_ItemStyle");
PropertyField("m_Animation");
}

View File

@@ -10,6 +10,7 @@ namespace XCharts.Editor
PropertyField("m_XAxisIndex");
PropertyField("m_YAxisIndex");
PropertyField("m_LineType");
//PropertyField("m_Clip");
PropertyField("m_LineStyle");
PropertyField("m_ItemStyle");
PropertyField("m_Animation");

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;

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