Compare commits

..

265 Commits
v1.6.0 ... 2.0

Author SHA1 Message Date
monitor1394
1d2f83169d 修复Pie只有一个数据时设置border后显示异常的问题 (#237) 2022-12-28 18:17:00 +08:00
monitor1394
a7c4e24555 [bug][datazoom] fix datazoom range error (#221) 2022-08-30 08:10:18 +08:00
monitor1394
6fad4fcccc update to Unity2019.4.39f1 2022-08-16 06:54:04 +08:00
monitor1394
95e40c6f1a v2.8.2 2022-08-15 22:12:44 +08:00
monitor1394
8e30a370b5 support tooltip formatter for HeatmapChart 2022-08-15 22:11:36 +08:00
monitor1394
d94e304058 v2.8.2 2022-07-13 21:45:54 +08:00
monitor1394
34dc49004e fix serielabel refresh exception (#215) 2022-07-13 21:45:09 +08:00
monitor1394
61c6d68c4c set tooltip on heighest layer 2022-06-30 13:38:46 +08:00
monitor1394
50a666fecc v2.8.1 2022-05-06 08:20:32 +08:00
monitor1394
626a187758 v2.8.1 2022-05-06 08:16:48 +08:00
monitor1394
dee06f8d6f add delegate callback function for legend 2022-05-03 22:30:51 +08:00
monitor1394
e6eea34a45 fix ring tooltip bug #192 2022-04-21 22:07:30 +08:00
monitor1394
76b8146e53 fix datazoom exception 2022-04-21 22:07:07 +08:00
monitor1394
240eda0be2 v2.8.0 2022-04-10 22:34:04 +08:00
monitor1394
6fa093bc80 add debug info 2022-04-10 22:27:27 +08:00
monitor1394
5884fd99dd Fixed VisualMap not working in some cases 2022-04-09 13:13:02 +08:00
monitor1394
f177799202 Merge pull request #190 from DK-Kermit/patch-1
Update XChartsMgr.cs
2022-04-08 14:23:34 +08:00
Kermit
2d3f5dd51d Update XChartsMgr.cs
修复因XChartsMgr不存在,而创建新对象时导致的死循环问题。
由于Awake会在组件被创建时同步执行一次,而在执行Awake时m_XCharts并没有被赋值,所以导致死循环。
让对象处于关闭状态,添加组件时就不会同步执行Awake方法,而是延迟到下一次开启对象时执行。
在下一次开启对象时,m_XCharts已经被赋值,所以不会导致死循环问题。
死循环发生在Awake时调用XThemeMgr.ReloadThemeList,而ReloadThemeList方法中有调用了实例。
2022-04-08 14:12:15 +08:00
monitor1394
b9ca646e0c Merge pull request #188 from Sterling-zzp/2.0
修复Radar初始化时画线取色错误
2022-04-08 10:48:38 +08:00
Sterling
c157c07b0d 修复Radar初始化时画线取色错误 2022-04-08 09:37:44 +08:00
monitor1394
82d0788905 Fixed axis precision issue #184 2022-03-24 08:32:27 +08:00
monitor1394
a7ac0277a7 2.7.0 2022-03-20 19:18:28 +08:00
monitor1394
3f36c27384 update doc link 2022-03-18 13:12:01 +08:00
monitor1394
e4da5e30dc update doc link 2022-03-18 13:08:36 +08:00
monitor1394
bfa68fd037 refactor code to support 3d pie 2022-03-16 07:43:46 +08:00
monitor1394
c002ac071b Fixed chart name repeat check error #183 2022-02-21 21:30:33 +08:00
monitor1394
5c2ea52118 Fixed MissingReferenceException #183 2022-02-17 08:39:55 +08:00
monitor1394
0e25a23ed2 Fixed axis split line bug #181 2022-02-17 08:29:57 +08:00
monitor1394
41a9606bee Fixed {d} formatter error when value is 0 2022-02-09 22:02:16 +08:00
monitor1394
6f6248be77 fixed y axis label onZero does not work 2022-02-08 20:50:47 +08:00
monitor1394
2b5275b15d improve zebra bar chart 2022-01-06 21:47:21 +08:00
monitor1394
ca26fd7c21 Improved zebra bar chart 2022-01-06 21:25:18 +08:00
monitor1394
a2e790561e v2.6.0 2021-12-30 08:19:48 +08:00
monitor1394
f0e94d35b6 fixed emphasis label 2021-12-21 07:01:54 +08:00
monitor1394
76f640f64d Fixed markline label refresh when serie hide #178 2021-12-17 21:27:14 +08:00
monitor1394
9d8dc80494 Improved radarchart 2021-12-10 13:22:00 +08:00
monitor1394
bc1d2ac095 Fixed y axis does not refresh when serie hidden 2021-12-08 20:53:12 +08:00
monitor1394
913c8e1fb2 optimize emptyRect symbol 2021-12-04 14:12:34 +08:00
monitor1394
634bb45dc4 optimize emptyRect symbol 2021-12-04 14:10:28 +08:00
monitor1394
e4827ac262 Added new symbol type: EmptyRect, EmptyTriangle, EmptyDiamond 2021-12-04 08:46:32 +08:00
monitor1394
9ad8a86ffc set symbol empty area color by itemStyle's backgroundColor 2021-12-04 08:26:56 +08:00
monitor1394
23a8ce52d1 Fixed formatter {c} not work #175 2021-12-03 13:08:20 +08:00
monitor1394
38584f618b Fixed axis boundaryGap display error #174 2021-12-03 08:38:00 +08:00
monitor1394
84c47e0d84 inspector show seriedata.selected 2021-12-01 21:35:08 +08:00
monitor1394
7ff1405de5 Fixed serie ignore display error #173 2021-11-30 21:40:18 +08:00
monitor1394
acae09bf28 v2.5.0 2021-11-27 22:12:08 +08:00
monitor1394
b304bd2033 add tooltip delegate function: positionFunction 2021-11-27 22:06:15 +08:00
monitor1394
72c29235d8 Add Time axis warning 2021-11-03 06:48:45 +08:00
monitor1394
5f18f060e3 Optimized SerieData to support tree data 2021-11-02 21:23:01 +08:00
monitor1394
a281028a22 Removed settings for TextMeshPro when package first imported 2021-10-29 07:26:33 +08:00
monitor1394
fe702f3447 Added support for {e} in Tooltip #170 2021-10-29 07:05:30 +08:00
monitor1394
6888ba96e3 增加Treemap扩展支持 2021-10-24 19:23:17 +08:00
monitor1394
b261ef0573 improve radar chart 2021-09-12 15:01:40 +08:00
monitor1394
64d0b047b3 fix pie chart fade out animation #168 2021-09-07 21:44:05 +08:00
monitor1394
5c395ade25 Fixed bug where GaugeChart does not refresh label when changing splitNumber #167 2021-09-06 21:33:44 +08:00
monitor1394
5149376806 v2.4.0 2021-08-31 22:29:49 +08:00
monitor1394
d8f739cbdf v2.4.0 2021-08-31 21:13:59 +08:00
monitor1394
71fb45af9f 优化RingChart的渐变效果 2021-08-31 21:05:02 +08:00
monitor1394
ca63d041b9 修复DataZoom拖动时SerieLabel不刷新的问题 (#165) 2021-08-31 13:41:46 +08:00
monitor1394
8fccfdb5fc Fixed the problem of displaying exceptions after adding data again when DataZoom is enable (#163) 2021-08-26 20:46:50 +08:00
monitor1394
f08ae794ae 修复Theme主题切换无法保持到场景上的问题 (#166) 2021-08-26 20:42:11 +08:00
monitor1394
8efa8145b1 匀速动画优化 2021-08-25 13:41:41 +08:00
monitor1394
e247ad9e71 增加AnimationalongWithLinePath参数设置折线轨迹匀速动画 2021-08-24 07:21:00 +08:00
monitor1394
645506a6fd Added serie's ignoreLineBreak parameter (#164) 2021-08-22 09:26:14 +08:00
monitor1394
c5ef7e765b Fixed axis label may not be updated when datazoom is turn on (#164) 2021-08-22 07:55:16 +08:00
monitor1394
3949018555 Improved Axis's AxisLabel text rotate setting to avoid inconsistency offset in DataZoom (#163) 2021-08-15 22:36:14 +08:00
monitor1394
34b0a97198 Added Legend's textAutoColor to set the text color match with Serie color (#163) 2021-08-15 22:36:06 +08:00
monitor1394
de3e482687 优化BarChart设置Corner时正负柱条圆角对称 2021-08-12 22:16:36 +08:00
monitor1394
8dbbbd7405 优化Serie的数据全为0时Y轴不显示的问题 2021-08-03 08:23:02 +08:00
monitor1394
3316fce8a5 修复Serie开启ignore时被忽略的数据还会参与计算的问题 (#161) 2021-07-29 08:27:23 +08:00
monitor1394
f85f96a560 完善BarChartZebra斑马柱图渐变支持 2021-07-29 08:05:54 +08:00
monitor1394
8f6f5790b6 修复TextMeshPro Enable时找不到XCharts路径的问题 (#160) 2021-07-26 21:28:13 +08:00
monitor1394
f69aa1d232 v2.3.0 2021-07-24 09:31:40 +08:00
monitor1394
bdd53bbe24 完善SerieSymbol以支持象形柱图PictorialBarChart扩展 2021-07-22 08:11:12 +08:00
monitor1394
b20e768cd1 修复WdbGL平台上Tooltip不显示的问题 2021-07-19 08:23:39 +08:00
monitor1394
4de732a369 增加SerieiconStyle统一配置图标 2021-07-18 14:16:06 +08:00
monitor1394
f87c8445f9 MarkLine优化 2021-07-16 08:31:10 +08:00
monitor1394
8d6d4ce0c5 增加MarkLine标线 (#142) 2021-07-15 21:18:23 +08:00
monitor1394
5238689baa 优化BarChart可通过serieData.show设置是否显示柱条 2021-07-09 06:50:19 +08:00
monitor1394
6f39e692ef 优化数据存储类型由float全部转为double 2021-07-08 07:20:06 +08:00
monitor1394
e873709443 修复ChartLabel在TMP下异常报错的问题 2021-07-08 07:04:46 +08:00
monitor1394
8d4a65a002 修复PieChartavoidLabelOverlap参数不生效的问题 2021-07-05 07:12:20 +08:00
monitor1394
32a8fed625 修复PieChart选中扇区后鼠标区域指示不准确的问题 2021-07-04 21:16:30 +08:00
monitor1394
1fccc25873 优化SerieLabel 2021-07-04 20:38:26 +08:00
monitor1394
0621845e5a 增加DataZoomsupportInsideScrollsupportInsideDrag参数设置坐标系内是否支持滚动和拖拽 2021-07-01 07:38:06 +08:00
monitor1394
18391881d7 整理代码 2021-07-01 07:35:55 +08:00
monitor1394
0e1d5cc81d 确保XChartsMgr只有一个 2021-06-28 07:23:44 +08:00
monitor1394
78a83238f7 增加AxisLabelshowStartLabelshowEndLabel参数设置首尾的Label是否显示 2021-06-27 21:45:17 +08:00
monitor1394
05f21f2d02 增加AxisLabel和SerieLabel的formatter委托方法 #145 2021-06-27 12:26:20 +08:00
monitor1394
bcb30f3c82 增加更新Axis数据和图标的接口 2021-06-27 12:21:56 +08:00
monitor1394
470da8f975 增加DataZoomorient参数设置水平或垂直样式 2021-06-27 12:20:03 +08:00
monitor1394
8c83e828bf 接口优化 2021-06-26 21:45:56 +08:00
monitor1394
a91d190d85 增加IconStyleautoHideWhenLabelEmpty参数设置当label为空时是否自动隐藏图标 2021-06-21 07:08:59 +08:00
monitor1394
e9e7371213 v2.2.3 2021-06-20 17:05:15 +08:00
monitor1394
9349900ea5 v2.2.2 2021-06-18 06:48:11 +08:00
monitor1394
0ae9be9c63 v2.2.1 2021-06-13 12:10:50 +08:00
monitor1394
953bea6962 完善对多屏幕的支持 2021-06-13 11:50:41 +08:00
monitor1394
1f676c431a 增加IconStylealign参数设置图标的水平对齐 2021-06-12 19:46:57 +08:00
monitor1394
f953a069cb 优化主题Theme的导入和字体自动刷新 (#148) 2021-06-12 14:32:23 +08:00
monitor1394
442206dad8 修复Unity版本兼容问题 (#154) 2021-06-10 12:54:13 +08:00
monitor1394
8dd3ef2a63 增加runtimeSortedData用于排序数据 2021-06-09 07:26:03 +08:00
monitor1394
44110feaaf Improved Candlestickchart support for inverse (#152) 2021-06-05 09:56:40 +08:00
monitor1394
a42c1845d6 优化自定义主题Theme的自动刷新 (#148) 2021-06-05 09:56:00 +08:00
monitor1394
d233f64a68 修复Gauge在最小值为负数时指针指示位置异常的问题 2021-06-04 23:08:34 +08:00
monitor1394
055d3806d8 默认关闭TextLimit 2021-06-04 07:56:01 +08:00
monitor1394
b4f6bd7248 v2.2.0 2021-05-30 20:17:45 +08:00
monitor1394
fb49b2f46a 调整订阅服务 2021-05-30 20:09:32 +08:00
monitor1394
f1a14830b7 增加漏斗图基础代码支持 2021-05-29 22:07:09 +08:00
monitor1394
b849633110 修复DataZoom报错 2021-05-27 21:11:14 +08:00
monitor1394
f656cba56b 优化代码 2021-05-25 23:45:15 +08:00
monitor1394
6872d42f2e 完善TextStylealignment的支持 (#150) 2021-05-25 08:06:32 +08:00
monitor1394
93e376bdbf 修复PieChart数据全为0Label无法正常显示的问题 2021-05-24 21:35:53 +08:00
monitor1394
efc82d01a7 修复Add Serie面板上Serie Name不生效的问题 (#149) 2021-05-24 07:28:45 +08:00
monitor1394
057376882d 增加Axis的图标、自动换行、自定义长宽的支持 2021-05-24 07:17:54 +08:00
monitor1394
d92640c49b 优化DataZoom 2021-05-22 15:29:55 +08:00
monitor1394
bc25663db4 增加SerieAxisinsertDataToHead参数控制数据插入头部还是尾部 2021-05-21 07:24:02 +08:00
monitor1394
d9f99e0d27 serie增加自定义参数 2021-05-20 21:51:52 +08:00
monitor1394
0c549bf23b 优化Editor下的图表创建 #147 2021-05-18 13:10:29 +08:00
monitor1394
4de87fd358 修复Tooltip不触发的问题 2021-05-18 09:29:03 +08:00
monitor1394
01b77ccb55 修复CoordinateChart的tooltip报错 2021-05-18 08:34:11 +08:00
monitor1394
e2aec83de2 CandlestickChart加入菜单栏 #146 2021-05-18 00:06:56 +08:00
monitor1394
d5c8b296a7 修复PieChart的Tooltip高亮不会还原的问题 2021-05-18 00:06:15 +08:00
monitor1394
f2c944baa9 修复BarChart在水平布局时clip不生效的问题 2021-05-18 00:05:12 +08:00
monitor1394
7070c5caa7 移除GanttChart 2021-05-17 12:51:48 +08:00
monitor1394
f2b7cfd40b 修复DataZoom报错 2021-05-17 12:29:28 +08:00
monitor1394
79a02e5594 抽离甘特图 2021-05-16 23:38:06 +08:00
monitor1394
a88b1979d8 重构VisualMap和DataZoom 2021-05-13 09:38:32 +08:00
monitor1394
c1f604f1b6 修复TMP下Theme不显示TMPFont的问题 #143 2021-05-11 21:00:26 +08:00
monitor1394
cb29b38e1c 修复散点图会显示图表外的点的问题 2021-05-11 20:53:09 +08:00
monitor1394
6bee9b20dd VisualMap支持Piecewise类型 2021-05-10 12:45:58 +08:00
monitor1394
6e35907f46 修复RingChart无法设置环形的背景色的问题 #141 2021-05-10 08:27:43 +08:00
monitor1394
44d67151ee 优化Log轴显示极小浮点数 2021-05-08 13:01:46 +08:00
monitor1394
2f98f6a486 增加LiquidChart的方形水位图支持 2021-05-08 09:42:25 +08:00
monitor1394
53085b01b6 优化Axis的刻度表现 #135 2021-05-07 08:35:49 +08:00
monitor1394
424577ca4d 增加Settings中关于关于材质球设置的参数 #140 2021-05-01 22:43:17 +08:00
monitor1394
636df6ebd6 修复无法正确表示部分超大或超小数值的问题 2021-05-01 20:21:31 +08:00
monitor1394
e28c730c21 优化代码,更好的支持自定义图表 2021-04-30 13:10:19 +08:00
monitor1394
3d457bb681 增加Custom类型的Serie的tooltip自定义 2021-04-29 19:57:07 +08:00
monitor1394
fdd6ab0063 修复Radar切换到Circle异常的问题 #139 2021-04-29 19:43:42 +08:00
monitor1394
13a81b8374 修复Log轴时绘制异常的问题 2021-04-29 19:17:12 +08:00
monitor1394
11fc9d15a2 增加SettingsreversePainter可设置Serie的绘制是否逆序 2021-04-29 07:30:42 +08:00
monitor1394
bf82904e66 增加SerieDataignore可忽略当前数据项 2021-04-28 19:28:05 +08:00
monitor1394
3c58396c1f Fixed bug where AxisLabel displayed incorrectly with DataRoom (#138) 2021-04-28 07:00:23 +08:00
monitor1394
6291fd27b0 优化代码,更好的支持自定义图表 2021-04-28 06:56:28 +08:00
monitor1394
59f1fda131 优化代码,更好的支持自定义图表 2021-04-27 12:47:46 +08:00
monitor1394
8a8f352bad Fixed dynamically creating chart at runtime would be abnormal 2021-04-26 19:37:02 +08:00
monitor1394
20ea9e2620 增加BarChart绘制渐变边框的支持 2021-04-26 07:17:26 +08:00
monitor1394
05f0002ef4 ignore obj folder 2021-04-23 07:29:06 +08:00
monitor1394
3507434e7a 增加对自定义Chart的支持 2021-04-22 18:55:56 +08:00
monitor1394
7c762b4455 修复Gauge的AxisLabel文字颜色无法修改的问题 2021-04-22 07:29:08 +08:00
monitor1394
6220b6af6f 取消GaugeAxis的m_SplitLineLength参数忽略 2021-04-22 07:09:47 +08:00
monitor1394
63f054493a 完善多坐标轴的支持 #132 2021-04-14 08:59:03 +08:00
monitor1394
cd35d00e06 v2.1.1 2021-04-13 20:56:33 +08:00
monitor1394
0bc5a24595 整理代码 2021-04-13 10:12:02 +08:00
monitor1394
ce08b0f81e 兼容unity5.6 2021-04-13 09:57:33 +08:00
monitor1394
5aa90274dc 处理unity版本兼容 2021-04-12 19:31:26 +08:00
monitor1394
4b40604a27 fiexd missing class attribute ExtensionOfNativeClass #131 2021-04-12 12:55:22 +08:00
monitor1394
adfc15efd8 unity版本兼容 2021-04-08 19:30:23 +08:00
monitor1394
1e43fc7283 v2.1.0 2021-04-07 20:30:40 +08:00
monitor1394
a2307d9c21 更新Doc 2021-04-02 12:46:29 +08:00
monitor1394
2bec0f1178 优化Theme 2021-04-02 12:41:42 +08:00
monitor1394
c19870444e 优化demo 2021-04-02 12:41:15 +08:00
monitor1394
d423ad6c9e 优化Theme 2021-04-01 12:13:51 +08:00
monitor1394
9c96fbb604 优化Theme 2021-04-01 08:14:04 +08:00
monitor1394
d6caeb585e 优化和重构Theme,解决引用相同或丢失的问题 #118 2021-03-31 21:17:29 +08:00
monitor1394
e23f8b4a96 更新demo 2021-03-30 20:50:03 +08:00
monitor1394
fbeca8f442 更新文档 2021-03-30 20:49:27 +08:00
monitor1394
aebbfaac83 优化Tooltip支持设置不同的类目轴数据 #129 2021-03-30 20:24:12 +08:00
monitor1394
e26220ef93 优化自定义绘制回调接口 2021-03-29 20:28:53 +08:00
monitor1394
ed93fc3005 优化自定义绘制回调接口 2021-03-29 20:27:21 +08:00
monitor1394
ac64bd9435 增加GanttChart甘特图 2021-03-25 12:55:52 +08:00
monitor1394
6a548899fa 修复增删XY轴时可能异常的问题 2021-03-22 20:32:19 +08:00
monitor1394
ddea85d9f0 增加ThemeUnbind按钮用于解绑复制图表时的主题 #118 2021-03-22 03:26:16 +08:00
monitor1394
e8a725fb05 修复InspectorFoldout后的勾选框无法选中的问题 2021-03-18 20:15:40 +08:00
monitor1394
09c32f171d 修复BarChart0 数值时显示异常的问题 2021-03-18 19:25:36 +08:00
monitor1394
457db21751 修复Tooltip的指示器在某些情况下指示位置不准的问题 2021-03-14 05:23:08 +08:00
monitor1394
e06393a22f 修复DataZoom多生成了一个组件的问题 2021-03-14 04:45:19 +08:00
monitor1394
e182827509 优化K线图的Tooltip 2021-03-14 04:44:31 +08:00
monitor1394
234b5ecfa6 优化MultiComponentMode开启后的编辑体验和组件刷新 #128 2021-03-13 04:21:52 +08:00
monitor1394
b7b8d37ecd 优化多条k线图显示 2021-03-12 07:16:20 +08:00
monitor1394
5d19466fdc 增加CandlestickChartK线图 #124 2021-03-10 13:05:31 +08:00
monitor1394
7d46feb1a5 UGL接口优化 2021-03-10 13:05:23 +08:00
monitor1394
7169fdc8ae 修复DataZoom异常 2021-03-10 13:05:15 +08:00
monitor1394
db9e0659f3 Merge branch 'develop' 2021-03-06 08:53:15 +08:00
monitor1394
00057788ab update doc 2021-03-06 08:52:15 +08:00
monitor1394
117ab9e31a 增加PieChartminAngle参数支持设置最小扇区角度 #117 2021-03-06 08:25:43 +08:00
monitor1394
404430e4b2 增加Legend几种内置图标的支持 #90 2021-03-05 08:56:55 +08:00
monitor1394
0d53fa91ff 优化TMP的Enable和Disable 2021-03-04 07:30:29 +08:00
monitor1394
b3037f0818 增加DataZoom对数值轴的支持 #71 2021-03-02 09:16:53 +08:00
monitor1394
9fe8b762b6 Fixed display exception of hidden gameObjects when enabling and disabling a chart #125 2021-03-01 10:07:40 +08:00
monitor1394
0a2751b220 修复启用TMP时编译报错的问题 #125 2021-02-27 05:01:26 +08:00
monitor1394
220b829279 v2.0.1 2021-02-26 01:03:47 +08:00
monitor1394
c507771cff 修复HeatmapChartTooltip指示的位置不准的问题 #123 2021-02-26 00:54:43 +08:00
monitor1394
09daa2f027 修复Unity版本兼容问题 2021-02-22 11:02:54 +08:00
monitor1394
4ea5168e9a 修复Unity版本兼容问题 2021-02-21 22:15:07 +08:00
monitor1394
2fdd554751 update doc 2021-02-21 03:43:32 +08:00
monitor1394
b96e1dcf4d 增加TooltipignoreDataShow参数 2021-02-21 02:42:45 +08:00
monitor1394
80b000ed32 修复创建图表时的空报错 2021-02-21 02:26:36 +08:00
monitor1394
f0c553b0b7 修复图表在LayoutGroup控制下时可能显示错乱的问题 #121 2021-02-19 22:01:56 +08:00
monitor1394
f7b8f2f76f Fixed an issue where the Radar could not refresh itself after parameter changing 2021-02-18 09:47:03 +08:00
monitor1394
04efcf3959 Fixed an issue where the Radar could not refresh itself after parameter changing #122 2021-02-18 09:24:01 +08:00
monitor1394
3a02f66d9e v2.0.0 2021-02-05 21:53:46 +08:00
monitor1394
69c830c520 v2.0.0 2021-02-05 21:52:11 +08:00
monitor1394
49fe5fdb70 v2.0.0 2021-02-05 21:46:31 +08:00
monitor1394
15da731cfe 调整2.0的upm分支 2021-02-04 13:10:30 +08:00
monitor1394
3e1b84029f 修复AxisLineOnZeroYAxis不生效的问题 #116 2021-02-03 12:51:50 +08:00
monitor1394
0a427de273 修复日志内部无法跳转的问题 2021-01-29 21:36:49 +08:00
monitor1394
b4cd770c8d 调整更新日志格式 2021-01-29 21:31:04 +08:00
monitor1394
3b697edd09 调整更新日志格式 2021-01-29 21:24:29 +08:00
monitor1394
9f7ec8be64 调整更新日志格式 2021-01-29 21:16:41 +08:00
monitor1394
7f23cd4676 修复Category轴在BoundaryGapAlignWithLabelTrueTick显示效果不对的问题 #115 2021-01-29 20:55:58 +08:00
monitor1394
82d1bed46b Optimize some details 2021-01-25 09:12:22 +08:00
monitor1394
e9df74ec3c Fixed a Inpsector displayed error 2021-01-22 09:08:52 +08:00
monitor1394
d34959287d v2.0.0-preview.2 2021-01-21 12:51:06 +08:00
monitor1394
ee5cfc3d78 support doc 2021-01-21 12:50:50 +08:00
monitor1394
ec4eee58a2 Fixed an error about AxisTick in Inpsector 2021-01-21 12:40:46 +08:00
monitor1394
0ae92afc09 Fixed a build compatibility error 2021-01-21 12:34:48 +08:00
monitor1394
aebbdf57be update doc 2021-01-20 20:30:39 +08:00
monitor1394
16b3ca1f40 more shields 2021-01-20 09:36:50 +08:00
monitor1394
f8d882c046 增加XChartsSettingseditorShowAllListData参数配置是否在Inspector中显示列表的所有数据 2021-01-19 23:18:41 +08:00
monitor1394
0a5d923592 v2.0.0-preview.1 2021-01-19 12:39:12 +08:00
monitor1394
f330d2eb7b XCharts 2.0 2021-01-17 22:52:32 +08:00
monitor1394
5c9e52a807 XCharts 2.0 2021-01-17 11:44:47 +08:00
monitor1394
f5c76ce3c5 XCharts 2.0 2021-01-17 10:16:30 +08:00
monitor1394
ee4aae2019 XCharts 2.0 2021-01-13 23:02:24 +08:00
monitor1394
660415ae97 XCharts 2.0 2021-01-13 18:40:17 +08:00
monitor1394
d36a9fda9d XCharts 2.0 2021-01-12 13:11:15 +08:00
monitor1394
d9724ee7f3 XCharts 2.0 2021-01-11 12:22:22 +08:00
monitor1394
a1c2f554d4 XCharts 2.0 2021-01-11 08:54:28 +08:00
monitor1394
77f17c7dec 发布v1.6.3版本 2021-01-02 14:08:43 +08:00
monitor1394
e8737ec50e 修复Animation不启用时更新数据会导致图表一直刷新的问题 2020-12-18 19:06:34 +08:00
monitor1394
045e1576b6 XCharts 2.0 is comming soon! 2020-12-12 13:14:29 +08:00
monitor1394
b1c9f36a30 去掉调试日志 2020-12-01 12:18:52 +08:00
monitor1394
1b4e3a449d 修复Unity2020上新创建的图表无法正常绘制的问题 2020-12-01 09:29:11 +08:00
monitor1394
9ebbdaba28 发布v1.6.2版本 2020-11-22 20:37:50 +08:00
monitor1394
779ab98762 发布v1.6.2版本 2020-11-22 20:29:32 +08:00
monitor1394
105d0a85f9 修复LineChart在数据过于密集时折线绘制异常的问题 #99 2020-11-22 15:10:56 +08:00
monitor1394
a4281288ee 修复LineChart的刻度位置在alignWithLabeltrue时可能异常的问题 2020-11-21 08:42:03 +08:00
monitor1394
30f40b601f 修复Unity5兼容报错的问题 2020-11-21 08:41:52 +08:00
monitor1394
a3a9850e13 完善RadarChartIndicator\n换行的支持 2020-11-13 08:48:59 +08:00
monitor1394
0027968e99 update doc 2020-11-12 09:38:26 +08:00
monitor1394
ea8d560f3f 修复LineChart当类型为Smooth时数据过密情况下报错的问题 #101 2020-11-12 09:23:10 +08:00
monitor1394
95cf5ed303 完善HeatmapChartVisualMapPiecewise的支持 2020-10-22 09:39:47 +08:00
monitor1394
7e7d7270ab 修复对数轴logBase设置为0时会卡死的问题 2020-09-24 09:36:09 +08:00
monitor1394
a69667337d 修复PieChart边框大小不一致的问题 2020-09-22 07:29:48 +08:00
monitor1394
a4f1726ab1 meta文件 2020-09-21 20:56:44 +08:00
monitor1394
3e1b3637c9 meta文件 2020-09-21 20:56:36 +08:00
monitor1394
8627494972 整理代码,去掉warning 2020-09-19 18:11:16 +08:00
monitor1394
be71983047 发布v1.6.1版本 2020-09-19 18:05:28 +08:00
monitor1394
9274844548 更新教程 2020-09-19 17:56:56 +08:00
monitor1394
075b0939e9 优化demo效果 2020-09-19 17:25:14 +08:00
monitor1394
1cf0ecf9d6 优化symbol颜色 2020-09-19 17:25:03 +08:00
monitor1394
b07798f5a2 增加Remove All Chart Object移除图表下的所有子节点 2020-09-18 22:24:51 +08:00
monitor1394
ecb09e4ca4 修复SerieLabel在点击图例隐藏Serie后还显示的问题#94 2020-09-18 22:00:03 +08:00
monitor1394
f266655d24 更新文档 2020-09-18 09:35:58 +08:00
monitor1394
a43cf64fb3 优化坐标轴刻度和文本显示#93 2020-09-18 09:29:40 +08:00
monitor1394
be61cb908f meta文件 2020-09-16 19:52:50 +08:00
monitor1394
afc84a0dc0 修复默认分割线不显示的问题 2020-09-13 20:32:41 +08:00
monitor1394
b2f5f69619 优化坐标轴刻度和数据对齐 2020-09-13 20:17:11 +08:00
monitor1394
cd519f021f 优化Legend的颜色可自动匹配ItemStyle的自定义颜色#89 2020-09-08 09:28:19 +08:00
monitor1394
f18dd10f0d Merge pull request #88 from Ernest-su/patch-1
Update ItemStyle.cs
2020-09-08 07:30:28 +08:00
Ernest-su
92e4d9de1b Update ItemStyle.cs
fix backgroundWidth doc
2020-09-07 17:57:21 +08:00
monitor1394
e64284f5ab 优化LineChart在不使用XAxis1时也能显示XAxis1 2020-09-05 17:16:26 +08:00
monitor1394
683f4e1c97 增加LineStyletoColortoColor2设置LineChart的水平渐变,取消通过ItemStyle设置LineChart的水平渐变。 2020-08-29 23:35:40 +08:00
monitor1394
b9566cb180 增加onPointerClickPieonPointerClickBar回调 2020-08-29 22:44:32 +08:00
516 changed files with 1449711 additions and 1522165 deletions

20
.gitignore vendored
View File

@@ -5,6 +5,7 @@
/Library
/Temp
/Logs
/obj
/UnityPackageManager
/Packages
/ProjectSettings/XRSettings.asset
@@ -12,25 +13,10 @@
/Assets/Res.meta
/Assets/Package
/Assets/Package.meta
/Assets/TextMesh Pro
/Assets/TextMesh Pro.meta
/Doc/*.meta
/Assets/XCharts/*.meta
/Assets/XCharts/Runtime/Internal/*.meta
/Assets/XCharts/Runtime/Internal/Helper/*.meta
/Assets/XCharts/Runtime/Internal/Interface/*.meta
/Assets/XCharts/Runtime/Internal/Object/*.meta
/Assets/XCharts/Runtime/Internal/Pools/*.meta
/Assets/XCharts/Runtime/Internal/Utility/*.meta
/Assets/XCharts/Runtime/Helper/*.meta
/Assets/XCharts/Runtime/Component/*.meta
/Assets/XCharts/Runtime/Component/Sub/*.meta
/Assets/XCharts/Runtime/Component/Main/*.meta
/Assets/XCharts/Editor/PropertyDrawers/*.meta
/Assets/XCharts/Editor/Utility/*.meta
/Assets/XCharts/Editor/*.meta
/Assets/XCharts/Documentation/*.meta
/Assets/XCharts/Documentation/*.meta
/Assets/XChartsDemo/demo_test.unity
/Assets/XChartsDemo/demo_test.unity.meta
/Assets/XChartsDemo/empty.unity

View File

@@ -1,12 +1,301 @@
# 更新日志
* (2020.08.24) Release `V1.6.0` version
* (2020.08.23) Refactor code, replace `Color` with `Color32` for reduce implicit conversion (Can cause custom colors to lose, reference [Q&A 29](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md) to upgrade)
* (2020.08.15) Optimize `PieChart` drawing performance effect #85
[branch-2.0](#branch-2.0)
[v2.8.2](#v2.8.2)
[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)
[v2.2.1](#v2.2.1)
[v2.2.0](#v2.2.0)
[v2.1.1](#v2.1.1)
[v2.1.0](#v2.1.0)
[v2.0.1](#v2.0.1)
[v2.0.0](#v2.0.0)
[v2.0.0-preview.2](#v2.0.0-preview.2)
[v2.0.0-preview.1](#v2.0.0-preview.1)
[v1.6.3](#v1.6.3)
[v1.6.1](#v1.6.1)
[v1.6.0](#v1.6.0)
[v1.5.2](#v1.5.2)
[v1.5.1](#v1.5.1)
[v1.5.0](#v1.5.0)
[v1.4.0](#v1.4.0)
[v1.3.1](#v1.3.1)
[v1.3.0](#v1.3.0)
[v1.2.0](#v1.2.0)
[v1.1.0](#v1.1.0)
[v1.0.5](#v1.0.5)
[v1.0.4](#v1.0.4)
[v1.0.3](#v1.0.3)
[v1.0.2](#v1.0.2)
[v1.0.1](#v1.0.1)
[v1.0.0](#v1.0.0)
[v0.8.3](#v0.8.3)
[v0.8.2](#v0.8.2)
[v0.8.1](#v0.8.1)
[v0.8.0](#v0.8.0)
[v0.5.0](#v0.5.0)
[v0.1.0](#v0.1.0)
## branch-2.0
## v2.8.2
* (2022.08.15) Release `v2.8.2` version
* (2022.08.15) Added support for the `HeatmapChart` formatter for custom Tooltip
* (2022.07.13) Fixed `SerieLabel` refresh exception #215
* (2022.06.30) Optimize `Radar` so that the `Tooltip` layer is above `Indicator`
## 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
* (2021.08.03) Fixed y axis not displaying when all data is 0
* (2021.07.29) Fixed ignored data will also participate in calculations when `ignore` is enabled (#161)
* (2021.07.29) Improved `BarChart`'s `Zebra` gradient support
* (2021.07.26) Fixed issue where `XCharts` path could not be found when `TextMeshPro Enable` (#160)
## v2.3.0
### Main points
* Data store upgraded from `float` to `double`
* Added `MarkLine`
* `Serie` can use `IconStyle` to configure ICONS uniformly
* `Label` supports custom display styles with code
* `DataZoom` is perfect
* `PieChart` optimization
* Problem fixes
### Upgrade Note
Since the data type is upgraded to `double`, the implicit conversion of `float` to `double` may have precision problems, so it is recommended that all previous data types of `float` be manually changed to `double`.
### Details
* (2021.07.24) Release `v2.3.0` version
* (2021.07.22) Improved `SerieSymbol` to support `PictorialBarchart` extension
* (2021.07.19) Fixed issue where `Tooltip` was not displayed on `WdbGL` platform
* (2021.07.18) Added `iconStyle` for serie
* (2021.07.15) Added `MarkLine` (#142)
* (2021.07.09) Optimize `BarChart` to set whether to show bars via `seriedata.show`
* (2021.07.08) Optimize data storage type from `float` to `double`
* (2021.07.05) Fixed `Piechart` `avoidLabelOverlap` parameter not working
* (2021.07.04) Fixed incorrect mouse area indication after `PieChart` selected sector
* (2021.07.04) Optimize when the `Label` of `PieChart` is `Inside`, the offset can be adjusted by the parameter `Margin`
* (2021.07.01) Added `DataZoom` arguments to `supportInsideScroll` and `supportInsideDrag` to set whether scrolling and dragging are supported in the coordinate system
* (2021.06.27) Add `showStartLabel` and `showEndLabel` arguments to `AxisLabel` to set whether the `Label` should be displayed at the beginning and end of the `AxisLabel`
* (2021.06.27) Added `formatter` delegate method to `AxisLabel` and `SerieLabel` (#145)
* (2021.06.27) Added `DataZoom`'s `orient` parameter to set horizontal or vertical styles
* (2021.06.21) Added `iconStyle`'s `AutoHideWhenLabelEmpty` to set whether the icon is automatically hidden when `label` is empty
# # v2.2.3
* (2021.06.20) Release `v2.2.3` version
* (2021.06.20) Fixed the default display of `Icon` in `Axis`
## v2.2.2
* (2021.06.18) Release `v2.2.2` version
* (2021.06.18) Optimize `Axis` to automatically hide `Icon` when `Label` is empty
* (2021.06.17) Fixed an issue where `maxCache` was set to one more number of actual data
* (2021.06.17) Fixed an issue where `TextMeshPro` could not be opened and closed in time to refresh
* (2021.06.17) Fixed an issue where `XCharts` always pops up when importing `XCharts`
## v2.2.1
* (2021.06.13) Release `v2.2.1` version
* (2021.06.13) Improved support for multiple screens
* (2021.06.12) Added `iconStyle` `align` parameter to set the horizontal alignment of the icon
* (2021.06.12) Improve `Theme` import (#148)
* (2021.06.10) Fixed compatibility issues with `Unity` version (#154)
* (2021.06.05) Improved Candlestickchart support for inverse (#152)
* (2021.06.04) Fixed `Gauge` having an abnormal pointer position when the minimum value is negative (#153)
## v2.2.0
* (2021.05.30) Release `v2.2.0` version
* (2021.05.25) Improved `TextStyle` support for `alignment`
* (2021.05.24) Fixed the problem that `Label` could not display properly when `PieChart` data were all `0`
* (2021.05.24) Fixed an issue where `Serie Name` was not working on the `Add Serie` panel (#149)
* (2021.05.23) Added `TextStyle` `autoWrap` to set whether to wrap lines
* (2021.05.23) Added `TextStyle` `autoAlign` whether to set alignment automatically
* (2021.05.23) Added `width` and `height` of `axisLabel` to support custom text length and width
* (2021.05.23) Added `Axis` `iconStyle` and `icons` to support setting coordinate Axis labels to display icons
* (2021.05.20) Added the `insertDataHead` parameter to `Serie` and `Axis` to control whether data is inserted into the head or tail
* (2021.05.18) Optimize chart creation under `Editor` #147
* (2021.05.16) Pull out the `Ganttchart` chart and provide it as an extension module
* (2021.05.11) Added support for `VisualMap` to set color by `Piecewise`
* (2021.05.09) Fixed an issue where `RingChart` could not set the background color of the ring #141
* (2021.05.08) Added `Liquidchart` support for `Rect` shape
* (2021.05.07) Improved the `Axis` scale performance #135
* (2021.05.01) Added `Settings` parameters for painter's material #140
* (2021.05.01) Fixed an issue where some super large or super small values could not be properly represented
* (2021.04.29) Fixed an issue with `Radar` switching to `Circle` anomaly #139
* (2021.04.29) Added `Settings`'s `reversePainter` to set whether or not `Serie` is drawn in reverse order
* (2021.04.28) Fixed bug where `AxisLabel` displayed incorrectly with `DataRoom` (#138)
* (2021.04.26) Fixed dynamically creating chart at runtime would be abnormal #137
* (2021.04.26) Added support for `Barchart` to draw gradient borders
* (2021.04.23) Added support for custom charts
* (2021.04.22) Fixed bug where `Gauge` `axisLabel`'s text color could not be adjusted
* (2021.04.13) Add the `ShowStarttick` and '`ShowEndTick` parameters of 'AxisTick' to control whether the first and last ticks are displayed
* (2021.04.13) Improved multi-axis support #132
## v2.1.1
* (2021.04.13) Define the code and clear `Warning`
* (2021.04.13) Fixed compatibility issues with `Unity` version
* (2021.04.12) Fixed problem `missing class attribute 'ExtensionOfNativeClass'` after Theme refactoring #131
## v2.1.0
* (2021.04.07) Release `v2.1.0` version
* (2021.03.31) Optimized and refactor `Theme` to solve problems with the same or missing references #118
* (2021.03.30) Optimized `Tooltip` to support setting different category axis data #129
* (2021.03.29) Optimized the custom draw callback API
* (2021.03.25) Added `Ganttchart`
* (2021.03.22) Added `Theme` `Unbind` button to unbind theme when copying chart #118
* (2021.03.18) Fixed an issue where the check box after `Foldout` in `Inspector` could not be checked
* (2021.03.18) Fixed an issue with `BarChart` displaying an exception in the `0` value
* (2021.03.14) Fixed `Tooltip` indicator was not indicating the correct location in some cases
* (2021.03.13) Optimized the editing experience and component refresh after `MulticomponentMode` is enabled #128
* (2021.03.10) Added `CandlestickChart` #124
* (2021.03.06) Added `PieChart`'s `minAngle` parameter to support setting minimum sector angle #117
* (2021.03.05) Added support for `Legend` for several built-in ICONS #90
* (2021.03.02) Added `DataRoom` support for value axes #71
* (2021.03.02) Optimized `TextMeshPro` compatibility issue #125
* (2021.03.01) Fixed display exception of hidden gameObjects when enabling and disabling a chart #125
## v2.0.1
* (2021.02.26) Fixed incorrect position of `Tooltip` in `HeatmapChart` #123
* (2021.02.22) Fixed compatibility issues with `Unity` version
* (2021.02.21) Added `Tooltip` parameter `ignoreDataShow`
* (2021.02.19) Fixed an issue where charts could appear abnormal when under `LayoutGroup` control #121
* (2021.02.18) Fixed an issue where the `Radar` could not refresh itself after parameter changing #122
## v2.0.0
* (2021.02.05) Release `v2.0.0` version
* (2021.02.03) Fixed an issue where `Axisline` `OnZero` did not work on `YAxis` #116
* (2021.01.29) Fixed incorrect display of `Tick` on `Category` axis when `BoundaryGap` and `alignWithLabel` are `True` #115
* (2021.01.25) Optimized some details
* (2021.01.22) Fixed a `Inpsector` displayed error
## v2.0.0-preview.2
* (2021.01.21) Release `v2.0.0-preview.2` version
* (2021.01.21) Fixed an error about `AxisTick` in `Inpsector`
* (2021.01.21) Fixed a build compatibility error
* (2021.01.19) Added `XChartsSettings` `editorShowAllListData` parameter to configure whether to display all the list's data in Inspector
## v2.0.0-preview.1
* (2021.01.19) Release `v2.0.0-preview.1` version
## v1.6.3
* (2021.01.02) Release `v1.6.3` version
* (2020.12.18) fixed an issue where updating data when `Animation` was not enabled caused the chart to keep refreshing
* (2020.12.01) fixed an issue where a newly created chart on `Unity2020` could not be drawn properly
## v1.6.2
* (2020.11.22) Release `v1.6.2` version
* (2020.11.22) Fixed an issue where `LineChart` draws an exception when the data is too dense #99
* (2020.11.21) Fixed an issue where the scale position of `LineChart` could be abnormal if `alignWithLabel` was `true`
* (2020.11.21) Fixed `Unity5` compatibility error reporting problem
* (2020.11.13) Improved `RadarChart` `Indicator` support for `\n` line feed
* (2020.11.12) Fixed `LineChart` reporting errors when the type was `Smooth` when the data was too secure #100
* (2020.10.22) Optimized the support of `VisualMap` for `Piecewise` in `HeatmapChart`
* (2020.09.22) Fixed `PieChart` inconsistent border size
* (2020.09.18) Added `Remove All Chart Object` to Remove All child nodes under the Chart (automatically reinitialized)
* (2020.09.18) Fixed `SerieLabel` also displayed after hided `Serie` by clicked the legend #94
* (2020.09.18) Optimized coordinate axis calibration and text display #93
* (2020.09.17) Fixed `Package` import missing `meta` file causing failure #92
* (2020.09.08) Optimized the color of `Legend` to automatically match the custom color of `ItemStyle`
* (2020.09.05) Optimized `LineChart` to display `XAxis1` without using `XAxis1`.
* (2020.08.29) Added `toColor` and `toColor2` of `LineStyle` to set the horizontal gradient of `LineChart`. Cancel `ItemStyle` to set the horizontal gradient of `LineChart`.
* (2020.08.29) Added the `onPointerClickPie` of `PieChart`, a callback function of click pie area.
* (2020.08.29) Added the `onPointerClickBar` of `BarChart`, a callback function of click bar.
## v1.6.0
* (2020.08.24) Release `v1.6.0` version
* (2020.08.23) Refactor code, replace `Color` with `Color32` for reduce implicit conversion (Can cause custom colors to lose, reference [Q&A 29](https://github.com/monitor1394/unity-ugui-XCharts/blob/2.0/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md) to upgrade)
* (2020.08.15) Optimized `PieChart` drawing performance effect #85
* (2020.08.11) Added `LiquidChart` data change animation#83
* (2020.08.11) Optimize `PieChart` text stack and lead line effects#85
* (2020.08.08) Optimize `LineChart` the rendering performance of dense data
* (2020.08.11) Optimized `PieChart` text stack and lead line effects#85
* (2020.08.08) Optimized `LineChart` the rendering performance of dense data
* (2020.07.30) Added `LineChart` to configure gradient through `VisualMap` or `ItemStyle`#78
* (2020.07.25) Fixed a problem with `LineChart` emerging abnormal in animation drawing#79
* (2020.07.25) Fixed a problem with gradual discoloration on `LiquidChart` at `100%`#80
@@ -14,31 +303,35 @@
* (2020.07.23) Added `RingChart` ring gradient support#75
* (2020.07.21) Added `formatter` of `AxisLabel` and `SerieLabel` to configure numeric formatting separately.
* (2020.07.17) Added animation completion callback interface for `SerieAnimation`.
* (2020.07.17) Optimize `Chart` under `ScrollView` without affecting the scrolling and dragging of `ScrollView`.
* (2020.07.17) Optimized `Chart` under `ScrollView` without affecting the scrolling and dragging of `ScrollView`.
* (2020.07.16) Fixed a problem with `Tooltip` that would also show up if it was blocked on top. #74
* (2020.07.08) 优化`Scatter`类型`Serie`支持`Log`#70
* (2020.07.07) 修复`SerieLabel`位置错乱的问题
* (2020.07.07) 增加`Tooltip``offset`参数配置偏移
* (2020.07.06) 增加`LiquidChart`水位图
* (2020.07.01) 增加`PolarChart`极坐标图表
* (2020.06.25) 发布`v1.5.2`版本
* (2020.06.25) 修复`BarChart`在数值为`0`时还会绘制一小部分柱条的问题
* (2020.06.24) 修复`PieChart`在设置`clockwise`后绘制异常的问题#65
* (2020.06.23) 优化`LineChart`在峰谷差异过大时的绘制效果#64
* (2020.06.18) 修复`SerieLabel`在重新添加数据时可能不显示的问题
* (2020.06.17) 增加`SerieData`可单独设置`SerieSymbol`#66
* (2020.06.17) 修复`Check For Update``Unity 2018`部分版本报错的问题#63
* (2020.06.16) 增加`Serie``avoidLabelOverlap`参数避免饼图标签堆叠的情况#56
* (2020.06.15) 修复`SerieLabel`单独控制显示时可能错乱的问题
* (2020.06.11) 修复`Check warning`不生效的问题
* (2020.06.11) 修复`PieChart``RingChart`在数据占比很小时不显示的问题
* (2020.06.11) 增加`Tooltip``titleFormatter`支持配置占位符`{i}`表示忽略不显示标题
* (2020.06.07) 增加`Animation``customFadeInDelay`等自定义数据项延时和时长回调函数#58
* (2020.06.07) 优化`PieChart`在数据全为`0`时的显示为等份的效果#59
* (2020.06.04) 增加`SerieLabel``autoOffset`参数设置是否自动判断上下偏移
* (2020.06.04) 增加`Tooltip``alwayShow`参数设置触发后一直显示
* (2020.06.04) 优化`Tooltip``formatter`支持`{.1}`通配符
* (2020.06.04) 优化`Legend`数量过多时自动换行显示#53
* (2020.07.07) Fixed issue where `SerieLabel` position was out of order
* (2020.07.07) Added `Tooltip` to the `offset` parameter
* (2020.07.06) Added `Liquidchart`
* (2020.07.01) Added `PolarChart`
## v1.5.2
* (2020.06.25) Fixed an issue where `BarChart` would draw a small number of bars when the value was `0`
* (2020.06.24) Fixed an issue where `PieChart` was drawing abnormally after setting `Clockwise` #65
* (2020.06.23) Optimized the drawing effect of `LineChart` when the difference between peak and valley is too large #64
* (2020.06.18) Fixed an issue where `SerieLabel` might not be displayed when adding data again
* (2020.06.17) Added `SerieData` to `serieSymbol` #66
* (2020.06.17) Fixed `Check For Update` bug in `Unity 2018` version #63
* (2020.06.16) Added `Serie` `avoidLabelOverlap` parameter to avoid pie chart TAB stacking #56
* (2020.06.15) Fixed an issue where the `SerieLabel` control display could be deranged
* (2020.06.11) Fixed `Check warning` not working
* (2020.06.11) Fixed issue where `Piechart` and `Ringchart` were not displayed when data fraction was very small
* (2020.06.11) Added `Tooltip` to `titleFormatter` to support configuration placeholder `{i}` to ignore not showing titles
* (2020.06.07) Added `customFadeInDelay` and other custom data item delay and duration callback function #58
* (2020.06.07) Optimized `Piechart` to display equal parts when all the data are `0` #59
* (2020.06.04) Added `autoOffset` parameter setting for `SerieLabel` to determine whether the up and down offset is automatically determined
* (2020.06.04) Added `Tooltip` to `AlwayShow` parameter setting to always show after triggering
* (2020.06.04) Tooltip's `formatter` supports `{.1}` wildcards
* (2020.06.04) Optimizes the number of `Legend` to automatically wrap to display #53
## v1.5.1
* (2020.06.03) 发布`v1.5.1`版本
* (2020.06.02) 增加`Radar``ceilRate`,设置最大最小值的取整倍率
* (2020.06.02) 优化`Tooltip``formatter`,支持`{c1:1-1:f1}`格式配置
@@ -51,6 +344,11 @@
* (2020.05.27) 优化`柱状图`的渐变色效果
* (2020.05.24) 修复`Axis`同时设置`boundaryGap``alignWithLabel``Tick`绘制异常的问题
* (2020.05.24) 优化版本更新检测
* (2020.06.25) release `v1.5.2`
## v1.5.0
* (2020.05.22) 发布`v1.5.0`版本
* (2020.05.21) 增加`圆角柱图`支持渐变
* (2020.05.21) 增加`Background`背景组件
@@ -72,6 +370,9 @@
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
* (2020.04.16) 修复`Check warning``Unity2019.3`上的显示问题
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
## v1.4.0
* (2020.04.11) 发布`v1.4.0`版本
* (2020.04.11) 增加`Check warning`检测功能
* (2020.04.09) 修复`Legend`初始化异常的问题
@@ -92,9 +393,15 @@
* (2020.03.17) 增加`SerieData``ItemStyle``Emphasis`可单独配置数据项样式的支持
* (2020.03.15) 重构`EmptyCricle`类型的`Symbol`边宽取自`ItemStyle``borderWidth`参数
* (2020.03.15) 重构`SerieSymbol`,去掉`color``opacity`参数,取自`ItemStyle`
## v1.3.1
* (2020.03.14) 发布`v1.3.1`版本
* (2020.03.14) 修复`LineChart`开启`ingore`时部分数据可能绘制异常的问题
* (2020.03.13) 修复`LineChart``label`偏移显示异常的问题
## v1.3.0
* (2020.03.11) 发布`v1.3.0`版本
* (2020.03.11) 优化`LineChart``label`偏移显示
* (2020.03.11) 优化清空并重新添加数据后的自动刷新问题
@@ -118,6 +425,9 @@
* (2020.01.26) 增加`TextLimit`组件可以设置`AxisLabel`的文本自适应
* (2020.01.20) 优化`Tooltip`设置`itemFormatter`时显示系列颜色
* (2020.01.20) 增加`Radar`雷达图在`inspector`配置`areaStyle`的支持
## v1.2.0
* (2020.01.15) 发布`v1.2.0`版本
* (2020.01.15) 增加`AxisLabel`格式化为整数的支持(`{value:f0}`
* (2020.01.15) 增加折线图对数轴`Log`的支持
@@ -128,6 +438,9 @@
* (2019.12.21) 增加`DataZoom`的最小显示数据个数`minShowNum`
* (2019.12.20) 增加`Demo40_Radar.cs`雷达图代码操作`Demo`
* (2019.12.20) 添加`RadarChart`相关API接口
## v1.1.0
* (2019.12.17) 发布`v1.1.0`版本
* (2019.12.16) 修复`Overlay`模式下不显示`Tooltip`的问题
* (2019.12.15) 增加`Title``TextStyle`支持
@@ -140,6 +453,9 @@
* (2019.11.30) 增加`GaugeChart`仪表盘
* (2019.11.22) 修复`BarChart`清空数据重新赋值后`SerieLabel`显示异常的问题
* (2019.11.16) 修复`SerieLabel`设置`color`等参数不生效的问题
## v1.0.5
* (2019.11.12) 发布`v1.0.5`版本
* (2019.11.12) 修复`2018.3`以下版本打开项目报错的问题
* (2019.11.12) 增加`IconStyle`子组件,优化`SerieData`的图标配置
@@ -147,21 +463,36 @@
* (2019.11.11) 修复饼图当数据过小时视觉引导线会穿透的的问题
* (2019.11.09) 修复饼图添加数据时`Label`异常的问题
* (2019.11.09) 优化结构,分离为`XCharts``XChartsDemo`两部分
## v1.0.4
* (2019.11.05) 发布`v1.0.4`版本
* (2019.11.05) 增加`Radar`雷达组件文本样式参数配置支持
* (2019.11.04) 修复`Unity2018.3`以下版本代码不兼容的问题
* (2019.11.04) 优化`SerieLabel`过多时引起的性能问题
## v1.0.3
* (2019.11.03) 发布`v1.0.3`版本
* (2019.11.03) 增加`Editor`快捷添加图表:`Hierarchy`试图下右键`XCharts->LineChart`
* (2019.11.02) 优化非配置参数变量命名和访问权限,简化`API`
## v1.0.2
* (2019.10.31) 发布`v1.0.2`版本
* (2019.10.31) 修复`prefab`预设制作报错的问题
* (2019.10.31) 增加访问主题组件API`BaseChart.themeInfo`
* (2019.10.31) 增加访问主题组件API`BaseChart.theme`
## v1.0.1
* (2019.10.26) 发布`v1.0.1`版本
* (2019.10.26) 修复版本检查功能在非运行时异常的问题
* (2019.10.26) 增加科学计数法显示数值的支持(查阅`forceENotation`参数)
* (2019.10.26) 增加`Axis`类目轴数据为空时的默认显示支持
* (2019.10.26) 增加`Axis`数值轴的最大最小值可设置为小数的支持,优化极小数图表的表现效果
## v1.0.0
* (2019.10.25) 发布`v1.0.0`版本
* (2019.10.23) 增加版本检测功能:`Component -> XCharts -> Check For Update`
* (2019.10.22) 增加`Package Manager`安装的支持
@@ -225,16 +556,28 @@
* (2019.08.15) 增加`LineChart``Label`配置
* (2019.08.15) 重构`BarChart`,移除`Bar`组件,相关参数统一放到`Serie`中配置
* (2019.08.15) 重构`LineChart`,移除`Line`组件,相关参数统一放到`Serie`中配置
## v0.8.3
* (2019.08.15) 发布`v0.8.3`版本
* (2019.08.14) 修复`PieChart``Label`无法自动更新的问题
* (2019.08.13) 修复`UpdateData`接口无法更新数据的问题
* (2019.08.07) 增加`SerieSymbol``Color``Opacity`配置
## v0.8.2
* (2019.08.07) 发布`v0.8.2`版本
* (2019.08.07) 修复区域平滑折线图显示异常的问题
* (2019.08.06) 修复`serie`系列数超过调色盘颜色数时获取的颜色异常的问题
* (2019.08.06) 修复当`Axis``minMaxType``Custom``max`设置为`100`不生效的问题
## v0.8.1
* (2019.08.04) 发布`v0.8.1`版本
* (2019.08.04) 修复Inspector中修改数据不生效的问题
* (2019.08.04) 修复`Inspector`中修改数据不生效的问题
## v0.8.0
* (2019.08.04) 发布`v0.8.0`版本
* (2019.08.04) 优化`RadarChart`雷达图,增加多雷达图支持
* (2019.08.01) 增加代码API注释文档整理代码
@@ -253,6 +596,9 @@
* (2019.07.15) 增加`Size`设置图表尺寸
* (2019.07.14) 增加`二维数据`支持XY轴都可以设置为数值轴
* (2019.07.13) 增加`双坐标轴`支持,代码改动较大
## v0.5.0
* (2019.07.10) 发布`v0.5.0`版本
* (2019.07.09) 增加`AxisLine`配置坐标轴轴线和箭头
* (2019.07.03) 增加`AxisLabel`配置坐标轴`刻度标签`
@@ -272,4 +618,7 @@
* (2019.05.11) 增加自定义`Editor`编辑
* (2019.03.21) 增加`Tooltip`
* (2018.11.01) 增加`Default``Light``Dark`三种默认主题
## v0.1.0
* (2018.09.05) 发布`v0.1.0`版本

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 042c85734494346adab5b3233234d261
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,8 +1,304 @@
# 更新日志
[branch-2.0](#branch-2.0)
[v2.8.2](#v2.8.2)
[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)
[v2.2.1](#v2.2.1)
[v2.2.0](#v2.2.0)
[v2.1.1](#v2.1.1)
[v2.1.0](#v2.1.0)
[v2.0.1](#v2.0.1)
[v2.0.0](#v2.0.0)
[v2.0.0-preview.2](#v2.0.0-preview.2)
[v2.0.0-preview.1](#v2.0.0-preview.1)
[v1.6.3](#v1.6.3)
[v1.6.1](#v1.6.1)
[v1.6.0](#v1.6.0)
[v1.5.2](#v1.5.2)
[v1.5.1](#v1.5.1)
[v1.5.0](#v1.5.0)
[v1.4.0](#v1.4.0)
[v1.3.1](#v1.3.1)
[v1.3.0](#v1.3.0)
[v1.2.0](#v1.2.0)
[v1.1.0](#v1.1.0)
[v1.0.5](#v1.0.5)
[v1.0.4](#v1.0.4)
[v1.0.3](#v1.0.3)
[v1.0.2](#v1.0.2)
[v1.0.1](#v1.0.1)
[v1.0.0](#v1.0.0)
[v0.8.3](#v0.8.3)
[v0.8.2](#v0.8.2)
[v0.8.1](#v0.8.1)
[v0.8.0](#v0.8.0)
[v0.5.0](#v0.5.0)
[v0.1.0](#v0.1.0)
## branch-2.0
* (2022.12.28) 修复`Pie`只有一个数据时设置`border`后显示异常的问题 (#237)
* (2022.08.30) 修复`DataZoom`在某些情况下计算范围不准确的问题 (#221)
## v2.8.2
* (2022.08.15) 发布`v2.8.2`版本
* (2022.08.15) 增加`HeatmapChart`对自定义`Tooltip``formatter`的支持
* (2022.07.13) 修复`SerieLabel`刷新异常的问题 #215
* (2022.06.30) 优化`Radar``Tooltip`的层在`Indicator`之上
## 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`版本
* (2022.02.21) 修复`Chart``chartName`重复检测问题 #183
* (2022.02.17) 修复`Axis``SplitLine`可能会显示在坐标系外的问题 #181
* (2022.02.08) 修复数据全0时`{d}`显示不正确的问题
* (2022.02.08) 修复`YAxis``AxisLabel``onZero`参数不生效的问题
* (2022.01.06) 优化`Zebra`斑马柱图
## v2.6.0
* (2021.12.30) 发布`v2.6.0`版本
* (2021.12.21) 修复`Emphasis`不生效的问题
* (2021.12.17) 修复`MarkLine`在运行时`Label`不自动刷新显示隐藏的问题 #178
* (2021.12.10) 完善`Radar``AxisLine``SplitLine`可单独控制
* (2021.12.08) 修复`Serie`隐藏后`Y`轴最大值不刷新的问题
* (2021.12.04) 增加`Symbol`新类型:`EmptyRect`,`EmptyTriangle`,`EmptyDiamond`
* (2021.12.04) 增加`Symbol``Empty`区域颜色可通过`ItemStyle``backgroundColor`设置的支持
* (2021.12.03) 修复`Formatter``{c}`通配符不生效的问题 #175
* (2021.12.03) 修复`Axis``boundaryGap`某些情况下显示的问题 #174
* (2021.11.30) 修复`Serie``ignore`某些情况下绘制异常的问题 #173
## v2.5.0
* (2021.11.27) 发布`v2.5.0`版本
* (2021.11.27) 增加`Tooltip``positionFunction`的坐标设置委托函数
* (2021.10.29) 移除`XCharts`首次导入时`TextMeshPro`的相关设置
* (2021.10.29) 增加`Tooltip`对通配符`{e}`的支持 #170
* (2021.09.08) 完善`RadarChart`
* (2021.09.07) 修复`PieChart`渐出动画结束时`label`没有消失的问题 #168
* (2021.09.06) 修复`GaugeChart`用代码改变`splitNumber`不会刷新`label`的问题 #167
## v2.4.0
### 版本要点
* 折线图支持忽略数据的连线是断开还是连接
* 折线图支持轨迹匀速动画
* 其他优化和问题修复
### 日志详情
* (2021.08.31) 发布`v2.4.0`版本
* (2021.08.31) 优化`RingChart`的渐变效果
* (2021.08.31) 修复`DataZoom`拖动时`SerieLabel`不刷新的问题 (#165)
* (2021.08.25) 修复`Theme`主题切换无法保持到场景上的问题 (#166)
* (2021.08.24) 增加`Animation``alongWithLinePath`参数设置折线轨迹匀速动画
* (2021.08.22) 增加`Serie``ignoreLineBreak`参数设置忽略数据连线是否断开 (#164)
* (2021.08.22) 修复`Axis``DataZoom`开启时`Label`可能不更新的问题 (#164)
* (2021.08.15) 优化`Axis``AxisLabel`文本旋转设置避免在DataZoom开启时偏移不一致 (#163)
* (2021.08.14) 增加`Legend``textAutoColor`设置文本颜色和`Serie`一致 (#163)
* (2021.08.12) 优化`BarChart`设置`Corner`时正负柱条圆角对称
* (2021.08.03) 优化`Serie`的数据全为0时Y轴不显示的问题
* (2021.07.29) 修复`Serie`开启`ignore`时被忽略的数据还会参与计算的问题 (#161)
* (2021.07.29) 完善`BarChart``Zebra`斑马柱图渐变支持
* (2021.07.26) 修复`TextMeshPro Enable`时找不到`XCharts`路径的问题 (#160)
## v2.3.0
### 版本要点
* 数据存储由`float`升级为`double`
* 新增`MarkLine`标线
* `Serie`下可用`IconStyle`统一配置图标
* `Label`支持用代码自定义显示样式
* `DataZoom`完善
* `PieChart`优化
* 问题修复
### 升级注意
由于数据类型升级为了`double``float`隐式转`double`可能有精度问题,所以建议之前为`float`的数据类型都手动改为`double`类型。
### 日志详情
* (2021.07.24) 发布`v2.3.0`版本
* (2021.07.22) 完善`SerieSymbol`以支持象形柱图`PictorialBarChart`扩展
* (2021.07.19) 修复`WdbGL`平台上`Tooltip`不显示的问题
* (2021.07.18) 增加`Serie``iconStyle`统一配置图标
* (2021.07.15) 增加`MarkLine`标线 (#142)
* (2021.07.09) 优化`BarChart`可通过`serieData.show`设置是否显示柱条
* (2021.07.08) 优化`data`数据存储类型由`float`全部转为`double`
* (2021.07.05) 修复`PieChart``avoidLabelOverlap`参数不生效的问题
* (2021.07.04) 修复`PieChart`选中扇区后鼠标区域指示不准确的问题
* (2021.07.04) 优化`PieChart``Label``Inside`时可通过参数`Margin`调节偏移
* (2021.07.01) 增加`DataZoom``supportInsideScroll``supportInsideDrag`参数设置坐标系内是否支持滚动和拖拽
* (2021.06.27) 增加`AxisLabel``showStartLabel``showEndLabel`参数设置首尾的`Label`是否显示
* (2021.06.27) 增加`AxisLabel``SerieLabel``formatter`委托方法 (#145)
* (2021.06.27) 增加`DataZoom``orient`参数设置水平或垂直样式
* (2021.06.21) 增加`IconStyle``autoHideWhenLabelEmpty`参数设置当`label`为空时是否自动隐藏图标
## v2.2.3
* (2021.06.20) 发布`v2.2.3`版本
* (2021.06.20) 修复`Axis``Icon`默认显示出来的问题
## v2.2.2
* (2021.06.18) 发布`v2.2.2`版本
* (2021.06.18) 优化`Axis``Label`为空时自动隐藏`Icon`
* (2021.06.17) 修复`maxCache`设置时实际数据个数多一个的问题
* (2021.06.17) 修复`TextMeshPro`的开启和关闭不及时刷新的问题
* (2021.06.17) 修复`XCharts`导入时总是弹出`XCharts Importer`的问题
## v2.2.1
* (2021.06.13) 发布`v2.2.1`版本
* (2021.06.13) 完善对多屏幕的支持
* (2021.06.12) 增加`IconStyle``align`参数设置图标的水平对齐
* (2021.06.12) 完善`Theme`主题导入 (#148)
* (2021.06.10) 修复`Unity`版本兼容问题 (#154)
* (2021.06.05) 完善`CandlestickChart``inverse`的支持 (#152)
* (2021.06.04) 修复`Gauge`在最小值为负数时指针指示位置异常的问题 (#153)
## v2.2.0
* (2021.05.30) 发布`v2.2.0`版本
* (2021.05.25) 完善`TextStyle``alignment`的支持 (#150)
* (2021.05.24) 修复`PieChart`数据全为`0``Label`无法正常显示的问题
* (2021.05.24) 修复`Add Serie`面板上`Serie Name`不生效的问题 (#149)
* (2021.05.23) 增加`TextStyle``autoWrap`设置是否自动换行
* (2021.05.23) 增加`TextStyle``autoAlign`设置是否让系统自动设置对齐方式
* (2021.05.23) 增加`AxisLabel``width``height`支持自定义文本的长宽
* (2021.05.23) 增加`Axis``iconStyle``icons`支持设置坐标轴标签显示图标
* (2021.05.20) 增加`Serie``Axis``insertDataToHead`参数控制数据插入头部还是尾部
* (2021.05.18) 优化`Editor`下的图表创建 #147
* (2021.05.16) 抽离`GanttChart`甘特图,通过扩展模块的方式来提供
* (2021.05.11) 增加`VisualMap``Piecewise`分段设置颜色的支持
* (2021.05.09) 修复`RingChart`无法设置环形的背景色的问题 #141
* (2021.05.08) 增加`LiquidChart`的方形水位图支持
* (2021.05.07) 优化`Axis`的刻度表现 #135
* (2021.05.01) 增加`Settings`中关于关于材质球设置的参数 #140
* (2021.05.01) 修复无法正确表示部分超大或超小数值的问题
* (2021.04.29) 修复`Radar`切换到`Circle`异常的问题 #139
* (2021.04.29) 增加`Settings``reversePainter`可设置`Serie`的绘制是否逆序
* (2021.04.28) 增加`SerieData``ignore`可忽略当前数据项
* (2021.04.28) 修复`DataZoom``AxisLabel`显示不准确的问题 #138
* (2021.04.26) 修复运行时动态创建图表会异常的问题 #137
* (2021.04.26) 增加`BarChart`绘制渐变边框的支持
* (2021.04.23) 增加自定义图表支持
* (2021.04.22) 修复`Gauge``AxisLabel`和文字颜色无法调整的问题
* (2021.04.13) 增加`AxisTick``ShowStartTick``ShowEndTick`参数控制第一个和最后一个刻度是否显示
* (2021.04.13) 完善多坐标轴的支持 #132
## v2.1.1
* (2021.04.13) 整理代码,清除`Warning`
* (2021.04.13) 修复`Unity`版本兼容问题
* (2021.04.12) 修复`Theme`重构后引起的`missing class attribute 'ExtensionOfNativeClass'`的问题 #131
## v2.1.0
* (2021.04.07) 发布`v2.1.0`版本
* (2021.03.31) 优化和重构`Theme`,解决引用相同或丢失的问题 #118
* (2021.03.30) 优化`Tooltip`支持设置不同的类目轴数据 #129
* (2021.03.29) 优化自定义绘制回调接口,增加`onCustomDrawBeforeSerie``onCustomDrawAfterSerie``onCustomDrawTop`
* (2021.03.25) 增加`GanttChart`甘特图
* (2021.03.22) 增加`Theme``Unbind`按钮用于解绑复制图表时的主题 #118
* (2021.03.18) 修复`Inspector``Foldout`后的勾选框无法选中的问题
* (2021.03.18) 修复`BarChart``0`数值时显示异常的问题
* (2021.03.14) 修复`Tooltip`的指示器在某些情况下指示位置不准的问题
* (2021.03.13) 优化`MultiComponentMode`开启后的编辑体验和组件刷新 #128
* (2021.03.10) 增加`CandlestickChart`K线图 #124
* (2021.03.06) 增加`PieChart``minAngle`参数支持设置最小扇区角度 #117
* (2021.03.05) 增加`Legend`几种内置图标的支持 #90
* (2021.03.02) 增加`DataZoom`对数值轴的支持 #71
* (2021.03.02) 优化`TextMeshPro`兼容问题 #125
* (2021.03.01) 修复隐藏和显示图表时部分已隐藏的节点显示异常的问题 #125
## v2.0.1
* (2021.02.26) 修复`HeatmapChart``Tooltip`指示的位置不准的问题 #123
* (2021.02.22) 修复`Unity`版本兼容问题
* (2021.02.21) 增加`Tooltip``ignoreDataShow`参数
* (2021.02.19) 修复图表在`LayoutGroup`控制下时可能显示错乱的问题 #121
* (2021.02.18) 修复`Radar`参数变更后无法自刷新的问题 #122
## v2.0.0
* (2021.02.05) 发布`v2.0.0`版本
* (2021.02.03) 修复`AxisLine``OnZero``YAxis`不生效的问题 #116
* (2021.01.29) 修复`Category`轴在`BoundaryGap``AlignWithLabel``True``Tick`显示效果不对的问题 #115
* (2021.01.25) 优化一些细节
* (2021.01.22) 修复`Inpsector`上部分属性显示异常的问题
## v2.0.0-preview.2
* (2021.01.21) 发布`v2.0.0-preview.2`版本
* (2021.01.21) 修复`Inpsector`上展开`AxisTick`时报错问题
* (2021.01.21) 修复打包兼容报错问题
* (2021.01.19) 增加`XChartsSettings``editorShowAllListData`参数配置是否在`Inspector`中显示列表的所有数据
## v2.0.0-preview.1
* (2021.01.19) 发布`v2.0.0-preview.1`版本
## v1.6.3
* (2021.01.02) 发布`v1.6.3`版本
* (2020.12.18) 修复`Animation`不启用时更新数据会导致图表一直刷新的问题
* (2020.12.01) 修复`Unity2020`上新创建的图表无法正常绘制的问题
* (2020.11.22) 发布`v1.6.2`版本
* (2020.11.22) 修复`LineChart`在数据过于密集时折线绘制异常的问题 #99
* (2020.11.21) 修复`LineChart`的刻度位置在`alignWithLabel``true`时可能异常的问题
* (2020.11.21) 修复`Unity5`兼容报错的问题
* (2020.11.13) 完善`RadarChart``Indicator``\n`换行的支持
* (2020.11.12) 修复`LineChart`当类型为`Smooth`时数据过密情况下报错的问题 #100
* (2020.10.22) 完善`HeatmapChart``VisualMap``Piecewise`的支持
* (2020.09.22) 修复`PieChart`边框大小不一致的问题
## v1.6.1
* (2020.09.19) 发布`v1.6.1`版本
* (2020.09.19) 增加`Remove All Chart Object`移除图表下的所有子节点(会自动重新初始化)
* (2020.09.18) 修复`SerieLabel`在点击图例隐藏`Serie`后还显示的问题#94
* (2020.09.18) 优化`Axis`的类目轴刻度和文本显示#93
* (2020.09.17) 修复`Package`导入时缺失`meta`文件导致失败的问题#92
* (2020.09.08) 优化`Legend`的颜色可自动匹配`ItemStyle`的自定义颜色#89
* (2020.09.05) 优化`LineChart`在不使用`XAxis1`时也能显示`XAxis1`
* (2020.08.29) 增加`LineStyle``toColor``toColor2`设置`LineChart`的水平渐变,取消通过`ItemStyle`设置`LineChart`的水平渐变
* (2020.08.29) 增加`PieChart``onPointerClickPie`点击扇形图扇区回调
* (2020.08.29) 增加`BarChart``onPointerClickBar`点击柱形图柱条回调
## v1.6.0
* (2020.08.24) 发布`v1.6.0`版本
* (2020.08.23) 重构代码,将与绘制相关的`Color`改为`Color32`,减少隐式转换(更新后会导致自定义的颜色丢失,可参考[问答29](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)进行升级)
* (2020.08.23) 重构代码,将与绘制相关的`Color`改为`Color32`,减少隐式转换(更新后会导致自定义的颜色丢失,可参考[问答29](https://github.com/monitor1394/unity-ugui-XCharts/blob/2.0/Assets/XCharts/Documentation/XCharts问答.md)进行升级)
* (2020.08.15) 优化`PieChart`绘制表现效果#85
* (2020.08.11) 增加`LiquidChart`数据变更动画#83
* (2020.08.11) 优化`PieChart`文本堆叠和引线效果#85
@@ -21,6 +317,9 @@
* (2020.07.07) 增加`Tooltip``offset`参数配置偏移
* (2020.07.06) 增加`LiquidChart`水位图
* (2020.07.01) 增加`PolarChart`极坐标图表
## v1.5.2
* (2020.06.25) 发布`v1.5.2`版本
* (2020.06.25) 修复`BarChart`在数值为`0`时还会绘制一小部分柱条的问题
* (2020.06.24) 修复`PieChart`在设置`clockwise`后绘制异常的问题#65
@@ -39,6 +338,9 @@
* (2020.06.04) 增加`Tooltip``alwayShow`参数设置触发后一直显示
* (2020.06.04) 优化`Tooltip``formatter`支持`{.1}`通配符
* (2020.06.04) 优化`Legend`数量过多时自动换行显示#53
## v1.5.1
* (2020.06.03) 发布`v1.5.1`版本
* (2020.06.02) 增加`Radar``ceilRate`,设置最大最小值的取整倍率
* (2020.06.02) 优化`Tooltip``formatter`,支持`{c1:1-1:f1}`格式配置
@@ -51,6 +353,9 @@
* (2020.05.27) 优化`柱状图`的渐变色效果
* (2020.05.24) 修复`Axis`同时设置`boundaryGap``alignWithLabel``Tick`绘制异常的问题
* (2020.05.24) 优化版本更新检测
## v1.5.0
* (2020.05.22) 发布`v1.5.0`版本
* (2020.05.21) 增加`圆角柱图`支持渐变
* (2020.05.21) 增加`Background`背景组件
@@ -72,6 +377,9 @@
* (2020.04.17) 增加`Axis`可通过`inverse`参数设置坐标轴反转
* (2020.04.16) 修复`Check warning``Unity2019.3`上的显示问题
* (2020.04.16) 修复`PieChart`在设置`Space`参数后动画绘制异常的问题
## v1.4.0
* (2020.04.11) 发布`v1.4.0`版本
* (2020.04.11) 增加`Check warning`检测功能
* (2020.04.09) 修复`Legend`初始化异常的问题
@@ -92,9 +400,15 @@
* (2020.03.17) 增加`SerieData``ItemStyle``Emphasis`可单独配置数据项样式的支持
* (2020.03.15) 重构`EmptyCricle`类型的`Symbol`边宽取自`ItemStyle``borderWidth`参数
* (2020.03.15) 重构`SerieSymbol`,去掉`color``opacity`参数,取自`ItemStyle`
## v1.3.1
* (2020.03.14) 发布`v1.3.1`版本
* (2020.03.14) 修复`LineChart`开启`ingore`时部分数据可能绘制异常的问题
* (2020.03.13) 修复`LineChart``label`偏移显示异常的问题
## v1.3.0
* (2020.03.11) 发布`v1.3.0`版本
* (2020.03.11) 优化`LineChart``label`偏移显示
* (2020.03.11) 优化清空并重新添加数据后的自动刷新问题
@@ -118,6 +432,9 @@
* (2020.01.26) 增加`TextLimit`组件可以设置`AxisLabel`的文本自适应
* (2020.01.20) 优化`Tooltip`设置`itemFormatter`时显示系列颜色
* (2020.01.20) 增加`Radar`雷达图在`inspector`配置`areaStyle`的支持
## v1.2.0
* (2020.01.15) 发布`v1.2.0`版本
* (2020.01.15) 增加`AxisLabel`格式化为整数的支持(`{value:f0}`
* (2020.01.15) 增加折线图对数轴`Log`的支持
@@ -128,6 +445,9 @@
* (2019.12.21) 增加`DataZoom`的最小显示数据个数`minShowNum`
* (2019.12.20) 增加`Demo40_Radar.cs`雷达图代码操作`Demo`
* (2019.12.20) 添加`RadarChart`相关API接口
## v1.1.0
* (2019.12.17) 发布`v1.1.0`版本
* (2019.12.16) 修复`Overlay`模式下不显示`Tooltip`的问题
* (2019.12.15) 增加`Title``TextStyle`支持
@@ -140,6 +460,9 @@
* (2019.11.30) 增加`GaugeChart`仪表盘
* (2019.11.22) 修复`BarChart`清空数据重新赋值后`SerieLabel`显示异常的问题
* (2019.11.16) 修复`SerieLabel`设置`color`等参数不生效的问题
## v1.0.5
* (2019.11.12) 发布`v1.0.5`版本
* (2019.11.12) 修复`2018.3`以下版本打开项目报错的问题
* (2019.11.12) 增加`IconStyle`子组件,优化`SerieData`的图标配置
@@ -147,21 +470,36 @@
* (2019.11.11) 修复饼图当数据过小时视觉引导线会穿透的的问题
* (2019.11.09) 修复饼图添加数据时`Label`异常的问题
* (2019.11.09) 优化结构,分离为`XCharts``XChartsDemo`两部分
## v1.0.4
* (2019.11.05) 发布`v1.0.4`版本
* (2019.11.05) 增加`Radar`雷达组件文本样式参数配置支持
* (2019.11.04) 修复`Unity2018.3`以下版本代码不兼容的问题
* (2019.11.04) 优化`SerieLabel`过多时引起的性能问题
## v1.0.3
* (2019.11.03) 发布`v1.0.3`版本
* (2019.11.03) 增加`Editor`快捷添加图表:`Hierarchy`试图下右键`XCharts->LineChart`
* (2019.11.02) 优化非配置参数变量命名和访问权限,简化`API`
## v1.0.2
* (2019.10.31) 发布`v1.0.2`版本
* (2019.10.31) 修复`prefab`预设制作报错的问题
* (2019.10.31) 增加访问主题组件API`BaseChart.themeInfo`
* (2019.10.31) 增加访问主题组件API`BaseChart.theme`
## v1.0.1
* (2019.10.26) 发布`v1.0.1`版本
* (2019.10.26) 修复版本检查功能在非运行时异常的问题
* (2019.10.26) 增加科学计数法显示数值的支持(查阅`forceENotation`参数)
* (2019.10.26) 增加`Axis`类目轴数据为空时的默认显示支持
* (2019.10.26) 增加`Axis`数值轴的最大最小值可设置为小数的支持,优化极小数图表的表现效果
## v1.0.0
* (2019.10.25) 发布`v1.0.0`版本
* (2019.10.23) 增加版本检测功能:`Component -> XCharts -> Check For Update`
* (2019.10.22) 增加`Package Manager`安装的支持
@@ -225,16 +563,28 @@
* (2019.08.15) 增加`LineChart``Label`配置
* (2019.08.15) 重构`BarChart`,移除`Bar`组件,相关参数统一放到`Serie`中配置
* (2019.08.15) 重构`LineChart`,移除`Line`组件,相关参数统一放到`Serie`中配置
## v0.8.3
* (2019.08.15) 发布`v0.8.3`版本
* (2019.08.14) 修复`PieChart``Label`无法自动更新的问题
* (2019.08.13) 修复`UpdateData`接口无法更新数据的问题
* (2019.08.07) 增加`SerieSymbol``Color``Opacity`配置
## v0.8.2
* (2019.08.07) 发布`v0.8.2`版本
* (2019.08.07) 修复区域平滑折线图显示异常的问题
* (2019.08.06) 修复`serie`系列数超过调色盘颜色数时获取的颜色异常的问题
* (2019.08.06) 修复当`Axis``minMaxType``Custom``max`设置为`100`不生效的问题
## v0.8.1
* (2019.08.04) 发布`v0.8.1`版本
* (2019.08.04) 修复`Inspector`中修改数据不生效的问题
## v0.8.0
* (2019.08.04) 发布`v0.8.0`版本
* (2019.08.04) 优化`RadarChart`雷达图,增加多雷达图支持
* (2019.08.01) 增加代码API注释文档整理代码
@@ -253,6 +603,9 @@
* (2019.07.15) 增加`Size`设置图表尺寸
* (2019.07.14) 增加`二维数据`支持XY轴都可以设置为数值轴
* (2019.07.13) 增加`双坐标轴`支持,代码改动较大
## v0.5.0
* (2019.07.10) 发布`v0.5.0`版本
* (2019.07.09) 增加`AxisLine`配置坐标轴轴线和箭头
* (2019.07.03) 增加`AxisLabel`配置坐标轴`刻度标签`
@@ -272,4 +625,7 @@
* (2019.05.11) 增加自定义`Editor`编辑
* (2019.03.21) 增加`Tooltip`
* (2018.11.01) 增加`Default``Light``Dark`三种默认主题
## v0.1.0
* (2018.09.05) 发布`v0.1.0`版本

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e66d91d4c396b46bf87034c47ca3b43d
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0793c29ff7adb422fb93f9f4e29d5a06
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -6,7 +6,7 @@
## `BaseChart`
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.theme`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
@@ -15,7 +15,10 @@
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测。
* `BaseChart.onCustomDraw`:自定义绘制回调。
* `BaseChart.onCustomDraw`:自定义底部绘制回调。在绘制Serie前调用。
* `BaseChart.onCustomDrawBeforeSerie`自定义Serie绘制回调。在每个Serie绘制完前调用。
* `BaseChart.onCustomDrawAfterSerie`自定义Serie绘制回调。在每个Serie绘制完后调用。
* `BaseChart.onCustomDrawTop`自定义顶部绘制回调。在绘制Tooltip前调用。
* `BaseChart.onPointerClick`:鼠标点击回调。
* `BaseChart.onPointerDown`:鼠标按下回调。
* `BaseChart.onPointerUp`:鼠标弹起回调。
@@ -25,6 +28,7 @@
* `BaseChart.onDrag`:鼠标拖拽回调。
* `BaseChart.onEndDrag`:鼠标结束拖拽回调。
* `BaseChart.onScroll`:鼠标滚动回调。
* `BaseChart.onPointerClickPie`:点击柱条回调。参数:`eventData`, `serieIndex`, `dataIndex`
* `BaseChart.SetSize(float width, float height)` 设置图表的宽高在非stretch pivot下才有效其他情况需要自己调整RectTransform
* `BaseChart.ClearData()`:清除所有数据,系列列表会保留,只是移除列表中系列的数据。
* `BaseChart.RemoveData()`:清除所有系列和图例数据,系列列表也会被清除。
@@ -63,24 +67,30 @@
* `BaseChart.IsInChart(Vector2 local)`:坐标是否在图表范围内。
* `BaseChart.IsInChart(float x, float y)`:坐标是否在图表范围内。
* `BaseChart.EnableBackground(bool flag)`:开启背景组件。背景组件在`chart`受上层布局控制时无法开启。
* `BaseChart.SetBasePainterMaterial(Material material)`设置Base Painter的材质球。
* `BaseChart.SetSeriePainterMaterial(Material material)`设置Serie Painter的材质球。
* `BaseChart.SetTopPainterMaterial(Material material)`设置Top Painter的材质球。
## `CoordinateChart`
* `CoordinateChart.grid`:网格组件 `Grid`
* `CoordinateChart.xAxises`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxises`:左右两个 `Y` 轴组件 `YAxis`
* `CoordinateChart.xAxes`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxes`:左右两个 `Y` 轴组件 `YAxis`
* `CoordianteChart.xAxis0`X轴
* `CoordianteChart.xAxis1`X轴
* `CoordianteChart.xAxis0`Y轴
* `CoordianteChart.yAxis1`Y轴
* `CoordinateChart.dataZoom`:区域缩放组件 `DataZoom`
* `CoordinateChart.coordinateX`:坐标系的左下角坐标 `X`
* `CoordinateChart.coordinateY`:坐标系的左下角坐标 `Y`
* `CoordinateChart.coordinateWidth`:坐标系的宽。
* `CoordinateChart.coordinateHeight`:坐标系的高。
* `CoordinateChart.ClearAxisData()`清除所有x轴和y轴的类目数据。
* `CoordinateChart.AddXAxisData(string category, int xAxisIndex = 0)`:添加一个类目数据到指定的 `X` 轴。
* `CoordinateChart.AddYAxisData(string category, int yAxisIndex = 0)`:添加一个类目数据到指定的 `Y` 轴。
* `CoordinateChart.AddXAxisIcon(Sprite icon, int xAxisIndex = 0)`:添加一个图标到指定的 `X` 轴。
* `CoordinateChart.AddYAxisIcon(Sprite icon, int yAxisIndex = 0)`:添加一个图标到指定的 `Y` 轴。
* `CoordinateChart.UpdateXAxisData(int index, string category, int xAxisIndex = 0)`:更新 `X` 轴的类目数据。
* `CoordinateChart.UpdateYAxisData(int index, string category, int yAxisIndex = 0)`:更新 `Y` 轴的类目数据。
* `CoordinateChart.UpdateXAxisIcon(int index, Sprite icon, int xAxisIndex = 0)`:更新 `X` 轴的图标。
* `CoordinateChart.UpdateYAxisIcon(int index, Sprite icon, int yAxisIndex = 0)`:更新 `Y` 轴的图标。
* `CoordinateChart.IsValue()`:是否是纯数值坐标。
* `CoordinateChart.RefreshDataZoom()`在下一帧刷新DataZoom组件。
* `CoordinateChart.RefreshAxisMinMaxValue()`:立即刷新数值坐标轴的最大最小值(更新坐标轴标签并触发重绘)。
@@ -88,7 +98,7 @@
* `CoordinateChart.IsInCooridate(Vector3 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(float x, float y)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.ClampInCoordinate(Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.ClampInGrid(grid, Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
@@ -103,9 +113,8 @@
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `PieChart`
* `BarChart.onPointerClickBar`:点击柱条回调。参数:`eventData`, `dataIndex`
* 继承自 `BaseChart`
## `RadarChart`

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 81071e0166b9e49958800af4678e69ae
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -23,6 +23,7 @@
* [Serie-Gauge 仪表盘](#Serie-Gauge)
* [Serie-Ring 环形图](#Serie-Ring)
* [Serie-Liquid 水位图](#Serie-Liquid)
* [Serie-Candlestick K线图](#Serie-Candlestick)
* [Settings 设置](#Settings)
* [Theme 主题](#Theme)
* [Tooltip 提示框](#Tooltip)
@@ -44,12 +45,14 @@
* [LineArrow 折线图箭头](#LineArrow)
* [LineStyle 折线图样式](#LineStyle)
* [Location 位置](#Location)
* [MarkLine 标线](#MarkLine)
* [SerieAnimation 动画](#SerieAnimation)
* [SerieData 数据项](#SerieData)
* [SerieLabel 图形上的文本标签](#SerieLabel)
* [SerieSymbol 图形标记](#SerieSymbol)
* [TextLimit 文本自适应](#TextLimit)
* [TextStyle 文本样式](#TextStyle)
* [IconStyle 图标样式](#IconStyle)
## `Theme`
@@ -115,6 +118,14 @@
相关参数:
* `show`:是否显示图例组件。
* `iconType`:图例图标类型。有以下几种类型:
* `Auto`:自动匹配。
* `Custom`:自定义图标。
* `EmptyCircle`:空心圆。
* `Circle`:实心圆。
* `Rect`:正方形。可通过`Setting``legendIconCornerRadius`参数调整圆角。
* `Triangle`:三角形。
* `Diamond`:菱形。
* `selectedMode`:选择模式。控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 `None` 关闭。有以下三种选择方式:
* `Multiple`:多选。
* `Single`:单选。
@@ -165,6 +176,9 @@
* `ceilRate`最大最小值向上取整的倍率。默认为0时自动计算。
* `splitNumber`:分割段数。默认为 `5`
* `isAxisTooltip`是否Tooltip显示轴线上的所有数据。只对Mutiple类型的Radar有效。
* `outRangeColor`:数值超出范围时显示的颜色。
* `connectCenter`:数值是否连线到中心点。
* `lineGradient`:数值线段是否渐变。
* `splitLine`:分割线条 [AxisSplitLine](#AxisSplitLine)。
* `splitArea`:分割区域 [AxisSplitArea](#AxisSplitArea)。
* `indicator`:是否显示指示器。
@@ -176,6 +190,7 @@
* `name`:指示器名称。
* `max`:指示器的最大值,默认为 0 无限制。
* `min`:指示器的最小值,默认为 0 无限制。
* `range`:指示器的正常值范围,当数值超出这个范围时显示`Radar``outRangeColor`颜色。
* `textStyle`:文本样式 [TextStyle](#TextStyle)。
## `TextLimit`
@@ -195,6 +210,9 @@
* `fontSize`:字体大小。
* `fontStyle`:字体风格。
* `lineSpacing`:行间距。
* `alignment`:对齐方式。
* `autoWrap`:是否自动换行。
* `autoAlign`是否让系统自动设置对齐方式。为true时系统自动选择对齐方式为false时用alignment。
## `Tooltip`
@@ -215,6 +233,7 @@
* `{b}`为当前所指示或`index``0``serie`的数据项`serieData``name`,或者类目值(如折线图的`X`轴)。
* `{c}`为当前所指示或`index``0``serie``y`维(`dimesion``1`)的数值。
* `{d}`为当前所指示或`index``0``serie``y`维(`dimesion``1`)百分比值,注意不带`%`号。
* `{e}`为当前所指示或`index``0``serie`的数据项`serieData``name`
* `{.1}`表示指定`index``1``serie`对应颜色的圆点。
* `{a1}``{b1}``{c1}`中的`1`表示指定`index``1``serie`
* `{c1:2}`表示索引为`1``serie`的当前指示数据项的第`3`个数据一个数据项有多个数据index为`2`表示第`3`个数据)。
@@ -231,7 +250,8 @@
* `paddingLeftRight`:文字和边框的左右边距。
* `paddingTopBottom`:文字和边框的上下边距。
* `backgroundImage`:提示框的背景图。
* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息
* `ignoreDataShow``(since v2.0.1)`是否显示忽略数据在`tooltip`上。 [defaut: `false`]
* `ignoreDataDefaultContent`:忽略数据的默认显示字符信息。
* `alwayShow`:是否触发后一直显示。
* `offset``(since v1.5.3)`提示框相对于鼠标位置的偏移。
@@ -249,11 +269,14 @@
* `shapeWidth`:容器的厚度。
* `gap`:间隙。容器和液体的间隙。
* `center`中心点。数组的第一项是横坐标第二项是纵坐标。当值为0-1之间时表示百分比设置成百分比时表示图表宽高最小值的百分比。
* `radius`:半径。
* `smoothness`:开启或关闭缩放区域功能。
* `backgroundColor`:背景色,默认透明。
* `color`:容器颜色。当`autoColor``false`时生效。
* `autoColor`:是否自动颜色。默认`true`。为`true`时颜色会和`serie`一致。
* `radius`:半径。
* `smoothness`:开启或关闭缩放区域功能。
* `width`容器的宽。shape为Rect时有效。
* `height`容器的高。shape为Rect时有效。
* `cornerRadius` 容器的圆角半径。用数组分别指定4个圆角半径顺时针左上右上右下左下。shape为Rect时有效。
## `DataZoom`
@@ -276,16 +299,19 @@
* `showDetail`:是否显示 `detail`,即拖拽时候显示详细数值信息。
* `zoomLock`:是否锁定选择区域(或叫做数据窗口)的大小。如果设置为 `true` 则锁定选择区域的大小,也就是说,只能平移,不能缩放。
* ~~`realtime`:拖动时,是否实时更新系列的视图。如果设置为 `false`,则只在拖拽结束的时候更新。~~
* ~~`backgroundColor`:组件的背景颜色。~~
* `backgroundColor`:组件的背景颜色。
* `selectedAreaColor`:框选区域颜色。
* `bottom`:组件离容器下侧的距离。
* `top`:组件离容器上侧的距离。
* `left`:组件离容器左侧的距离。
* `right`:组件离容器右侧的距离。
* `height`:组件高度。
* `rangeMode`:取值类型是取绝对值还是百分比。
* `Percent`:百分比。
* `start`数据窗口范围的起始百分比。范围是0 ~ 100。
* `end`数据窗口范围的结束百分比。范围是0 ~ 100。
* `scrollSensitivity`:缩放区域组件的敏感度。值越高每次缩放所代表的数据越多。
* `fontSize`:字体大小
* `fontStyle`:字体样式。
* `textStyle`:字体风格
* `minShowNum`最小显示数据个数。当DataZoom放大到最大时最小显示的数据个数。
## `VisualMap`
@@ -351,15 +377,22 @@
## `XAxis`
直角坐标系 `grid` 中的 `X` 轴。单个 `grid` 组件最多只能放上下两个 `X` 轴。两个 `X` 轴存储在 `xAxises` 中。
直角坐标系 `grid` 中的 `X` 轴。单个 `grid` 组件最多只能放上下两个 `X` 轴。两个 `X` 轴存储在 `xAxes` 中。
相关参数:
* `show`:是否显示 `X` 轴。默认 `xAxises[0]``true``xAxises[1]``false`
* `show`:是否显示 `X` 轴。默认 `xAxes[0]``true``xAxes[1]``false`
* `gridIndex`:坐标轴所在的 grid 的索引,默认位于第一个 grid。
* `type`:坐标轴类型。默认为 `Category`。支持以下类型:
* `Value`:数值轴,用于连续数据。
* `Category`:类目轴,适用于离散的类目数据,为该类型时必须通过 `data` 设置类目数据。
* `Log`:对数轴,适用于对数数据。
* `position`坐标轴在Grid中的位置`AxisPosition`。支持以下类型:
* `Left`:左边。
* `Right`:右边。
* `Bottom`:底部。
* `Top`:顶部。
* `offset`坐标轴相对默认位置的偏移。在相同position有多个坐标轴时有用。
* `logBaseE`:对数轴是否以自然数 `e` 为底数,为 `true``logBase` 失效,只在对数轴(`type:'Log'`)中有效。
* `logBase`:对数轴的底数,只在对数轴(`type:'Log'`)中有效。
* `minMaxType`:坐标轴刻度最大最小值显示类型。默认为 `Default`。有以下三种类型:
@@ -374,13 +407,16 @@
* `boundaryGap`:坐标轴两边是否留白。默认为 `true`
* `maxCache`:类目数据中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `inverse`:是否反向坐标轴。只在数值轴`Value`中有效。
* `insertDataToHead`:添加新数据时是在列表的头部还是尾部加入。
* `data`:类目数据,在类目轴(`type: 'Category'`)中有效。
* `icons`:刻度的图标,在类目轴(`type: 'Category'`)中有效。
* `axisLine`:坐标轴轴线相关配置 [AxisLine](#AxisLine)。
* `axisName`:坐标轴名称相关配置 [AxisName](#AxisName)。
* `axisTick`:坐标轴刻度相关配置 [AxisTick](#AxisTick)。
* `axisLabel`:坐标轴刻度标签 [AxisLabel](#AxisLabel)。
* `splitLine`:坐标轴轴线坐标轴分割线 [AxisSplitLine](#SplitLine)。
* `splitArea`:坐标轴轴线坐标轴分割区域 [AxisSplitArea](#AxisSplitArea)。
* `iconStyle`:坐标轴刻度图标的样式 [IconStyle](#IconStyle)。
相关接口:
@@ -407,11 +443,11 @@
## `YAxis`
直角坐标系 `grid` 中的 `Y` 轴。单个 `grid` 组件最多只能放左右两个 `Y` 轴。两个 `Y` 轴存储在 `yAxises` 中。
直角坐标系 `grid` 中的 `Y` 轴。单个 `grid` 组件最多只能放左右两个 `Y` 轴。两个 `Y` 轴存储在 `yAxes` 中。
相关参数:
* `show`:是否显示 `Y` 轴。默认 `yAxises[0]``true``yAxises[1]``false`
* `show`:是否显示 `Y` 轴。默认 `yAxes[0]``true``yAxes[1]``false`
* `type`:坐标轴类型。默认为 `Value`。有以下两种类型:
* `Value`:数值轴,用于连续数据。
* `Category`:类目轴,适用于离散的类目数据,为该类型时必须通过 `data` 设置类目数据。
@@ -508,6 +544,7 @@
* `emphasis`:高亮样式 [Emphasis](#Emphasis)。
* `animation`:起始动画 [SerieAnimation](#SerieAnimation)。
* `lineArrow`:折线图的箭头 [LineArrow](#LineArrow)。
* `insertDataToHead`:添加新数据时是在列表的头部还是尾部加入。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Line`
@@ -518,7 +555,8 @@
* `type``Line`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`:数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`:使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `xAxisIndex`:使用的坐标轴X轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `yAxisIndex`使用的坐标轴Y轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
@@ -564,7 +602,8 @@
* `type``Bar`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`:数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`:使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `xAxisIndex`:使用的坐标轴X轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `yAxisIndex`使用的坐标轴Y轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
@@ -606,6 +645,7 @@
* `space`:扇区间隙。
* `center`:中心点坐标。当值为`0-1`的浮点数时表示百分比。
* `radius`:半径。`radius[0]`为内径,`radius[1]`为外径。当内径大于0时即为圆环图。
* `minAngle`最小的扇区角度0-360。用于防止某个值过小导致扇区太小影响交互。
* `roundCap`:是否启用圆弧效果。
* `ignore`:是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制,对应的`Label``Legend`也不会显示。
* `ignoreValue`忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
@@ -728,10 +768,38 @@
* `animation`:起始动画 [SerieAnimation](#SerieAnimation)。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。水位图的数据一般只有一个,表示当前水位值,用`max`设置最大水位值。
## `Serie-Candlestick`
K线图系列。
* `show`:系列是否显示在图表上。
* `type``Candlestick`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `xAxisIndex`使用的坐标轴X轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `yAxisIndex`使用的坐标轴Y轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `clip`:是否裁剪超出坐标系部分的图形。
* `ignore`:是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。
* `ignoreValue`忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
* `showAsPositiveNumber`:将负数数值显示为正数。一般和`AxisLabel``showAsPositiveNumber`配合使用。仅在折线图和柱状图中有效。
* `large`:是否开启大数据量优化,在数据图形特别多而出现卡顿时候可以开启。开启后配合 largeThreshold 在数据量大于指定阈值的时候对绘制进行优化。缺点优化后不能自定义设置单个数据项的样式不能显示Label折线图不绘制Symbol。
* `largeThreshold`开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
* `itemStyle`:环形图的圆环样式,包括设置背景颜色和边框等 [ItemStyle](#ItemStyle)。
* `emphasis`:高亮样式 [Emphasis](#Emphasis)。
* `animation`:起始动画 [SerieAnimation](#SerieAnimation)。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组K线图至少需要4个维度的数组`[open, close, lowest, highest]`
## `Settings`
全局参数设置组件。一般情况下可使用默认值,当有需要时可进行调整。
* `reversePainter`Painter是否逆序。逆序时index大的serie最先绘制。
* `maxPainter`默认最大Painter数据当Serie数量大于maxPainter时会平均分配Painter。
* `basePainterMaterial`Base Pointer 材质球设置后会影响Axis等。
* `seriePainterMaterial`Serie Pointer 材质球设置后会影响所有Serie。
* `topPainterMaterial`Top Pointer 材质球设置后会影响Tooltip等。
* `lineSmoothStyle`:曲线平滑系数。通过调整平滑系数可以改变曲线的曲率,得到外观稍微有变化的不同曲线。
* `lineSmoothness`:曲线平滑度。值越小曲线越平滑,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。
* `lineSegmentDistance` 线段的分割距离。普通折线图的线是由很多线段组成,段数由该数值决定。值越小段数越多,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。
@@ -747,6 +815,7 @@
* `fadeOutDuration`:设定的渐出动画时长,单位毫秒。如果要设置单个数据项的渐出时长,可以用代码定制:`customFadeOutDuration`
* `dataChangeEnable`:是否开启数据变更动画。
* `dataChangeDuration`:数据变更动画时长,单位毫秒。
* `alongWithLinePath`:是否沿着线的轨迹进行匀速动画。
## `AreaStyle`
@@ -767,16 +836,15 @@
* `show`:是否显示刻度标签。
* `interval`:坐标轴刻度标签的显示间隔,在类目轴中有效。`0`表示显示所有标签,`1`表示隔一个隔显示一个标签,以此类推。
* `inside`:刻度标签是否朝内,默认朝外。
* `rotate`:刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。
* `margin`:刻度标签与轴线之间的距离。
* `color`:刻度标签文字的颜色,默认取主题`Theme``axisTextColor`
* `fontSize`:文字的字体大小。
* `fontStyle`:文字字体的风格。
* `formatter`:图例内容字符串模版格式器。支持用 `\n` 换行。模板变量为图例名称 `{value}`,数值格式化通过`numericFormatter`
* `numericFormatter`:标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式:`A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `showAsPositiveNumber`:将负数数值显示为正数。一般和`Serie``showAsPositiveNumber`配合使用。
* `onZero`:刻度标签显示在`0`刻度上。
* `width`刻度标签的宽。当为0时系统自动设置。
* `height`刻度标签的高。当为0时系统自动设置。
* `textLimit`:文本自适应 [TextLimit](#TextLimit)。只在类目轴中有效。
* `textStyle`:文本样式 [TextStyle](#TextStyle)。
## `AxisLine`
@@ -797,11 +865,7 @@
* `Start`:坐标轴起始处。
* `Middle`:坐标轴中间。
* `End`:坐标轴末端。
* `offset`:坐标轴名称与轴线之间的偏移
* `rotate`:坐标轴名字旋转,角度值。
* `color`:坐标轴名称的文字颜色。
* `fontSize`:坐标轴名称的文字大小。
* `fontStyle`:坐标轴名称的文字风格。
* `textStyle`:显示内容文本样式 [TextStyle](#TextStyle)
## `AxisSplitLine`
@@ -821,6 +885,8 @@
* `inside`:坐标轴刻度是否朝内,默认朝外。
* `length`:坐标轴刻度的长度。
* `width`坐标轴刻度的宽度。默认为0时宽度和坐标轴一致。
* `showStartTick`:是否显示第一个刻度。
* `showEndTick`:是否显示最后一个刻度。
## `Emphasis`
@@ -831,7 +897,8 @@
## `ItemStyle`
* `show`:是否启用。
* `color`:颜色。
* `color`:颜色。对于K线图对应阳线的颜色。
* `color0`颜色。对于K线图对应阴线的颜色。
* `toColor`渐变颜色1。
* `toColor2`渐变颜色2。只在折线图中有效。
* `backgroundColor`:背景颜色。
@@ -839,7 +906,8 @@
* `centerColor`:中心区域的颜色。如环形图的中心区域。
* `centerGap`:中心区域的间隙。如环形图的中心区域于最内环的间隙。
* `borderType`:边框的类型。
* `borderColor`:边框的颜色。
* `borderColor`:边框的颜色。对于K线图对应阳线的边框颜色。
* `borderColor0`边框的颜色。对于K线图对应阴线的边框颜色。
* `borderWidth`:边框宽。
* `opacity`:透明度。
* `tooltipFormatter`:提示框单项的字符串模版格式器。具体配置参考`Tooltip``formatter`
@@ -868,6 +936,8 @@
* `DashDot`:点划线。
* `DashDotDot`:双点划线。
* `color`:线条颜色。默认和 `serie` 一致。
* `toColor`:线的渐变颜色(需要水平方向渐变时)。
* `toColor2`线的渐变颜色2需要水平方向三个渐变色的渐变时
* `width`:线条宽。
* `opacity`:线条的透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
@@ -888,11 +958,33 @@
* `top`:离容器上侧的距离。
* `bottom`:离容器下侧的距离。
## `MarkLine`
* `show`:是否显示标线。
* `animation`:标线的动画样式。
* `data`:标线的数据项[MarkLineData](#MarkLineData)列表。当数据项的group为0时每个数据项表示一条标线当group不为0时相同group的两个数据项分别表示标线的起始点和终止点来组成一条标线此时标线的相关样式参数取起始点的参数。
## `MarkLineData`
* `name`标注名称将会作为文字显示。label的formatter可通过{b}显示名称,通过{c}显示数值。
* `type`:特殊的标注类型,用于标注最大值最小值等。。有以下标注类型:
* `None`:无类型。此时通过
* `Min`:最小值。`dimension`维度上数据的最小值。
* `Max`:最大值。`dimension`维度上数据的最大值。
* `Average`:平均值。`dimension`维度上数据的平均值。
* `Median`:中位数。`dimension`维度上数据的中位数。
* `dimension`当type为特殊类型时指示从哪个维度的数据上计算特殊值。
* `xPosition`:相对原点的 x 坐标单位像素。当type为None时有效。
* `yPosition`:相对原点的 y 坐标单位像素。当type为None时有效。
* `xValue`X轴上的指定值。当X轴为类目轴时指定值表示类目轴数据的索引否则为具体的值。当type为None时有效。
* `yValue`Y轴上的指定值。当Y轴为类目轴时指定值表示类目轴数据的索引否则为具体的值。当type为None时有效。
## `SerieData`
* `name`:数据项名称。
* `selected`:该数据项是否被选中。
* `radius`:自定义半径。可用在饼图中自定义某个数据项的半径。
* `enableIconStyle`: 是否启用单个数据项的图标设置。
* `iconStyle`:数据项图标样式。
* `enableLabel`:是否启用单个数据项的标签设置。
* `label`:单个数据项的标签设置。
@@ -917,15 +1009,10 @@
* `numericFormatter`:标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式:`A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `offset`:距离图形元素的偏移。
* `autoOffset`是否开启自动偏移。当开启时Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
* `color`:自定义文字颜色,默认和系列的颜色一致。
* `backgroundColor`:标签的背景色,默认无颜色。
* `backgroundWidth`:标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
* `backgroundHeight`:标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
* `rotate`:标签的旋转。
* `paddingLeftRight`:标签文字和边框的左右边距。
* `paddingTopBottom`:标签文字和边框的上下边距。
* `fontSize`:标签文字的字体大小。
* `fontStyle`:标签文字的字体风格。
* `line`:是否显示视觉引导线。在 `label` 位置 设置为 `'Outside'` 的时候会显示视觉引导线。
* `lineType`:视觉引导线类型。支持以下几种类型:
* `BrokenLine`:折线。
@@ -938,6 +1025,7 @@
* `border`:是否显示边框。
* `borderWidth`:边框宽度。
* `borderColor`:边框颜色。
* `textStyle`:显示内容文本样式 [TextStyle](#TextStyle)。
## `SerieSymbol`
@@ -967,6 +1055,16 @@
* `interval`:显示图形标记的间隔。`0`表示显示所有标签,`1`表示隔一个隔显示一个标签,以此类推。
* `forceShowLast`:是否强制显示最后一个图形标记。默认为 `false`
## `IconStyle`
* `show`:是否显示图标。
* `layer`:显示在上层还是在下层。
* `sprite`:图标。
* `color`:颜色。
* `width`:图标的宽。
* `height`:图标的高。
* `offset`:位置偏移。
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts问答](XCharts问答.md)

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f74b65f3be5d64689a5db6bdbc91df3e
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -96,11 +96,11 @@
## 锯齿太严重_如何让图表更顺滑
答:开启抗锯齿设置(在`Unity`里设置。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。锯齿只能减少难以避免,像素越高锯齿越不明显。
答:开启抗锯齿设置(在`Unity`里设置。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。
## 为什么鼠标移上图表Tooltip不显示
答:确认`Tooltip`是否开启确认父节点是否关闭了鼠标事件。
答:确认`Tooltip`是否开启确认父节点是否关闭了鼠标事件。
## 如何取消Tooltip的竖线
@@ -136,7 +136,7 @@
## 如何使用背景组件_有什么条件限制
答:设置`background`组件的`show``true`,但不一定就能激活背景组件。由于框架的局限性,背景组件有两个前提条件:一是图表的父节点不能用布局控制,因为背景组件和图表的节点关系是并行的,用了布局控制背景组件的位置就无法控制。二是图表的父节点只能有图表自己一个子节点,这是方便管理背景组件节点的需要,要不然并行关系的原因,容易错乱对不上。另外,调整图表的层级关系时最好先隐藏背景组件,这是会自动删除关联的背景组件节点
答:设置`background`组件的`show``true`
## 区域折线图在用半透明颜色时有时候会一条叠加的线
@@ -152,10 +152,10 @@
## 为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级
1.6.0版本为了减少隐式转换,将所有的绘制相关的`Color`都改为了`Color32`,所以会导致一些自定义的颜色的丢失。影响到的主要组件有:`ItemStyle``LineStyle``AreaStyle``Vessel``VisualMap``AxisSplitArea``AxisSplitLine``GaugeAxis``SerieLabel`等。可以用脚本[UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级。
1.6.0版本为了减少隐式转换,将所有的绘制相关的`Color`都改为了`Color32`,所以会导致一些自定义的颜色的丢失。影响到的主要组件有:`ItemStyle``LineStyle``AreaStyle``Vessel``VisualMap``AxisSplitArea``AxisSplitLine``GaugeAxis``SerieLabel`等。可以用脚本[UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/2.0/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级。
升级步骤如下:
1. 备份好你的项目。
2. 先不升级`XCharts`,只下载或拷贝脚本[UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)放到旧项目的`Editor`由于旧版本可能不存在某些新版本才有的图表或者属性配置可能会编译错误需要处理按34步骤处理一下。
2. 先不升级`XCharts`,只下载或拷贝脚本[UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/2.0/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)放到旧项目的`Editor`由于旧版本可能不存在某些新版本才有的图表或者属性配置可能会编译错误需要处理按34步骤处理一下。
3. 若是由`itemStyle.toColor2`引起的编译报错,可将导出地方的`itemStyle.toColor2`改为`Color.clear`;导入的地方注释掉即可。
4. 若是由`LiquidChart`引起的编译报错,将所有涉及`LiquidChart`的地方都注释掉即可。
5. 编译通过后,通过`菜单栏->XCharts->ExportColorConfig`导出旧版本的颜色配置文件(配置文件默认保存到`Assets`下的`color.config`)。

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9a4780a4fbaf446cc9d948b6b2c803d6
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -6,7 +6,7 @@
## `BaseChart`
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.theme`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
@@ -15,7 +15,10 @@
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测。
* `BaseChart.onCustomDraw`:自定义绘制回调。
* `BaseChart.onCustomDraw`:自定义底部绘制回调。在绘制Serie前调用。
* `BaseChart.onCustomDrawBeforeSerie`自定义Serie绘制回调。在每个Serie绘制完前调用。
* `BaseChart.onCustomDrawAfterSerie`自定义Serie绘制回调。在每个Serie绘制完后调用。
* `BaseChart.onCustomDrawTop`自定义顶部绘制回调。在绘制Tooltip前调用。
* `BaseChart.onPointerClick`:鼠标点击回调。
* `BaseChart.onPointerDown`:鼠标按下回调。
* `BaseChart.onPointerUp`:鼠标弹起回调。
@@ -63,21 +66,20 @@
* `BaseChart.IsInChart(Vector2 local)`:坐标是否在图表范围内。
* `BaseChart.IsInChart(float x, float y)`:坐标是否在图表范围内。
* `BaseChart.EnableBackground(bool flag)`:开启背景组件。背景组件在`chart`受上层布局控制时无法开启。
* `BaseChart.SetBasePainterMaterial(Material material)`设置Base Painter的材质球。
* `BaseChart.SetSeriePainterMaterial(Material material)`设置Serie Painter的材质球。
* `BaseChart.SetTopPainterMaterial(Material material)`设置Top Painter的材质球。
## `CoordinateChart`
* `CoordinateChart.grid`:网格组件 `Grid`
* `CoordinateChart.xAxises`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxises`:左右两个 `Y` 轴组件 `YAxis`
* `CoordinateChart.xAxes`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxes`:左右两个 `Y` 轴组件 `YAxis`
* `CoordianteChart.xAxis0`X轴
* `CoordianteChart.xAxis1`X轴
* `CoordianteChart.xAxis0`Y轴
* `CoordianteChart.yAxis1`Y轴
* `CoordinateChart.dataZoom`:区域缩放组件 `DataZoom`
* `CoordinateChart.coordinateX`:坐标系的左下角坐标 `X`
* `CoordinateChart.coordinateY`:坐标系的左下角坐标 `Y`
* `CoordinateChart.coordinateWidth`:坐标系的宽。
* `CoordinateChart.coordinateHeight`:坐标系的高。
* `CoordinateChart.ClearAxisData()`清除所有x轴和y轴的类目数据。
* `CoordinateChart.AddXAxisData(string category, int xAxisIndex = 0)`:添加一个类目数据到指定的 `X` 轴。
* `CoordinateChart.AddYAxisData(string category, int yAxisIndex = 0)`:添加一个类目数据到指定的 `Y` 轴。
@@ -88,7 +90,7 @@
* `CoordinateChart.IsInCooridate(Vector3 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(float x, float y)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.ClampInCoordinate(Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.ClampInGrid(grid, Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
@@ -103,10 +105,14 @@
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
* `BarChart.onPointerClickBar`:点击柱条回调。参数:`eventData`, `dataIndex`
## `PieChart`
* 继承自 `BaseChart`
* `PieChart.onPointerClickPie`:点击柱条回调。参数:`eventData`, `serieIndex`, `dataIndex`
## `RadarChart`
* 继承自 `BaseChart`

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 529e55126e1d04a629b14d857f76fffd
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -6,7 +6,7 @@
The translation work is still in progress.
Main component:
__Main component:__
* [Axis](#XAxis)
* [Background](#Background)
@@ -25,6 +25,8 @@ Main component:
* [Serie-Gauge](#Serie-Gauge)
* [Serie-Ring](#Serie-Ring)
* [Serie-Liquid](#Serie-Liquid)
* [Serie-Candlestick](#Serie-Candlestick)
* [Serie-Gantt](#Serie-Gantt)
* [Settings](#Settings)
* [Theme](#Theme)
* [Title](#Title)
@@ -32,7 +34,7 @@ Main component:
* [Vessel](#Vessel)
* [VisualMap](#VisualMap)
Sub component:
__Sub component:__
* [AreaStyle](#AreaStyle)
* [AxisLabel](#AxisLabel)
@@ -46,12 +48,14 @@ Sub component:
* [LineArrow](#LineArrow)
* [LineStyle](#LineStyle)
* [Location](#Location)
* [MarkLine](#MarkLine)
* [SerieAnimation](#SerieAnimation)
* [SerieData](#SerieData)
* [SerieLabel](#SerieLabel)
* [SerieSymbol](#SerieSymbol)
* [TextLimit](#TextLimit)
* [TextStyle](#TextStyle)
* [IconStyle](#IconStyle)
## `Theme`
@@ -113,6 +117,14 @@ Legend component.The legend component shows different sets of symbol, colors, an
Parameters:
* `show`: Whether show legend component.
* `iconType`: the legend icon symbol type:
* `Auto` : Auto match.
* `Custom` : Custom icon.
* `EmptyCircle` : hollow circle.
* `Circle` : solid Circle.
* `Rect` : square.
* `Triangle` :
* `Diamond` :
* `selectedMode`: Selected mode of legend, which controls whether series can be toggled displaying by clicking legends:
* `Multiple`: multi-select.
* `Single`: single select.
@@ -128,7 +140,7 @@ Parameters:
* `formatter`: Legend content string template formatter. Support for wrapping lines with `\n`. Template:`{name}`.
* `data`: Data array of legend. An array item is usually a name representing string. (If it is a pie chart, it could also be the name of a single data in the pie chart) of a series. If data is not specified, it will be auto collected from series.
* `icons`: The list of cunstomize icons.
* `textStyle`: The text style of legend content [TextStyle](#TextStyle).
* `textStyle`: The style of text [TextStyle](#TextStyle).
API:
@@ -164,7 +176,10 @@ Radar coordinate conponnet for radar charts.
* `center`: the center of radar chart. The `center[0]` is the x-coordinate, and the `center[1]` is the y-coordinate. When value between 0 and 1 represents a percentage relative to the chart.[default:[0.5f,0.4f]].
* `ceilRate`: The ratio of maximum and minimum values rounded upward. The default is 0, which is automatically calculated.[default:0].
* `splitNumber`: Segments of indicator axis.[default:5].
* `splitNumber`: Tooltip displays all the data on the axis.[default:false].
* `isAxisTooltip`: Tooltip displays all the data on the axis.[default:false].
* `outRangeColor`: The color displayed when data out of range.[default:red]
* `connectCenter`: Whether serie data connect to radar center with line.[default:false]
* `lineGradient`: Whether need gradient for data line..[default:true]
* `splitLine`: The split line style of radar [AxisSplitLine](#AxisSplitLine).
* `splitArea`: The split area style of radar [AxisSplitArea](#AxisSplitArea).
* `indicator`: Whether to show indicator.
@@ -178,6 +193,7 @@ Indicator of radar chart, which is used to assign multiple variables(dimensions)
* `name`: The name of indicator.
* `max`: The maximum value of indicator, with default value of 0, but we recommend to set it manually.
* `min`: The minimum value of indicator, with default value of 0.
* `min`: Normal range. When the value is outside this range, the display color is automatically changed.
* `textStyle`: The text style of indicator [TextStyle](#TextStyle).
## `TextLimit`
@@ -201,6 +217,8 @@ The component of settings related to text.
* `fontSize`: the size of text. [default: `18`].
* `fontStyle`: the font style of text. [default: `FontStyle.Normal`].
* `lineSpacing`: the space of text line. [default: `1f`].
* `autoWrap`: Whether to wrap lines.
* `autoAlign`: Whether to let the system automatically set alignment. If true, the system automatically selects alignment, and if false, use alignment.
## `Tooltip`
@@ -219,6 +237,7 @@ Tooltip component.
* `{b}` is the `name` of the `serieData` that is currently indicated or whose `index` is `0`, or a `category` value (such as the X-axis of a line chart).
* `{c}` is the value of a Y-dimension (`dimesion` is 1) from the `serie` that is currently indicated or whose `index` is `0`.
* `{d}` is the percentage value of Y-dimensions (`dimesion` is 1) from the `serie` that is currently indicated or whose `index` is `0`, with no `%` sign.
* `{e}` is the `name` of the `serieData` that is currently indicated or whose `index` is `0`.
* `{.1}` represents a dot from serie corresponding color that specifies `index` as `1`.
* `1` in `{a1}`, `{b1}`, `{c1}` represents a `serie` that specifies an `index` of `1`.
* `{c1:2}` represents the third data from `serie`'s current indication data item indexed to `1` (a data item has multiple data, `index` 2 represents the third data).
@@ -227,7 +246,7 @@ Tooltip component.
* Example: `"{a}, {c}"`, `"{a1}, {c1: f1}"`, `"{a1}, {c1:0: f1}"`, `"{a1} : {c1:1-1: f1}"`
* `titleFormatter`: The string template formatter for the tooltip title content. Support for wrapping lines with `\n`. This is only valid if the `itemFormatter` is in effect. The placeholder `{I}` can be set separately to indicate that the title is ignored and not displayed.
* `itemFormatter`: a string template formatter for a single Serie or data item content. Support for wrapping lines with `\n`. When `formatter` is not null, use `formatter` first, otherwise use `itemFormatter`.
* `numericFormatter`: Standard numeric format string. Used to format numeric values to display as strings. Using 'Axx' form: 'A' is the single character of the format specifier, supporting 'C' currency, 'D' decimal, 'E' exponent, 'F' number of vertices, 'G' regular, 'N' digits, 'P' percentage, 'R' round tripping, 'X' hex etc. 'XX' is the precision specification, from '0' - '99'. see: <https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings>
* `numericFormatter`: Standard numeric format string. Used to format numeric values to display as strings. Using `Axx` form: `A` is the single character of the format specifier, supporting `C` currency, `D` decimal, `E` exponent, `F` number of vertices, `G` regular, `N` digits, `P` percentage, `R` round tripping, `X` hex etc. `XX` is the precision specification, from `0` - `99`. see: <https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-strings>
* `fixedWidth`: Fixed width. Higher priority than `minWidth`.
* `fixedHeight`: Fixed height. Higher priority than `minHeight`.
* `minWidth`: Minimum width. If `fixedWidth` has a value, get `fixedWidth` first.
@@ -235,6 +254,7 @@ Tooltip component.
* `paddingLeftRight`: the text padding of left and right. [defaut: `5f`].
* `paddingTopBottom`: the text padding of top and bottom. [defaut: `5f`].
* `backgroundImage`: The image of icon.
* `ignoreDataShow`: Whether to show ignored data on tooltip. [defaut: `false`].
* `ignoreDataDefaultContent`: The default display character information for ignored data.
* `alwayShow`: Whether to trigger after always display.
* `offset`: `(since v1.5.3)`The position offset of tooltip relative to the mouse position.
@@ -255,11 +275,14 @@ Vessel component for liquid chart. There can be multiple vessels in a Chart, whi
* `backgroundColor`: Background color of polar, which is transparent by default. [default: `Color.clear`]
* `color`: Vessel color. The default is consistent with Serie. [default: `Color32(70, 70, 240, 255)`]
* `autoColor`: Whether automatic color. If true, the color matches serie. [default: `true`]
* `width`The width of vessel. This value is valid when `shape` is `Rect`.
* `height`The height of vessel. This value is valid when `shape` is `Rect`.
* `cornerRadius` The radius of rounded corner. This value is valid when `shape` is `Rect`.
## `DataZoom`
DataZoom component is used for zooming a specific area, which enables user to investigate data in detail, or get an overview of the data, or get rid of outlier points.
Currently only the control 'X' axis is supported.
Currently only the control `X` axis is supported.
* `enable`: Whether to show dataZoom.
* `supportInside`: Whether built-in support is supported. Built into the coordinate system to allow the user to zoom in and out of the coordinate system by mouse dragging, mouse wheel, finger swiping (on the touch screen).
@@ -275,16 +298,19 @@ Currently only the control 'X' axis is supported.
* `showDetail`: Whether to show detail, that is, show the detailed data information when dragging. [default: `false`]
* `zoomLock`: Specify whether to lock the size of window (selected area). [default: `false`]
* ~~`realtime`: Whether to show data shadow in dataZoom-silder component, to indicate the data tendency in brief. [default: `true`]~~
* ~~`backgroundColor`: The background color of the component.~~
* `bottom`: Distance between dataZoom component and the bottom side of the container. bottom value is a instant pixel value like 10. [default: `10f`]
* `backgroundColor`: The background color of the component.
* `selectedAreaColor`: The color of the selected area.
* `bottom`: Distance between dataZoom component and the bottom side of the container. [default: `10f`]
* `top`: Distance between dataZoom component and the top side of the container. [default: `0`]
* `left`: Distance between dataZoom component and the left side of the container. [default: `0`]
* `right`: Distance between dataZoom component and the right side of the container. [default: `0`]
* `height`: The height of dataZoom component. height value is a instant pixel value like 10. [default: `50f`]
* `rangeMode`: Use absolute value or percent value in `DataZoom.start` and `DataZoom.end`. [default: `RangeMode.Percent`].
* `Percent`: percent.
* `start`: The start percentage of the window out of the data extent, in the range of `0 ~ 100`. [default: `30f`]
* `end`: The end percentage of the window out of the data extent, in the range of 0 ~ 100. [default: `70f`]
* `scrollSensitivity`: The sensitivity of dataZoom scroll. The larger the number, the more sensitive it is. [default: `10f`]
* `fontSize`: font size of datazoom label.
* `fontStyle`: font style of datazoom label.
* `textStyle`: style of datazoom label.
* `minShowNum`: Minimum number of display data. Minimum number of data displayed when DataZoom is enlarged to maximum. [default: `1`]
## `VisualMap`
@@ -304,7 +330,7 @@ VisualMap component. mapping data to visual elements such as colors.
* `min`: The minimum allowed. `min` must be user specified. `[min, max]` forms the domain of the visualMap.
* `max`: The maximum allowed. `max` must be user specified. `[min, max]` forms the domain of the visualMap.
* `range`: Specifies the position of the numeric value corresponding to the handle. Range should be within the range of [min,max].
* ~~`text`: Text on both ends. such as ['High', 'Low'].~~
* ~~`text`: Text on both ends. such as [`High`, `Low`].~~
* ~~`textGap`: The distance between the two text bodies.~~
* `splitNumber`: For continuous data, it is automatically evenly divided into several segments and automatically matches the size of inRange color list when the default is 0.
* `calculable`: Whether the handle used for dragging is displayed (the handle can be dragged to adjust the selected range).
@@ -352,11 +378,18 @@ GaugePointer sub component. Settings related to gauge pointer.
The x axis in cartesian(rectangular) coordinate. a grid component can place at most 2 x axis, one on the bottom and another on the top.
* `show`: Whether to show axis. By default `xAxises[0]` is `true` and `xAxises[1]` is `false`.
* `show`: Whether to show axis. By default `xAxes[0]` is `true` and `xAxes[1]` is `false`.
* `gridIndex`: The index of the grid on which the axis are located, by default, is in the first grid.
* `type`: the type of axis. The default is `Category`.
* `Value`: Numerical axis for continuous data.
* `Category`: Category axis, applicable to discrete category data, category data must be set through `data` for this type.
* `Log`: Log axis, it applies to logarithmic data.
* `position`: the position of axis in grid.
* `Left`: left of grid.
* `Right`: right of grid.
* `Bottom`: bottom of grid.
* `Top`: top of grid.
* `offset`: the offset of axis from the default position. Useful when the same position has multiple axes.
* `logBaseE`: On the log axis, if base e is the natural number, and is true, logBase fails.
* `logBase`: Base of logarithm, which is valid only for numeric axes with type: `Log`.
* `minMaxType`: the type of axis minmax.The default is `Default`.
@@ -371,13 +404,16 @@ The x axis in cartesian(rectangular) coordinate. a grid component can place at m
* `boundaryGap`: The boundary gap on both sides of a coordinate axis.
* `maxCache`: The max number of axis data cache. The first data will be remove when the size of axis data is larger then `maxCache`.
* `inverse`: Whether the axis are reversed or not. Invalid in `Category` axis.
* `insertDataToHead`: Whether to add new data at the head or at the end of the list.
* `data`: Category data, valid in the `Category` axis.
* `icons`: icon list.
* `axisLine`: the style of axis line [AxisLine](#AxisLine).
* `axisName`: the style of axis name [AxisName](#AxisName).
* `axisTick`: the style of axis tick [AxisTick](#AxisTick).
* `axisLabel`: the style of axis label [AxisLabel](#AxisLabel).
* `splitLine`: the style of axis split line [AxisSplitLine](#SplitLine).
* `splitArea`: the style of axis split area [AxisSplitArea](#AxisSplitArea).
* `iconStyle`: the style of the axis scale icon [IconStyle](#IconStyle).
## `Background`
@@ -411,7 +447,8 @@ Line chart serie.
* `type`: `Line`.
* `name`: Series name used for displaying in tooltip and filtering with legend.
* `stack`: If stack the value. On the same category axis, the series with the same stack name would be put on top of each other.
* `axisIndex`: Index of axis to combine with, which is useful for multiple x axes in one chart.
* `xAxisIndex`: Index of x axis to combine with, which is useful for multiple axes in one chart.
* `yAxisIndex`: Index of y axis to combine with, which is useful for multiple axes in one chart.
* `minShow`: The min number of data to show in chart.
* `maxShow`: The max number of data to show in chart.
* `maxCache`: The max number of serie data cache. The first data will be remove when the size of serie data is larger then maxCache.
@@ -431,7 +468,7 @@ Line chart serie.
* `largeThreshold`: 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
* `areaStyle`: 区域填充样式 [AreaStyle](#AreaStyle)。
* `symbol`: 标记的图形 [SerieSymbol](#SerieSymbol)。
* `lineType`: 折线图样式类型。支持以下十种类型:
* `lineType`: 折线图样式类型。支持以下十种类型:
* `Normal`: 普通折线图。
* `Smooth`: 平滑曲线。
* `SmoothDash`: 平滑虚线。
@@ -447,6 +484,7 @@ Line chart serie.
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `lineArrow`: 折线图的箭头 [LineArrow](#LineArrow)。
* `insertDataToHead`: Whether to add new data at the head or at the end of the list.
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Bar`
@@ -457,7 +495,8 @@ Line chart serie.
* `type`: `Bar`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`: 数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`: 使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴轴的时候有用。
* `xAxisIndex`: Index of x axis to combine with, which is useful for multiple axes in one chart.
* `yAxisIndex`: Index of y axis to combine with, which is useful for multiple axes in one chart.
* `minShow`: 系列显示数据的最小索引。
* `maxShow`: 系列显示数据的最大索引。
* `maxCache`: 系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
@@ -492,13 +531,14 @@ Line chart serie.
* `show`: 系列是否显示在图表上。
* `type`: `Pie`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `pieRoseType`: 南丁格尔玫瑰图类型,支持以下类型:
* `pieRoseType`: 南丁格尔玫瑰图类型,支持以下类型:
* `None`: 不展示成南丁格尔玫瑰图。
* `Radius`: 扇区圆心角展现数据的百分比,半径展现数据的大小。
* `Area`: 所有扇区圆心角相同,仅通过半径展现数据大小。
* `space`: 扇区间隙。
* `center`: 中心点坐标。当值为`0-1`的浮点数时表示百分比。
* `radius`: 半径。`radius[0]`为内径,`radius[1]`为外径。当内径大于0时即为圆环图。
* `minAngle`: The minimum angle of sector(0-360). It prevents some sector from being too small when value is small.
* `roundCap`: 是否启用圆弧效果。
* `ignore`: 是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制,对应的`Label``Legend`也不会显示。
* `ignoreValue`: 忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
@@ -562,7 +602,7 @@ Line chart serie.
* `show`: 系列是否显示在图表上。
* `type`: `Gauge`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `gaugeType`: 仪表盘类型,支持以下类型:
* `gaugeType`: 仪表盘类型,支持以下类型:
* `Pointer`: 指针类型。
* `ProgressBar`: 进度条类型。
* `center`: 中心点坐标。当值为0-1的浮点数时表示百分比。
@@ -621,10 +661,38 @@ Line chart serie.
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。水位图的数据一般只有一个,表示当前水位值,用`max`设置最大水位值。
## `Serie-Candlestick`
K线图系列。
* `show`:系列是否显示在图表上。
* `type``Candlestick`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `xAxisIndex`使用的坐标轴X轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `yAxisIndex`使用的坐标轴Y轴的 `index`,在单个图表实例中存在多个坐标轴的时候有用。
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `clip`:是否裁剪超出坐标系部分的图形。
* `ignore`:是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。
* `ignoreValue`忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
* `showAsPositiveNumber`:将负数数值显示为正数。一般和`AxisLabel``showAsPositiveNumber`配合使用。仅在折线图和柱状图中有效。
* `large`:是否开启大数据量优化,在数据图形特别多而出现卡顿时候可以开启。开启后配合 largeThreshold 在数据量大于指定阈值的时候对绘制进行优化。缺点优化后不能自定义设置单个数据项的样式不能显示Label折线图不绘制Symbol。
* `largeThreshold`开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
* `itemStyle`:环形图的圆环样式,包括设置背景颜色和边框等 [ItemStyle](#ItemStyle)。
* `emphasis`:高亮样式 [Emphasis](#Emphasis)。
* `animation`:起始动画 [SerieAnimation](#SerieAnimation)。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组K线图至少需要4个维度的数组`[open, close, lowest, highest]`
## `Settings`
全局参数设置组件。一般情况下可使用默认值,当有需要时可进行调整。
* `reversePainter`Painter是否逆序。逆序时index大的serie最先绘制。
* `maxPainter`默认最大Painter数据当Serie数量大于maxPainter时会平均分配Painter。
* `basePainterMaterial`Base Pointer 材质球设置后会影响Axis等。
* `seriePainterMaterial`Serie Pointer 材质球设置后会影响所有Serie。
* `topPainterMaterial`Top Pointer 材质球设置后会影响Tooltip等。
* `lineSmoothStyle`: 曲线平滑系数。通过调整平滑系数可以改变曲线的曲率,得到外观稍微有变化的不同曲线。
* `lineSmoothness`: 曲线平滑度。值越小曲线越平滑,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。
* `lineSegmentDistance`: 线段的分割距离。普通折线图的线是由很多线段组成,段数由该数值决定。值越小段数越多,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。
@@ -644,7 +712,7 @@ Line chart serie.
## `AreaStyle`
* `show`: 是否显示区域填充。
* `origin`: 区域填充的起始位置 `AreaOrigin`。有以下三种填充方式:
* `origin`: 区域填充的起始位置 `AreaOrigin`。有以下三种填充方式:
* `Auto`: 填充坐标轴轴线到数据间的区域。
* `Start`: 填充坐标轴底部到数据间的区域。
* `End`: 填充坐标轴顶部到数据间的区域。
@@ -660,16 +728,16 @@ Line chart serie.
* `show`: 是否显示刻度标签。
* `interval`: 坐标轴刻度标签的显示间隔,在类目轴中有效。`0`表示显示所有标签,`1`表示隔一个隔显示一个标签,以此类推。
* `inside`: 刻度标签是否朝内,默认朝外。
* `rotate`: 刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。
* `margin`: 刻度标签与轴线之间的距离。
* `color`: 刻度标签文字的颜色,默认取主题`Theme``axisTextColor`
* `fontSize`: 文字的字体大小。
* `fontStyle`: 文字字体的风格。
* `formatter`: 图例内容字符串模版格式器。支持用 `\n` 换行。模板变量为图例名称 `{value}`,数值格式化通过`numericFormatter`
* `numericFormatter`: 标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式: `A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `showAsPositiveNumber`: 将负数数值显示为正数。一般和`Serie``showAsPositiveNumber`配合使用。
* `onZero`: 刻度标签显示在`0`刻度上。
* `width`刻度标签的宽。当为0时系统自动设置。
* `height`刻度标签的高。当为0时系统自动设置。
* `textLimit`: 文本自适应 [TextLimit](#TextLimit)。只在类目轴中有效。
* `textStyle`: The style of text [TextStyle](#TextStyle).
## `AxisLine`
@@ -686,15 +754,11 @@ Line chart serie.
* `show`: 是否显示坐标名称。
* `name`: 坐标轴名称。
* `location`: 坐标轴名称的位置。支持以下类型:
* `location`: 坐标轴名称的位置。支持以下类型:
* `Start`: 坐标轴起始处。
* `Middle`: 坐标轴中间。
* `End`: 坐标轴末端。
* `offset`: 坐标轴名称与轴线之间的偏移。
* `rotate`: 坐标轴名字旋转,角度值。
* `color`: 坐标轴名称的文字颜色。
* `fontSize`: 坐标轴名称的文字大小。
* `fontStyle`: 坐标轴名称的文字风格。
* `textStyle`: The style of text [TextStyle](#TextStyle).
## `AxisSplitLine`
@@ -714,6 +778,8 @@ Line chart serie.
* `inside`: 坐标轴刻度是否朝内,默认朝外。
* `length`: 坐标轴刻度的长度。
* `width`: 坐标轴刻度的宽度。默认为0时宽度和坐标轴一致。
* `showStartTick`:是否显示第一个刻度。
* `showEndTick`:是否显示最后一个刻度。
## `Emphasis`
@@ -724,15 +790,17 @@ Line chart serie.
## `ItemStyle`
* `show`: 是否启用。
* `color`: 颜色。
* `toColor`gradient color1.
* `toColor2`gradient color2.
* `color`: 颜色。对于K线图对应阳线的颜色。
* `color0`: 颜色。对于K线图对应阴线的颜色。
* `toColor`: 渐变颜色1。
* `toColor2`: 渐变颜色2。只在折线图中有效。
* `backgroundColor`: 背景颜色。
* `backgroundWidth`: 背景的宽。
* `centerColor`: 中心区域的颜色。如环形图的中心区域。
* `centerGap`: 中心区域的间隙。如环形图的中心区域于最内环的间隙。
* `borderType`: 边框的类型。
* `borderColor`: 边框的颜色。
* `borderColor`: 边框的颜色。对于K线图对应阳线的边框颜色。
* `borderColor0`: 边框的颜色。对于K线图对应阴线的边框颜色。
* `borderWidth`: 边框宽。
* `opacity`: 透明度。
* `tooltipFormatter`: 提示框单项的字符串模版格式器。具体配置参考`Tooltip``formatter`
@@ -742,7 +810,7 @@ Line chart serie.
## `LineArrow`
* `show`: 是否显示箭头。
* `position`: 箭头显示位置。支持以下两种位置:
* `position`: 箭头显示位置。支持以下两种位置:
* `End`: 末端显示。最后一个数据上显示箭头。
* `Start`: 起始端显示。第一个数据上显示箭头。
* `width`: 箭头宽。
@@ -761,6 +829,8 @@ Line chart serie.
* `DashDot`: 点划线。
* `DashDotDot`: 双点划线。
* `color`: 线条颜色。默认和 `serie` 一致。
* `toColor`: 线的渐变颜色(需要水平方向渐变时)。
* `toColor2`: 线的渐变颜色2需要水平方向三个渐变色的渐变时
* `width`: 线条宽。
* `opacity`: 线条的透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
@@ -781,11 +851,33 @@ Line chart serie.
* `top`: 离容器上侧的距离。
* `bottom`: 离容器下侧的距离。
## `MarkLine`
* `show`:是否显示标线。
* `animation`:标线的动画样式。
* `data`:标线的数据项[MarkLineData](#MarkLineData)列表。当数据项的group为0时每个数据项表示一条标线当group不为0时相同group的两个数据项分别表示标线的起始点和终止点来组成一条标线此时标线的相关样式参数取起始点的参数。
## `MarkLineData`
* `name`标注名称将会作为文字显示。label的formatter可通过{b}显示名称,通过{c}显示数值。
* `type`:特殊的标注类型,用于标注最大值最小值等。。有以下标注类型:
* `None`:无类型。此时通过
* `Min`:最小值。`dimension`维度上数据的最小值。
* `Max`:最大值。`dimension`维度上数据的最大值。
* `Average`:平均值。`dimension`维度上数据的平均值。
* `Median`:中位数。`dimension`维度上数据的中位数。
* `dimension`当type为特殊类型时指示从哪个维度的数据上计算特殊值。
* `xPosition`:相对原点的 x 坐标单位像素。当type为None时有效。
* `yPosition`:相对原点的 y 坐标单位像素。当type为None时有效。
* `xValue`X轴上的指定值。当X轴为类目轴时指定值表示类目轴数据的索引否则为具体的值。当type为None时有效。
* `yValue`Y轴上的指定值。当Y轴为类目轴时指定值表示类目轴数据的索引否则为具体的值。当type为None时有效。
## `SerieData`
* `name`: 数据项名称。
* `selected`: 该数据项是否被选中。
* `radius`: 自定义半径。可用在饼图中自定义某个数据项的半径。
* `enableIconStyle`: 是否启用单个数据项的图标设置。
* `iconStyle`: 数据项图标样式。
* `enableLabel`: 是否启用单个数据项的标签设置。
* `label`: 单个数据项的标签设置。
@@ -800,7 +892,7 @@ Line chart serie.
## `SerieLabel`
* `show`: 是否显示文本标签。
* `position`: 标签的位置。折线图时强制默认为 `Center`,支持以下 `5` 种位置:
* `position`: 标签的位置。折线图时强制默认为 `Center`,支持以下 `5` 种位置:
* `Outside`: 饼图扇区外侧,通过视觉引导线连到相应的扇区。只在饼图种可用。
* `Inside`: 饼图扇区内部。只在饼图可用。
* `Center`: 在中心位置(折线图,柱状图,饼图)。
@@ -810,17 +902,12 @@ Line chart serie.
* `numericFormatter`: 标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式: `A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `offset`: 距离图形元素的偏移。
* `autoOffset`: 是否开启自动偏移。当开启时Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
* `color`: 自定义文字颜色,默认和系列的颜色一致。
* `backgroundColor`: 标签的背景色,默认无颜色。
* `backgroundWidth`: 标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
* `backgroundHeight`: 标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
* `rotate`: 标签的旋转。
* `paddingLeftRight`: 标签文字和边框的左右边距。
* `paddingTopBottom`: 标签文字和边框的上下边距。
* `fontSize`: 标签文字的字体大小。
* `fontStyle`: 标签文字的字体风格。
* `line`: 是否显示视觉引导线。在 `label` 位置 设置为 `'Outside'` 的时候会显示视觉引导线。
* `lineType`: 视觉引导线类型。支持以下几种类型:
* `lineType`: 视觉引导线类型。支持以下几种类型:
* `BrokenLine`: 折线。
* `Curves`: 曲线。
* `HorizontalLine`: 水平线。
@@ -831,6 +918,7 @@ Line chart serie.
* `border`: 是否显示边框。
* `borderWidth`: 边框宽度。
* `borderColor`: 边框颜色。
* `textStyle`: The style of text [TextStyle](#TextStyle).
## `SerieSymbol`
@@ -860,6 +948,16 @@ Line chart serie.
* `interval`: 显示图形标记的间隔。`0`表示显示所有标签,`1`表示隔一个隔显示一个标签,以此类推。
* `forceShowLast`: 是否强制显示最后一个图形标记。默认为 `false`
## `IconStyle`
* `show` : whether to show the icon.
* `Layer` : Shows on top or bottom.
* `Sprite` : Icon.
* `color` : color.
* `width` : The width of the icon.
* `height` : the height of the icon.
* `Offset` : Offset.
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts问答](XCharts问答.md)

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3fa7a80a30cd846139159beaadba05f2
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -136,7 +136,7 @@ A: See `Example_Dynamic.cs`.
## How-do-I-use-the-background-component-What-are-the-conditions
A: Setting `show` to `true` for the `background` component does not necessarily activate the background component. Due to the limitations of the XCharts's framework, there are two prerequisites for the background component: first, the parent node of the chart cannot be controlled by layout, because the node relationship between the background component and the chart is parallel, and the location of the background component cannot be controlled by layout. Second, the parent node of the chart can only have one child node of the chart itself, which is convenient to manage the background component node needs, otherwise the reason of parallel relationship, easy to confuse. In addition, it is best to hide the `background` component when adjusting the chart hierarchy, which automatically removes the associated background component nodes.
A: Setting `show` to `true` for the `background` component.
## Mesh-cannot-have-more-than-65000-vertices
@@ -148,10 +148,10 @@ A: Check whether `RemoveData()` and add new `Serie` in the code. If you want to
## 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/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) to 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/monitor1394/unity-ugui-XCharts/blob/2.0/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/monitor1394/unity-ugui-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).
2. Download or copy the script [UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/2.0/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).

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ca54a17a3a60f4b36b0be43df9f1c33d
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 98b750952a34c427693ac70f09008bae
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -19,13 +19,14 @@ namespace XCharts
protected override void OnEnable()
{
base.OnEnable();
m_Target = (BarChart)target;
if(target == null) return;
m_Chart = (BarChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
if (m_Target == null && target == null)
if (m_Chart == null && target == null)
{
return;
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 0c7ad8674f7b24e82a92138976f5e969
guid: 5acea6fd06c0e9c498c434f941e4cba9
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,10 +1,11 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using System.Text;
@@ -14,22 +15,36 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI BaseChart.
/// </summary>
[CustomEditor(typeof(BaseChart), false)]
public class BaseChartEditor : Editor
{
protected BaseChart m_Target;
#if UNITY_2019_3_OR_NEWER
private const float k_IconWidth = 14;
private const float k_IconGap = 0f;
private const float k_IconXOffset = 10f;
private const float k_IconYOffset = -1.5f;
#else
private const float k_IconWidth = 14;
private const float k_IconGap = 0f;
private const float k_IconXOffset = 4f;
private const float k_IconYOffset = -3f;
#endif
protected BaseChart m_Chart;
protected SerializedProperty m_Script;
protected SerializedProperty m_MultiComponentMode;
protected SerializedProperty m_EnableTextMeshPro;
protected SerializedProperty m_ChartWidth;
protected SerializedProperty m_ChartHeight;
protected SerializedProperty m_Theme;
protected SerializedProperty m_ThemeInfo;
protected SerializedProperty m_Background;
protected SerializedProperty m_Title;
protected SerializedProperty m_Legend;
protected SerializedProperty m_Tooltip;
protected SerializedProperty m_Series;
protected SerializedProperty m_Settings;
protected SerializedProperty m_Theme;
protected SerializedProperty m_Background;
protected SerializedProperty m_Titles;
protected SerializedProperty m_Legends;
protected SerializedProperty m_Tooltips;
protected SerializedProperty m_Vessels;
protected SerializedProperty m_Radars;
protected SerializedProperty m_Series;
protected SerializedProperty m_Large;
protected SerializedProperty m_ChartName;
protected SerializedProperty m_DebugMode;
@@ -41,29 +56,38 @@ namespace XCharts
private bool m_CheckWarning = false;
private StringBuilder sb = new StringBuilder();
private bool m_BaseFoldout;
private bool m_CustomFoldout;
protected bool m_ShowAllComponent;
protected Dictionary<string, bool> m_Flodouts = new Dictionary<string, bool>();
protected virtual void OnEnable()
{
m_Target = (BaseChart)target;
if (target == null) return;
m_Chart = (BaseChart)target;
m_Script = serializedObject.FindProperty("m_Script");
m_MultiComponentMode = serializedObject.FindProperty("m_MultiComponentMode");
m_EnableTextMeshPro = serializedObject.FindProperty("m_EnableTextMeshPro");
m_ChartName = serializedObject.FindProperty("m_ChartName");
m_ChartWidth = serializedObject.FindProperty("m_ChartWidth");
m_ChartHeight = serializedObject.FindProperty("m_ChartHeight");
m_Theme = serializedObject.FindProperty("m_Theme");
m_ThemeInfo = serializedObject.FindProperty("m_ThemeInfo");
m_Settings = serializedObject.FindProperty("m_Settings");
m_Background = serializedObject.FindProperty("m_Background");
m_Title = serializedObject.FindProperty("m_Title");
m_Legend = serializedObject.FindProperty("m_Legend");
m_Tooltip = serializedObject.FindProperty("m_Tooltip");
m_Titles = serializedObject.FindProperty("m_Titles");
m_Legends = serializedObject.FindProperty("m_Legends");
m_Tooltips = serializedObject.FindProperty("m_Tooltips");
m_Vessels = serializedObject.FindProperty("m_Vessels");
m_Series = serializedObject.FindProperty("m_Series");
m_Radars = serializedObject.FindProperty("m_Radars");
m_Large = serializedObject.FindProperty("m_Large");
m_Settings = serializedObject.FindProperty("m_Settings");
m_DebugMode = serializedObject.FindProperty("m_DebugMode");
}
public override void OnInspectorGUI()
{
if (m_Target == null && target == null)
if (m_Chart == null && target == null)
{
base.OnInspectorGUI();
return;
@@ -75,58 +99,214 @@ namespace XCharts
OnStartInspectorGUI();
OnMiddleInspectorGUI();
OnEndInspectorGUI();
OnDebugInspectorGUI();
CheckWarning();
EditorGUILayout.Space();
serializedObject.ApplyModifiedProperties();
}
protected virtual void OnStartInspectorGUI()
{
EditorGUILayout.PropertyField(m_Script);
EditorGUILayout.PropertyField(m_ChartName);
EditorGUILayout.PropertyField(m_ThemeInfo, true);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_Background, true);
var m_Show = m_Background.FindPropertyRelative("m_Show");
if (m_Show.boolValue && !m_Target.CanShowBackgroundComponent())
BlockStart();
EditorGUILayout.BeginHorizontal();
var version = string.Format("v{0}_{1}", XChartsMgr.version, XChartsMgr.versionDate);
if (m_EnableTextMeshPro.boolValue)
{
var msg = "The background component cannot be activated because chart is controlled by LayoutGroup,"
+ " or its parent have more than one child.";
EditorGUILayout.HelpBox(msg, MessageType.Error);
version += " TMP";
}
EditorGUILayout.PropertyField(m_Title, true);
EditorGUILayout.PropertyField(m_Legend, true);
EditorGUILayout.PropertyField(m_Tooltip, true);
EditorGUILayout.LabelField(version);
if (GUILayout.Button("Github"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts");
}
EditorGUILayout.EndHorizontal();
BlockEnd();
BlockStart();
m_BaseFoldout = EditorGUILayout.Foldout(m_BaseFoldout, "Base", true);
if (m_BaseFoldout)
{
EditorGUILayout.PropertyField(m_Script);
EditorGUILayout.PropertyField(m_ChartName);
var fileds = m_Chart.GetCustomChartInspectorShowFileds();
if (fileds != null && fileds.Length > 0)
{
foreach (var filed in fileds)
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(filed));
}
}
if (XChartsMgr.Instance.IsRepeatChartName(m_Chart, m_ChartName.stringValue))
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.HelpBox("chart name is repeated:" + m_ChartName.stringValue, MessageType.Error);
EditorGUILayout.EndHorizontal();
}
}
BlockEnd();
BlockField(m_Theme);
BlockField(m_Settings);
BlockField(m_Background);
m_ShowAllComponent = m_MultiComponentMode.boolValue;
BlockListField(m_ShowAllComponent, m_Titles);
BlockListField(m_ShowAllComponent, m_Legends);
BlockListField(m_ShowAllComponent, m_Tooltips);
BlockListField(m_ShowAllComponent, SerieType.Liquid, m_Vessels);
BlockListField(m_ShowAllComponent, SerieType.Radar, m_Radars);
}
protected virtual void OnMiddleInspectorGUI()
{
EditorGUILayout.PropertyField(m_Series, true);
EditorGUILayout.PropertyField(m_Settings, true);
BlockField(m_Series);
}
protected virtual void OnEndInspectorGUI()
{
EditorGUILayout.Space();
EditorGUILayout.Space();
}
protected virtual void OnDebugInspectorGUI()
{
BlockStart();
EditorGUILayout.PropertyField(m_DebugMode);
EditorGUILayout.PropertyField(m_MultiComponentMode);
EditorGUILayout.Space();
EditorGUILayout.Space();
MoreDebugInspector();
CheckWarning();
BlockEnd();
}
protected virtual void MoreDebugInspector()
{
}
protected void BlockStart()
{
if (XChartsSettings.editorBlockEnable) EditorGUILayout.BeginVertical(EditorStyles.helpBox);
}
protected void BlockEnd()
{
if (XChartsSettings.editorBlockEnable) EditorGUILayout.EndVertical();
}
protected void BlockField(params SerializedProperty[] props)
{
if (props.Length == 0) return;
BlockStart();
foreach (var prop in props)
EditorGUILayout.PropertyField(prop, true);
BlockEnd();
}
protected void BlockListField(bool all, params SerializedProperty[] props)
{
if (props.Length == 0) return;
BlockStart();
foreach (var prop in props)
{
if (all)
{
var flag = m_Flodouts.ContainsKey(prop.displayName) && m_Flodouts[prop.displayName];
m_Flodouts[prop.displayName] = EditorGUILayout.Foldout(flag, prop.displayName, true);
if (m_Flodouts[prop.displayName])
{
EditorGUI.indentLevel++;
var currRect = EditorGUILayout.GetControlRect(GUILayout.Height(0));
currRect.y -= EditorGUIUtility.singleLineHeight;
var rect1 = new Rect(currRect.width + k_IconXOffset,
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect1, ChartEditorHelper.Styles.iconAdd, ChartEditorHelper.Styles.invisibleButton))
{
prop.InsertArrayElementAtIndex(prop.arraySize > 0 ? prop.arraySize - 1 : 0);
var chart = prop.GetArrayElementAtIndex(0).serializedObject.targetObject as BaseChart;
serializedObject.ApplyModifiedProperties();
chart.RemoveChartObject();
chart.RefreshAllComponent();
}
for (int i = 0; i < prop.arraySize; i++)
{
EditorGUILayout.PropertyField(prop.GetArrayElementAtIndex(i), true);
currRect = EditorGUILayout.GetControlRect(GUILayout.Height(0));
currRect.y -= EditorGUI.GetPropertyHeight(prop.GetArrayElementAtIndex(i));
rect1 = new Rect(currRect.width + k_IconXOffset,
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
var oldColor = GUI.contentColor;
GUI.contentColor = Color.black;
if (GUI.Button(rect1, ChartEditorHelper.Styles.iconRemove, ChartEditorHelper.Styles.invisibleButton))
{
if (prop.arraySize == 1)
{
if (EditorUtility.DisplayDialog("Delete component", "Confirm to delete last component?", "Sure", "Cancel"))
{
var chart = prop.GetArrayElementAtIndex(0).serializedObject.targetObject as BaseChart;
prop.DeleteArrayElementAtIndex(i);
serializedObject.ApplyModifiedProperties();
chart.RemoveChartObject();
chart.RefreshAllComponent();
}
}
else if (i < prop.arraySize && i >= 0)
{
var chart = prop.GetArrayElementAtIndex(0).serializedObject.targetObject as BaseChart;
prop.DeleteArrayElementAtIndex(i);
serializedObject.ApplyModifiedProperties();
chart.RemoveChartObject();
chart.RefreshAllComponent();
}
}
var rect2 = new Rect(currRect.width + k_IconXOffset - k_IconWidth - k_IconGap,
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect2, ChartEditorHelper.Styles.iconDown, ChartEditorHelper.Styles.invisibleButton))
{
if (i < prop.arraySize - 1) prop.MoveArrayElement(i, i + 1);
}
var rect3 = new Rect(currRect.width + k_IconXOffset - 2 * (k_IconWidth + k_IconGap),
currRect.y + k_IconYOffset,
k_IconWidth, EditorGUIUtility.singleLineHeight);
if (GUI.Button(rect3, ChartEditorHelper.Styles.iconUp, ChartEditorHelper.Styles.invisibleButton))
{
if (i > 0) prop.MoveArrayElement(i, i - 1);
}
GUI.contentColor = oldColor;
}
EditorGUI.indentLevel--;
}
}
else if (prop.arraySize > 0) EditorGUILayout.PropertyField(prop.GetArrayElementAtIndex(0), true);
}
BlockEnd();
}
protected void BlockListField(bool all, SerieType serieType, params SerializedProperty[] props)
{
if (!m_Chart.ContainsSerie(serieType)) return;
BlockListField(all, props);
}
private void CheckWarning()
{
if (GUILayout.Button("Check XCharts Update "))
if (GUILayout.Button("Remove All Chart Object"))
{
CheckVersionEditor.ShowWindow();
m_Chart.RemoveChartObject();
}
// if (GUILayout.Button("Check XCharts Update"))
// {
// CheckVersionEditor.ShowWindow();
// }
if (m_CheckWarning)
{
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Check Warning"))
{
m_CheckWarning = true;
m_Target.CheckWarning();
m_Chart.CheckWarning();
}
if (GUILayout.Button("Hide Warning"))
{
@@ -134,11 +314,11 @@ namespace XCharts
}
EditorGUILayout.EndHorizontal();
sb.Length = 0;
sb.AppendFormat("version:{0}", XChartsMgr.Instance.nowVersion);
if (!string.IsNullOrEmpty(m_Target.warningInfo))
sb.AppendFormat("v{0}", XChartsMgr.fullVersion);
if (!string.IsNullOrEmpty(m_Chart.warningInfo))
{
sb.AppendLine();
sb.Append(m_Target.warningInfo);
sb.Append(m_Chart.warningInfo);
}
else
{
@@ -152,11 +332,10 @@ namespace XCharts
if (GUILayout.Button("Check warning"))
{
m_CheckWarning = true;
m_Target.CheckWarning();
m_Chart.CheckWarning();
}
}
EditorGUILayout.Space();
EditorGUILayout.Space();
}
}
}

View File

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

View File

@@ -0,0 +1,25 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI CandlestickChart.
/// </summary>
[CustomEditor(typeof(CandlestickChart), false)]
public class CandlestickChartEditor : CoordinateChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
if(target == null) return;
m_Chart = (CandlestickChart)target;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -13,56 +13,42 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI CoordinateChart.
/// </summary>
[CustomEditor(typeof(CoordinateChart), false)]
public class CoordinateChartEditor : BaseChartEditor
{
protected SerializedProperty m_Grid;
protected SerializedProperty m_Grids;
protected SerializedProperty m_MultipleXAxis;
protected SerializedProperty m_XAxises;
protected SerializedProperty m_XAxes;
protected SerializedProperty m_MultipleYAxis;
protected SerializedProperty m_YAxises;
protected SerializedProperty m_DataZoom;
protected SerializedProperty m_VisualMap;
protected SerializedProperty m_YAxes;
protected SerializedProperty m_DataZooms;
protected SerializedProperty m_VisualMaps;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (CoordinateChart)target;
m_Grid = serializedObject.FindProperty("m_Grid");
m_XAxises = serializedObject.FindProperty("m_XAxises");
m_YAxises = serializedObject.FindProperty("m_YAxises");
m_DataZoom = serializedObject.FindProperty("m_DataZoom");
m_VisualMap = serializedObject.FindProperty("m_VisualMap");
if(target == null) return;
m_Chart = (CoordinateChart)target;
m_Grids = serializedObject.FindProperty("m_Grids");
m_XAxes = serializedObject.FindProperty("m_XAxes");
m_YAxes = serializedObject.FindProperty("m_YAxes");
m_DataZooms = serializedObject.FindProperty("m_DataZooms");
m_VisualMaps = serializedObject.FindProperty("m_VisualMaps");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
if (m_Target is LineChart || m_Target is BarChart)
{
EditorGUILayout.PropertyField(m_DataZoom);
}
if (m_Target is HeatmapChart || m_Target is LineChart)
{
EditorGUILayout.PropertyField(m_VisualMap);
}
EditorGUILayout.PropertyField(m_Grid);
for (int i = 0; i < m_XAxises.arraySize; i++)
{
SerializedProperty axis = m_XAxises.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(axis);
}
for (int i = 0; i < m_YAxises.arraySize; i++)
{
SerializedProperty axis = m_YAxises.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(axis);
}
BlockListField(m_ShowAllComponent, m_DataZooms);
BlockListField(m_ShowAllComponent, m_VisualMaps);
BlockListField(m_ShowAllComponent, m_Grids);
BlockListField(m_ShowAllComponent, m_XAxes);
BlockListField(m_ShowAllComponent, m_YAxes);
}
protected override void OnEndInspectorGUI()
protected override void MoreDebugInspector()
{
base.OnEndInspectorGUI();
base.MoreDebugInspector();
CovertXYAxis();
}
@@ -70,7 +56,7 @@ namespace XCharts
{
if (GUILayout.Button("Covert XY Axis"))
{
(m_Target as CoordinateChart).CovertXYAxis(0);
(m_Chart as CoordinateChart).CovertXYAxis(0);
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -12,22 +12,14 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI GaugeChart.
/// </summary>
[CustomEditor(typeof(GaugeChart), false)]
public class GaugeChartEditor : BaseChartEditor
{
protected SerializedProperty m_Radar;
protected SerializedProperty m_Radars;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (GaugeChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
if(target == null) return;
m_Chart = (GaugeChart)target;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -12,19 +12,14 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI HeatmapChart.
/// </summary>
[CustomEditor(typeof(HeatmapChart), false)]
public class HeatmapChartEditor : CoordinateChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
m_Target = (HeatmapChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
if(target == null) return;
m_Chart = (HeatmapChart)target;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -12,14 +12,14 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI LineChart.
/// </summary>
[CustomEditor(typeof(LineChart), false)]
public class LineChartEditor : CoordinateChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
m_Target = (LineChart)target;
if(target == null) return;
m_Chart = (LineChart)target;
}
}
}

View File

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

View File

@@ -16,19 +16,5 @@ namespace XCharts
[CustomEditor(typeof(LiquidChart), false)]
public class LiquidChartEditor : BaseChartEditor
{
protected SerializedProperty m_Vessels;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (LiquidChart)target;
m_Vessels = serializedObject.FindProperty("m_Vessels");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
EditorGUILayout.PropertyField(m_Vessels, true);
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -12,21 +12,14 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI PieChart.
/// </summary>
[CustomEditor(typeof(PieChart), false)]
public class PieChartEditor : BaseChartEditor
{
protected SerializedProperty m_Pie;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (PieChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
if(target == null) return;
m_Chart = (PieChart)target;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
@@ -12,29 +12,30 @@ namespace XCharts
/// <summary>
/// Editor class used to edit UI PolarChart.
/// </summary>
[CustomEditor(typeof(PolarChart), false)]
public class PolarChartEditor : BaseChartEditor
{
protected SerializedProperty m_Polar;
protected SerializedProperty m_RadiusAxis;
protected SerializedProperty m_AngleAxis;
protected SerializedProperty m_Polars;
protected SerializedProperty m_RadiusAxes;
protected SerializedProperty m_AngleAxes;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (PolarChart)target;
m_Polar = serializedObject.FindProperty("m_Polar");
m_RadiusAxis = serializedObject.FindProperty("m_RadiusAxis");
m_AngleAxis = serializedObject.FindProperty("m_AngleAxis");
if(target == null) return;
m_Chart = (PolarChart)target;
m_Polars = serializedObject.FindProperty("m_Polars");
m_RadiusAxes = serializedObject.FindProperty("m_RadiusAxes");
m_AngleAxes = serializedObject.FindProperty("m_AngleAxes");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
EditorGUILayout.PropertyField(m_Polar, true);
EditorGUILayout.PropertyField(m_RadiusAxis, true);
EditorGUILayout.PropertyField(m_AngleAxis, true);
var showAll = m_MultiComponentMode.boolValue;
BlockListField(showAll, m_Polars);
BlockListField(showAll, m_RadiusAxes);
BlockListField(showAll, m_AngleAxes);
}
}
}

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0ad1e8940e4805b49a18ea7a2cbd4bce
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,40 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AngleAxis), true)]
public class AngleAxisDrawer : AxisDrawer
{
protected override void DrawExtended(ref Rect drawRect, SerializedProperty prop)
{
SerializedProperty m_StartAngle = prop.FindPropertyRelative("m_StartAngle");
SerializedProperty m_Clockwise = prop.FindPropertyRelative("m_Clockwise");
EditorGUI.PropertyField(drawRect, m_StartAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clockwise);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
protected override string GetDisplayName(string displayName)
{
if (displayName.StartsWith("Element"))
{
displayName = displayName.Replace("Element", "Angle Axis");
}
return displayName;
}
protected override float GetExtendedHeight()
{
return 2 * EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,72 +12,25 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(SerieAnimation), true)]
public class AnimationDrawer : PropertyDrawer
public class AnimationDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_AnimationModuleToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Animation"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Enable = prop.FindPropertyRelative("m_Enable");
//SerializedProperty m_Easting = prop.FindPropertyRelative("m_Easting");
SerializedProperty m_FadeInDuration = prop.FindPropertyRelative("m_FadeInDuration");
SerializedProperty m_FadeOutDuration = prop.FindPropertyRelative("m_FadeOutDuration");
SerializedProperty m_DataChangeEnable = prop.FindPropertyRelative("m_DataChangeEnable");
SerializedProperty m_DataChangeDuration = prop.FindPropertyRelative("m_DataChangeDuration");
SerializedProperty m_FadeInDelay = prop.FindPropertyRelative("m_FadeInDelay");
//SerializedProperty m_Threshold = prop.FindPropertyRelative("m_Threshold");
SerializedProperty m_ActualDuration = prop.FindPropertyRelative("m_ActualDuration");
SerializedProperty m_FadeOutDelay = prop.FindPropertyRelative("m_FadeOutDelay");
// SerializedProperty m_CurrDetailProgress = prop.FindPropertyRelative("m_CurrDetailProgress");
// SerializedProperty m_DestDetailProgress = prop.FindPropertyRelative("m_DestDetailProgress");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AnimationModuleToggle, prop, null, m_Enable, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AnimationModuleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Enable"))
{
++EditorGUI.indentLevel;
//EditorGUI.PropertyField(drawRect, m_Easting);
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Threshold);
// if (m_Threshold.intValue < 0) m_Threshold.intValue = 0;
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeInDelay);
if (m_FadeInDelay.floatValue < 0) m_FadeInDelay.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeInDuration);
if (m_FadeInDuration.floatValue < 0) m_FadeInDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeOutDelay);
if (m_FadeOutDelay.floatValue < 0) m_FadeOutDelay.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeOutDuration);
if (m_FadeOutDuration.floatValue < 0) m_FadeOutDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_DataChangeEnable);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_DataChangeDuration);
if (m_DataChangeDuration.floatValue < 0) m_DataChangeDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.LabelField(drawRect, "CurrDetailProgress:" + m_CurrDetailProgress.floatValue);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.LabelField(drawRect, "DestDetailProgress:" + m_DestDetailProgress.floatValue);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.LabelField(drawRect, "Actual duration:" + m_ActualDuration.floatValue + " ms");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_FadeInDuration");
PropertyField(prop, "m_FadeInDelay");
PropertyField(prop, "m_FadeOutDuration");
PropertyField(prop, "m_FadeOutDelay");
PropertyField(prop, "m_DataChangeEnable");
PropertyField(prop, "m_DataChangeDuration");
PropertyField(prop, "m_ActualDuration");
PropertyField(prop, "m_AlongWithLinePath");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_AnimationModuleToggle, prop))
return 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
else
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

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

View File

@@ -1,69 +1,34 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AreaStyle), true)]
public class AreaStyleDrawer : PropertyDrawer
public class AreaStyleDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_AreaStyleToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "AreaStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Origin = prop.FindPropertyRelative("m_Origin");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_ToColor = prop.FindPropertyRelative("m_ToColor");
SerializedProperty m_HighlightColor = prop.FindPropertyRelative("m_HighlightColor");
SerializedProperty m_HighlightToColor = prop.FindPropertyRelative("m_HighlightToColor");
SerializedProperty m_Opacity = prop.FindPropertyRelative("m_Opacity");
SerializedProperty m_TooltipHighlight = prop.FindPropertyRelative("m_TooltipHighlight");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AreaStyleToggle, prop, "Area Style", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AreaStyleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Origin);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ToColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_HighlightColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_HighlightToColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Opacity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TooltipHighlight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
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_TooltipHighlight");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AreaStyleToggle, prop))
{
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -1,78 +1,56 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Axis), true)]
public class AxisDrawer : PropertyDrawer
public class AxisDrawer : BasePropertyDrawer
{
private List<bool> m_AxisModuleToggle = new List<bool>();
private List<bool> m_DataFoldout = new List<bool>();
private int m_DataSize = 0;
private bool m_ShowJsonDataArea = false;
private string m_JsonDataAreaText;
protected virtual string GetDisplayName(string displayName)
{
return displayName;
}
public override string ClassName { get { return "Axis"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_LogBaseE = prop.FindPropertyRelative("m_LogBaseE");
SerializedProperty m_LogBase = prop.FindPropertyRelative("m_LogBase");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_BoundaryGap = prop.FindPropertyRelative("m_BoundaryGap");
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
SerializedProperty m_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_AxisName = prop.FindPropertyRelative("m_AxisName");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_CeilRate = prop.FindPropertyRelative("m_CeilRate");
SerializedProperty m_Inverse = prop.FindPropertyRelative("m_Inverse");
int index = InitToggle(prop);
bool toggle = m_AxisModuleToggle[index];
m_AxisModuleToggle[index] = ChartEditorHelper.MakeFoldout(ref drawRect, ref toggle,
GetDisplayName(prop.displayName), m_Show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_AxisModuleToggle[index])
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_LogBase = prop.FindPropertyRelative("m_LogBase");
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
Axis.AxisType type = (Axis.AxisType)m_Type.enumValueIndex;
var chart = prop.serializedObject.targetObject as BaseChart;
var isPolar = chart is PolarChart;
EditorGUI.indentLevel++;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, isPolar ? "m_PolarIndex" : "m_GridIndex");
PropertyField(prop, "m_Type");
if (type == Axis.AxisType.Time)
{
var chartTypeName = prop.serializedObject.targetObject.GetType().Name;
if (!chartTypeName.Equals("GanttChart"))
EditorGUILayout.HelpBox("The Time axis is currently only supported in GanttChart.", MessageType.Warning);
}
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Offset");
if (type == Axis.AxisType.Log)
{
EditorGUI.PropertyField(drawRect, m_LogBaseE);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LogBase);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_LogBaseE");
EditorGUI.BeginChangeCheck();
PropertyField(prop, "m_LogBase");
if (m_LogBase.floatValue <= 0 || m_LogBase.floatValue == 1)
{
m_LogBase.floatValue = 10;
}
EditorGUI.EndChangeCheck();
}
if (type == Axis.AxisType.Value)
if (type == Axis.AxisType.Value || type == Axis.AxisType.Time)
{
EditorGUI.PropertyField(drawRect, m_MinMaxType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_MinMaxType");
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
switch (minMaxType)
{
@@ -82,148 +60,135 @@ namespace XCharts
break;
case Axis.AxisMinMaxType.Custom:
EditorGUI.indentLevel++;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Min");
PropertyField(prop, "m_Max");
EditorGUI.indentLevel--;
break;
}
EditorGUI.PropertyField(drawRect, m_CeilRate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Inverse);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_CeilRate");
if (type == Axis.AxisType.Value)
{
PropertyField(prop, "m_Inverse");
}
}
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Interval);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BoundaryGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
DrawExtended(ref drawRect, prop);
EditorGUI.PropertyField(drawRect, m_AxisLine);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLine);
EditorGUI.PropertyField(drawRect, m_AxisName);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisName);
EditorGUI.PropertyField(drawRect, m_AxisTick);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisTick);
EditorGUI.PropertyField(drawRect, m_AxisLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLabel);
EditorGUI.PropertyField(drawRect, m_SplitLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
EditorGUI.PropertyField(drawRect, m_SplitArea);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitArea);
PropertyField(prop, "m_SplitNumber");
if (type == Axis.AxisType.Category)
{
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data");
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop, pos.width);
drawRect.width = pos.width;
if (m_DataFoldout[index])
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_Data);
}
PropertyField(prop, "m_InsertDataToHead");
PropertyField(prop, "m_MaxCache");
PropertyField(prop, "m_BoundaryGap");
}
else
{
PropertyField(prop, "m_Interval");
}
DrawExtendeds(prop);
PropertyField(prop, "m_AxisLine");
PropertyField(prop, "m_AxisName");
PropertyField(prop, "m_AxisTick");
PropertyField(prop, "m_AxisLabel");
PropertyField(prop, "m_SplitLine");
PropertyField(prop, "m_SplitArea");
PropertyField(prop, "m_IconStyle");
PropertyListField(prop, "m_Icons", true);
if (type == Axis.AxisType.Category)
{
PropertyListField(prop, "m_Data", true);
}
EditorGUI.indentLevel--;
}
}
}
protected virtual void DrawExtended(ref Rect drawRect, SerializedProperty prop)
[CustomPropertyDrawer(typeof(XAxis), true)]
public class XAxisDrawer : AxisDrawer
{
public override string ClassName { get { return "XAxis"; } }
}
[CustomPropertyDrawer(typeof(YAxis), true)]
public class YAxisDrawer : AxisDrawer
{
public override string ClassName { get { return "YAxis"; } }
}
[CustomPropertyDrawer(typeof(AngleAxis), true)]
public class AngleAxisDrawer : AxisDrawer
{
public override string ClassName { get { return "AngleAxis"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_StartAngle");
PropertyField(prop, "m_Clockwise");
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
[CustomPropertyDrawer(typeof(RadiusAxis), true)]
public class RadiusAxisDrawer : AxisDrawer
{
public override string ClassName { get { return "RadiusAxis"; } }
}
[CustomPropertyDrawer(typeof(AxisLabel), true)]
public class AxisLabelDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "AxisLabel"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
int index = InitToggle(prop);
if (!m_AxisModuleToggle[index])
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_AxisName = prop.FindPropertyRelative("m_AxisName");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
float height = 0;
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
Axis.AxisType type = (Axis.AxisType)m_Type.enumValueIndex;
if (type == Axis.AxisType.Category)
{
if (m_DataFoldout[index])
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
int num = m_Data.arraySize + 2;
if (num > 30) num = 14;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing;
}
}
else if (type == Axis.AxisType.Value)
{
height += 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
if (m_MinMaxType.enumValueIndex == (int)Axis.AxisMinMaxType.Custom)
{
height += EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing;
}
}
else if (type == Axis.AxisType.Log)
{
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
if (m_MinMaxType.enumValueIndex == (int)Axis.AxisMinMaxType.Custom)
{
height += EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing;
}
}
height += EditorGUI.GetPropertyHeight(m_AxisName);
height += EditorGUI.GetPropertyHeight(m_AxisLine);
height += EditorGUI.GetPropertyHeight(m_AxisTick);
height += EditorGUI.GetPropertyHeight(m_AxisLabel);
height += EditorGUI.GetPropertyHeight(m_SplitArea);
height += EditorGUI.GetPropertyHeight(m_SplitLine);
height += GetExtendedHeight();
return height;
++EditorGUI.indentLevel;
PropertyField(prop, "m_Inside");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_Margin");
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_TextStyle");
--EditorGUI.indentLevel;
}
}
}
protected virtual float GetExtendedHeight()
[CustomPropertyDrawer(typeof(AxisName), true)]
public class AxisNameDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "AxisName"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
return 0;
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
}
}
private int InitToggle(SerializedProperty prop)
[CustomPropertyDrawer(typeof(AxisSplitArea), true)]
public class AxisSplitAreaDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "SplitArea"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
int index = 0;
int.TryParse(prop.displayName.Split(' ')[1], out index);
if (index >= m_DataFoldout.Count)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
m_DataFoldout.Add(false);
++EditorGUI.indentLevel;
PropertyField(prop, "m_Color");
--EditorGUI.indentLevel;
}
if (index >= m_AxisModuleToggle.Count)
{
m_AxisModuleToggle.Add(false);
}
return index;
}
}
}

View File

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

View File

@@ -1,81 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisLabel), true)]
public class AxisLabelDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AxisLabelToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_Inside = prop.FindPropertyRelative("m_Inside");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_Margin = prop.FindPropertyRelative("m_Margin");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
SerializedProperty m_NumericFormatter = prop.FindPropertyRelative("m_NumericFormatter");
SerializedProperty m_ShowAsPositiveNumber = prop.FindPropertyRelative("m_ShowAsPositiveNumber");
SerializedProperty m_OnZero = prop.FindPropertyRelative("m_OnZero");
SerializedProperty m_TextLimit = prop.FindPropertyRelative("m_TextLimit");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLabelToggle, prop, "Axis Label", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_OnZero);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Inside);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Interval);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Rotate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Margin);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_NumericFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowAsPositiveNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TextLimit);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextLimit);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
{
height += 12 * EditorGUIUtility.singleLineHeight + 11 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextLimit"));
}
return height;
}
}
}

View File

@@ -1,65 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisLine), true)]
public class AxisLineDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AxisLineToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_OnZero = prop.FindPropertyRelative("m_OnZero");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Symbol = prop.FindPropertyRelative("m_Symbol");
SerializedProperty m_SymbolWidth = prop.FindPropertyRelative("m_SymbolWidth");
SerializedProperty m_SymbolHeight = prop.FindPropertyRelative("m_SymbolHeight");
SerializedProperty m_SymbolOffset = prop.FindPropertyRelative("m_SymbolOffset");
SerializedProperty m_SymbolDent = prop.FindPropertyRelative("m_SymbolDent");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLineToggle, prop, "Axis Line", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle,prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_OnZero);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SymbolWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SymbolHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SymbolOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SymbolDent);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle,prop))
{
height += 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,75 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisName), true)]
public class AxisNameDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AxisNameToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Name = prop.FindPropertyRelative("m_Name");
SerializedProperty m_Location = prop.FindPropertyRelative("m_Location");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisNameToggle, prop, "Axis Name", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisNameToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Name);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Location);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
// EditorGUI.LabelField(drawRect, "Offset");
// var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
// var tempWidth = (pos.width - startX + 35) / 2;
// var xRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
// var yRect = new Rect(xRect.x + tempWidth - 20, drawRect.y, tempWidth, drawRect.height);
// var x = EditorGUI.FloatField(xRect, m_Offset.vector2Value.x);
// var y = EditorGUI.FloatField(yRect, m_Offset.vector2Value.y);
// m_Offset.vector2Value = new Vector2(x,y);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Rotate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisNameToggle, prop))
{
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
}
return height;
}
}
}

View File

@@ -1,61 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisSplitArea), true)]
public class AxisSplitAreaDrawer : PropertyDrawer
{
private bool m_ColorFoldout = false;
private int m_ColorSize = 0;
private Dictionary<string, bool> m_SplitAreaToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SplitAreaToggle, prop, "Split Area", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_SplitAreaToggle, prop))
{
++EditorGUI.indentLevel;
m_ColorFoldout = EditorGUI.Foldout(drawRect, m_ColorFoldout, "Color");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.width = pos.width;
if (m_ColorFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_ColorSize, m_Color);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_SplitAreaToggle, prop))
{
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_ColorFoldout)
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Color");
int num = m_Data.arraySize + 1;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
}
return height;
}
}
}

View File

@@ -1,55 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisSplitLine), true)]
public class AxisSplitLineDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AxisSplitLineToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisSplitLineToggle, prop, "Split Line", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisSplitLineToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Interval);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisSplitLineToggle, prop))
{
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
}
else
{
height = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,55 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AxisTick), true)]
public class AxisTickDrawer : PropertyDrawer
{
private bool m_AxisTickToggle = false;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_AlignWithLabel = prop.FindPropertyRelative("m_AlignWithLabel");
SerializedProperty m_Inside = prop.FindPropertyRelative("m_Inside");
SerializedProperty m_Length = prop.FindPropertyRelative("m_Length");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisTickToggle, "Axis Tick", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_AxisTickToggle)
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_AlignWithLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Inside);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Length);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (m_AxisTickToggle)
{
height += 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,57 +11,21 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Background), true)]
public class BackgroundDrawer : PropertyDrawer
public class BackgroundDrawer : BasePropertyDrawer
{
private bool m_BackgroundModuleToggle = false;
public override string ClassName { get { return "Background"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Image = prop.FindPropertyRelative("m_Image");
SerializedProperty m_ImageType = prop.FindPropertyRelative("m_ImageType");
// SerializedProperty m_Left = prop.FindPropertyRelative("m_Left");
// SerializedProperty m_Right = prop.FindPropertyRelative("m_Right");
// SerializedProperty m_Top = prop.FindPropertyRelative("m_Top");
// SerializedProperty m_Bottom = prop.FindPropertyRelative("m_Bottom");
SerializedProperty m_ImageColor = prop.FindPropertyRelative("m_ImageColor");
SerializedProperty m_HideThemeBackgroundColor = prop.FindPropertyRelative("m_HideThemeBackgroundColor");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_BackgroundModuleToggle, "Background", m_Show);
EditorGUI.LabelField(drawRect, "Background", EditorStyles.boldLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_BackgroundModuleToggle)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Image);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ImageType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ImageColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_HideThemeBackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_ImageColor");
PropertyField(prop, "m_HideThemeBackgroundColor");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_BackgroundModuleToggle)
return 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
else
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

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

View File

@@ -0,0 +1,188 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Settings), true)]
public class BasePropertyDrawer : PropertyDrawer
{
protected int m_Index;
protected int m_DataSize;
protected float m_DefaultWidth;
protected string m_DisplayName;
protected string m_KeyName;
protected Rect m_DrawRect;
protected Dictionary<string, float> m_Heights = new Dictionary<string, float>();
protected Dictionary<string, bool> m_PropToggles = new Dictionary<string, bool>();
protected Dictionary<string, bool> m_DataToggles = new Dictionary<string, bool>();
public virtual string ClassName { get { return ""; } }
public virtual List<string> IngorePropertys { get { return new List<string> { }; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
m_DrawRect = pos;
m_DrawRect.height = EditorGUIUtility.singleLineHeight;
m_DefaultWidth = pos.width;
var list = prop.displayName.Split(' ');
if (list.Length > 0)
{
if (!int.TryParse(list[list.Length - 1], out m_Index))
{
m_Index = 0;
m_DisplayName = prop.displayName;
m_KeyName = prop.propertyPath + "_" + m_Index;
}
else
{
m_DisplayName = ClassName + " " + m_Index;
m_KeyName = prop.propertyPath + "_" + m_Index;
}
}
else
{
m_DisplayName = prop.displayName;
}
if (!m_PropToggles.ContainsKey(m_KeyName))
{
m_PropToggles.Add(m_KeyName, false);
}
if (!m_DataToggles.ContainsKey(m_KeyName))
{
m_DataToggles.Add(m_KeyName, false);
}
if (!m_Heights.ContainsKey(m_KeyName))
{
m_Heights.Add(m_KeyName, 0);
}
else
{
m_Heights[m_KeyName] = 0;
}
}
private string GetKeyName(SerializedProperty prop)
{
var index = 0;
var list = prop.displayName.Split(' ');
if (list.Length > 0)
{
int.TryParse(list[list.Length - 1], out index);
}
return prop.propertyPath + "_" + index;
}
protected void AddSingleLineHeight()
{
m_Heights[m_KeyName] += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
m_DrawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
protected void AddHeight(float height)
{
m_Heights[m_KeyName] += height;
m_DrawRect.y += height;
}
protected void PropertyListField(SerializedProperty prop, string relativePropName, bool showOrder = true)
{
if (IngorePropertys.Contains(relativePropName)) return;
var height = m_Heights[m_KeyName];
var toggleKeyName = m_KeyName + relativePropName;
m_DataToggles[toggleKeyName] = ChartEditorHelper.MakeListWithFoldout(ref m_DrawRect, ref height,
prop.FindPropertyRelative(relativePropName),
m_DataToggles.ContainsKey(toggleKeyName) && m_DataToggles[toggleKeyName], showOrder);
m_Heights[m_KeyName] = height;
}
protected void PropertyField(SerializedProperty prop, string relativePropName)
{
if (IngorePropertys.Contains(relativePropName)) return;
if (!ChartEditorHelper.PropertyField(ref m_DrawRect, m_Heights, m_KeyName, prop, relativePropName))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
}
}
protected void PropertyFieldLimitMin(SerializedProperty prop, string relativePropName, float minValue)
{
if (IngorePropertys.Contains(relativePropName)) return;
if (!ChartEditorHelper.PropertyFieldWithMinValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
relativePropName, minValue))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
}
}
protected void PropertyFieldLimitMax(SerializedProperty prop, string relativePropName, float maxValue)
{
if (IngorePropertys.Contains(relativePropName)) return;
if (!ChartEditorHelper.PropertyFieldWithMaxValue(ref m_DrawRect, m_Heights, m_KeyName, prop,
relativePropName, maxValue))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativePropName);
}
}
protected void PropertyField(SerializedProperty prop, SerializedProperty relativeProp)
{
if (!ChartEditorHelper.PropertyField(ref m_DrawRect, m_Heights, m_KeyName, relativeProp))
{
Debug.LogError("PropertyField ERROR:" + prop.displayName + ", " + relativeProp);
}
}
protected void PropertyTwoFiled(SerializedProperty prop, string relativeListProp, string labelName = null)
{
PropertyTwoFiled(prop, prop.FindPropertyRelative(relativeListProp), labelName);
}
protected void PropertyTwoFiled(SerializedProperty prop, SerializedProperty relativeListProp,
string labelName = null)
{
if (string.IsNullOrEmpty(labelName))
{
labelName = relativeListProp.displayName;
}
ChartEditorHelper.MakeTwoField(ref m_DrawRect, m_DefaultWidth, relativeListProp, labelName);
m_Heights[m_KeyName] += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
protected bool MakeFoldout(SerializedProperty prop, string relativePropName)
{
if (string.IsNullOrEmpty(relativePropName))
{
return ChartEditorHelper.MakeFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, null);
}
else
{
var relativeProp = prop.FindPropertyRelative(relativePropName);
return ChartEditorHelper.MakeFoldout(ref m_DrawRect, m_Heights, m_PropToggles, m_KeyName,
m_DisplayName, relativeProp);
}
}
protected virtual void DrawExtendeds(SerializedProperty prop)
{
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
var key = GetKeyName(prop);
if (m_Heights.ContainsKey(key)) return m_Heights[key] + GetExtendedHeight();
else return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
protected virtual float GetExtendedHeight()
{
return 0;
}
}
}

View File

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

View File

@@ -0,0 +1,190 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
#if dUI_TextMeshPro
using TMPro;
#endif
namespace XCharts
{
[CustomPropertyDrawer(typeof(ComponentTheme), true)]
public class ComponentThemeDrawer : BasePropertyDrawer
{
public override string ClassName { get { return ""; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
{
++EditorGUI.indentLevel;
#if dUI_TextMeshPro
PropertyField(prop, "m_TMPFont");
#else
PropertyField(prop, "m_Font");
#endif
PropertyField(prop, "m_FontSize");
PropertyField(prop, "m_TextColor");
//PropertyField(prop, "m_TextBackgroundColor");
DrawExtendeds(prop);
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(BaseAxisTheme), true)]
public class BaseAxisThemeDrawer : ComponentThemeDrawer
{
public override string ClassName { get { return "Axis"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_LineType");
PropertyField(prop, "m_LineWidth");
PropertyField(prop, "m_LineLength");
PropertyField(prop, "m_LineColor");
PropertyField(prop, "m_SplitLineType");
PropertyField(prop, "m_SplitLineWidth");
PropertyField(prop, "m_SplitLineLength");
PropertyField(prop, "m_SplitLineColor");
PropertyField(prop, "m_TickWidth");
PropertyField(prop, "m_TickLength");
PropertyField(prop, "m_TickColor");
PropertyField(prop, "m_SplitAreaColors");
}
}
[CustomPropertyDrawer(typeof(AxisTheme), true)]
public class AxisThemeDrawer : BaseAxisThemeDrawer
{
public override string ClassName { get { return "Axis"; } }
}
[CustomPropertyDrawer(typeof(RadiusAxisTheme), true)]
public class RadiusAxisThemeDrawer : BaseAxisThemeDrawer
{
public override string ClassName { get { return "Radius Axis"; } }
public override List<string> IngorePropertys
{
get
{
return new List<string> {
"m_TextBackgroundColor" ,
"m_LineLength",
"m_SplitLineLength",
};
}
}
}
[CustomPropertyDrawer(typeof(GaugeAxisTheme), true)]
public class GaugeAxisThemeDrawer : AxisThemeDrawer
{
public override string ClassName { get { return "Gauge Axis"; } }
public override List<string> IngorePropertys
{
get
{
return new List<string> {
"m_TextBackgroundColor" ,
"m_LineLength",
};
}
}
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_BarBackgroundColor");
PropertyField(prop, "m_StageColor");
}
}
[CustomPropertyDrawer(typeof(DataZoomTheme), true)]
public class DataZoomThemeDrawer : ComponentThemeDrawer
{
public override string ClassName { get { return "DataZoom"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_BackgroundColor");
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_DataLineWidth");
PropertyField(prop, "m_DataLineColor");
PropertyField(prop, "m_FillerColor");
PropertyField(prop, "m_DataAreaColor");
}
}
[CustomPropertyDrawer(typeof(LegendTheme), true)]
public class LegendThemeDrawer : ComponentThemeDrawer
{
public override string ClassName { get { return "Legend"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_UnableColor");
}
}
[CustomPropertyDrawer(typeof(TooltipTheme), true)]
public class TooltipThemeDrawer : ComponentThemeDrawer
{
public override string ClassName { get { return "Tooltip"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_LineType");
PropertyField(prop, "m_LineWidth");
PropertyField(prop, "m_LineColor");
PropertyField(prop, "m_AreaColor");
PropertyField(prop, "m_LabelTextColor");
PropertyField(prop, "m_LabelBackgroundColor");
}
}
[CustomPropertyDrawer(typeof(VisualMapTheme), true)]
public class VisualMapThemeDrawer : ComponentThemeDrawer
{
public override string ClassName { get { return "VisualMap"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
// PropertyField(prop, "m_BorderWidth");
// PropertyField(prop, "m_BorderColor");
// PropertyField(prop, "m_BackgroundColor");
}
}
[CustomPropertyDrawer(typeof(SerieTheme), true)]
public class SerieThemeDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Serie"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_LineWidth");
PropertyField(prop, "m_LineSymbolSize");
PropertyField(prop, "m_LineSymbolSelectedSize");
PropertyField(prop, "m_ScatterSymbolSize");
PropertyField(prop, "m_ScatterSymbolSelectedSize");
PropertyField(prop, "m_PieTooltipExtraRadius");
PropertyField(prop, "m_PieSelectedOffset");
PropertyField(prop, "m_CandlestickColor");
PropertyField(prop, "m_CandlestickColor0");
PropertyField(prop, "m_CandlestickBorderColor");
PropertyField(prop, "m_CandlestickBorderColor0");
PropertyField(prop, "m_CandlestickBorderWidth");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,96 +11,62 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(DataZoom), true)]
public class DataZoomDrawer : PropertyDrawer
public class DataZoomDrawer : BasePropertyDrawer
{
private bool m_DataZoomModuleToggle = false;
public override string ClassName { get { return "DataZoom"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Enable");
//SerializedProperty m_FilterMode = prop.FindPropertyRelative("m_FilterMode");
//SerializedProperty m_Orient = prop.FindPropertyRelative("m_Orient");
SerializedProperty m_SupportInside = prop.FindPropertyRelative("m_SupportInside");
SerializedProperty m_SupportSlider = prop.FindPropertyRelative("m_SupportSlider");
//SerializedProperty m_SupportSelect = prop.FindPropertyRelative("m_SupportSelect");
SerializedProperty m_ShowDataShadow = prop.FindPropertyRelative("m_ShowDataShadow");
SerializedProperty m_ShowDetail = prop.FindPropertyRelative("m_ShowDetail");
SerializedProperty m_ZoomLock = prop.FindPropertyRelative("m_ZoomLock");
// SerializedProperty m_Realtime = prop.FindPropertyRelative("m_Realtime");
// SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_Height = prop.FindPropertyRelative("m_Height");
SerializedProperty m_Bottom = prop.FindPropertyRelative("m_Bottom");
SerializedProperty m_RangeMode = prop.FindPropertyRelative("m_RangeMode");
SerializedProperty m_Start = prop.FindPropertyRelative("m_Start");
SerializedProperty m_End = prop.FindPropertyRelative("m_End");
SerializedProperty m_MinShowNum = prop.FindPropertyRelative("m_MinShowNum");
SerializedProperty m_ScrollSensitivity = prop.FindPropertyRelative("m_ScrollSensitivity");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_DataZoomModuleToggle, "DataZoom", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_DataZoomModuleToggle)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Enable"))
{
var m_SupportInside = prop.FindPropertyRelative("m_SupportInside");
var m_SupportSlider = prop.FindPropertyRelative("m_SupportSlider");
var m_Start = prop.FindPropertyRelative("m_Start");
var m_End = prop.FindPropertyRelative("m_End");
var m_MinShowNum = prop.FindPropertyRelative("m_MinShowNum");
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_SupportInside);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SupportSlider);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_SupportSlider.boolValue)
PropertyField(prop, "m_Orient");
PropertyField(prop, "m_SupportInside");
if (m_SupportInside.boolValue)
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_ShowDataShadow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowDetail);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Realtime);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Height);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Bottom);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
PropertyField(prop, "m_SupportInsideScroll");
PropertyField(prop, "m_SupportInsideDrag");
}
//EditorGUI.PropertyField(drawRect, m_SupportSelect);
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ZoomLock);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ScrollSensitivity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RangeMode);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Start);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_End);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShowNum);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, m_SupportSlider);
PropertyField(prop, "m_ZoomLock");
PropertyField(prop, "m_ScrollSensitivity");
PropertyField(prop, "m_RangeMode");
PropertyField(prop, m_Start);
PropertyField(prop, m_End);
PropertyField(prop, m_MinShowNum);
if (m_Start.floatValue < 0) m_Start.floatValue = 0;
if (m_End.floatValue > 100) m_End.floatValue = 100;
if (m_MinShowNum.intValue < 0) m_MinShowNum.intValue = 0;
if (m_SupportSlider.boolValue)
{
PropertyField(prop, "m_ShowDataShadow");
PropertyField(prop, "m_ShowDetail");
PropertyField(prop, "m_BackgroundColor");
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_FillerColor");
PropertyField(prop, "m_Left");
PropertyField(prop, "m_Right");
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_AreaStyle");
PropertyListField(prop, "m_XAxisIndexs", true);
PropertyListField(prop, "m_YAxisIndexs", true);
PropertyField(prop, "m_TextStyle");
}
else
{
PropertyListField(prop, "m_XAxisIndexs", true);
PropertyListField(prop, "m_YAxisIndexs", true);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int num = 1;
if (m_DataZoomModuleToggle)
{
num += 8;
if (prop.FindPropertyRelative("m_SupportSlider").boolValue) num += 6;
}
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,44 +12,19 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Emphasis), true)]
public class EmphasisDrawer : PropertyDrawer
public class EmphasisDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_EmphasisToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Emphasis"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Label = prop.FindPropertyRelative("m_Label");
SerializedProperty m_ItemStyle = prop.FindPropertyRelative("m_ItemStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_EmphasisToggle, prop, "Emphasis", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_EmphasisToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
PropertyField(prop, "m_Label");
PropertyField(prop, "m_ItemStyle");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_EmphasisToggle, prop))
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -1,81 +1,69 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis), true)]
public class GaugeAxisDrawer : PropertyDrawer
public class GaugeAxisDrawer : BasePropertyDrawer
{
private bool m_DataFoldout = false;
private int m_DataSize = 0;
private Dictionary<string, bool> m_AxisLineToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Gauge Axis"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_AxisLine");
PropertyField(prop, "m_SplitLine");
PropertyField(prop, "m_AxisTick");
PropertyField(prop, "m_AxisLabel");
PropertyField(prop, "m_AxisLabelText");
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(StageColor), true)]
public class GaugeAxisLineStageColorDrawer : BasePropertyDrawer
{
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_AxisLabelText = prop.FindPropertyRelative("m_AxisLabelText");
SerializedProperty m_Percent = prop.FindPropertyRelative("m_Percent");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLineToggle, prop, "Gauge Axis", show, false);
ChartEditorHelper.MakeTwoField(ref drawRect, drawRect.width, m_Percent, m_Color, "Stage");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_AxisLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLine);
EditorGUI.PropertyField(drawRect, m_SplitLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
EditorGUI.PropertyField(drawRect, m_AxisTick);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisTick);
EditorGUI.PropertyField(drawRect, m_AxisLabel);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLabel);
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Axis Label Text");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.width = pos.width;
if (m_DataFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_AxisLabelText);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle, prop))
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
[CustomPropertyDrawer(typeof(GaugePointer), true)]
public class GaugePointerDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Gauge Pointer"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisLine"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitLine"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisTick"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisLabel"));
if (m_DataFoldout)
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_AxisLabelText");
int num = m_Data.arraySize + 1;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
++EditorGUI.indentLevel;
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Length");
--EditorGUI.indentLevel;
}
}
}

View File

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

View File

@@ -1,76 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis.AxisLine), true)]
public class GaugeAxisLineDrawer : PropertyDrawer
{
private bool m_DataFoldout = false;
private int m_DataSize = 0;
private Dictionary<string, bool> m_Toggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Opacity = prop.FindPropertyRelative("m_Opacity");
SerializedProperty m_BarBackgroundColor = prop.FindPropertyRelative("m_BarBackgroundColor");
SerializedProperty m_BarColor = prop.FindPropertyRelative("m_BarColor");
SerializedProperty m_StageColor = prop.FindPropertyRelative("m_StageColor");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_Toggle, prop, "Axis Line", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Opacity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarBackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Stage Color");
drawRect.width = pos.width;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_DataFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_StageColor);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
float height = 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
if (m_DataFoldout)
{
var arraySize = prop.FindPropertyRelative("m_StageColor").arraySize + 1;
height += arraySize * EditorGUIUtility.singleLineHeight + (arraySize) * EditorGUIUtility.standardVerticalSpacing;
height += 2 * EditorGUIUtility.standardVerticalSpacing;
return height;
}
return height;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,33 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis.AxisLine.StageColor), true)]
public class GaugeAxisLineStageColorDrawer : PropertyDrawer
{
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Percent = prop.FindPropertyRelative("m_Percent");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
ChartEditorHelper.MakeTwoField(ref drawRect, drawRect.width, m_Percent, m_Color, "Stage");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,54 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis.SplitLine), true)]
public class GaugeAxisSplitDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_Toggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Length = prop.FindPropertyRelative("m_Length");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_Toggle, prop, "Split Line", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Length);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
float height = 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
return height;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,57 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis.AxisTick), true)]
public class GaugeAxisTickDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_Toggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Length = prop.FindPropertyRelative("m_Length");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_Toggle, prop, "Axis Tick", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Length);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
float height = 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
return height;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,51 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugePointer), true)]
public class GaugePointerDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_Toggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Length = prop.FindPropertyRelative("m_Length");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_Toggle, prop, "Gauge Pointer", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Length);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_Toggle, prop))
{
return 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,48 +11,22 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Grid), true)]
public class GridDrawer : PropertyDrawer
public class GridDrawer : BasePropertyDrawer
{
private bool m_GridModuleToggle = false;
public override string ClassName { get { return "Grid"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Left = prop.FindPropertyRelative("m_Left");
SerializedProperty m_Right = prop.FindPropertyRelative("m_Right");
SerializedProperty m_Top = prop.FindPropertyRelative("m_Top");
SerializedProperty m_Bottom = prop.FindPropertyRelative("m_Bottom");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_GridModuleToggle, "Grid",m_Show);
EditorGUI.LabelField(drawRect, "Grid", EditorStyles.boldLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_GridModuleToggle)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Left);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Right);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Top);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Bottom);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Left");
PropertyField(prop, "m_Right");
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_BackgroundColor");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_GridModuleToggle)
return 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
else
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,56 +12,25 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(IconStyle), true)]
public class IconStyleDrawer : PropertyDrawer
public class IconStyleDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_IconStyleToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "IconStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Layer = prop.FindPropertyRelative("m_Layer");
SerializedProperty m_Sprite = prop.FindPropertyRelative("m_Sprite");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Height = prop.FindPropertyRelative("m_Height");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_IconStyleToggle, prop, null, m_Show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_IconStyleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Layer);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Sprite);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Height);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
PropertyField(prop, "m_Layer");
PropertyField(prop, "m_Align");
PropertyField(prop, "m_Sprite");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_AutoHideWhenLabelEmpty");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_IconStyleToggle, prop))
{
var hight = 6 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
hight += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
hight += EditorGUIUtility.standardVerticalSpacing;
return hight;
}
else
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

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

View File

@@ -1,100 +1,44 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(ItemStyle), true)]
public class ItemStyleDrawer : PropertyDrawer
public class ItemStyleDrawer : BasePropertyDrawer
{
private int m_CornerRadius = 0;
private Dictionary<string, bool> m_ItemStyleToggle = new Dictionary<string, bool>();
private Dictionary<string, bool> m_CornerRadiusToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "ItemStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_ToColor = prop.FindPropertyRelative("m_ToColor");
SerializedProperty m_ToColor2 = prop.FindPropertyRelative("m_ToColor2");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_BackgroundWidth = prop.FindPropertyRelative("m_BackgroundWidth");
SerializedProperty m_CenterColor = prop.FindPropertyRelative("m_CenterColor");
SerializedProperty m_CenterGap = prop.FindPropertyRelative("m_CenterGap");
SerializedProperty m_BorderType = prop.FindPropertyRelative("m_BorderType");
SerializedProperty m_BorderWidth = prop.FindPropertyRelative("m_BorderWidth");
SerializedProperty m_BorderColor = prop.FindPropertyRelative("m_BorderColor");
SerializedProperty m_Opacity = prop.FindPropertyRelative("m_Opacity");
SerializedProperty m_TooltipFormatter = prop.FindPropertyRelative("m_TooltipFormatter");
SerializedProperty m_NumericFormatter = prop.FindPropertyRelative("m_NumericFormatter");
SerializedProperty m_CornerRadius = prop.FindPropertyRelative("m_CornerRadius");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_ItemStyleToggle, prop, "Item Style", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_ItemStyleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ToColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ToColor2);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_CenterColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_CenterGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Opacity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TooltipFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_NumericFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_CornerRadiusToggle, m_CornerRadius, "Corner Radius", null, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_CornerRadiusToggle, m_CornerRadius))
{
ChartEditorHelper.MakeList(ref drawRect, ref this.m_CornerRadius, m_CornerRadius, false, false);
}
PropertyField(prop, "m_Color");
PropertyField(prop, "m_Color0");
PropertyField(prop, "m_ToColor");
PropertyField(prop, "m_ToColor2");
PropertyField(prop, "m_BackgroundColor");
PropertyField(prop, "m_BackgroundWidth");
PropertyField(prop, "m_CenterColor");
PropertyField(prop, "m_CenterGap");
PropertyField(prop, "m_BorderType");
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_BorderColor0");
PropertyField(prop, "m_BorderToColor");
PropertyField(prop, "m_Opacity");
PropertyField(prop, "m_TooltipFormatter");
PropertyField(prop, "m_NumericFormatter");
PropertyListField(prop, "m_CornerRadius", true);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_ItemStyleToggle, prop))
{
height += 15 * EditorGUIUtility.singleLineHeight + 14 * EditorGUIUtility.standardVerticalSpacing;
var m_CornerRadius = prop.FindPropertyRelative("m_CornerRadius");
if (ChartEditorHelper.IsToggle(m_CornerRadiusToggle, m_CornerRadius))
{
height += 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
}
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,105 +11,30 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Legend), true)]
public class LegendDrawer : PropertyDrawer
public class LegendDrawer : BasePropertyDrawer
{
private bool m_DataFoldout = false;
private bool m_IconsFoldout = false;
private int m_DataSize = 0;
private int m_IconsSize = 0;
private bool m_ShowJsonDataArea = false;
private string m_JsonDataAreaText;
private bool m_LegendModuleToggle = false;
public override string ClassName { get { return "Legend"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_SelectedMode = prop.FindPropertyRelative("m_SelectedMode");
SerializedProperty orient = prop.FindPropertyRelative("m_Orient");
SerializedProperty location = prop.FindPropertyRelative("m_Location");
SerializedProperty itemWidth = prop.FindPropertyRelative("m_ItemWidth");
SerializedProperty itemHeight = prop.FindPropertyRelative("m_ItemHeight");
SerializedProperty itemGap = prop.FindPropertyRelative("m_ItemGap");
SerializedProperty m_ItemAutoColor = prop.FindPropertyRelative("m_ItemAutoColor");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
SerializedProperty m_Icons = prop.FindPropertyRelative("m_Icons");
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_LegendModuleToggle, "Legend", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_LegendModuleToggle)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, itemWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, itemHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, itemGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemAutoColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SelectedMode);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, orient);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, location);
drawRect.y += EditorGUI.GetPropertyHeight(location);
EditorGUI.PropertyField(drawRect, m_Formatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Data");
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop, pos.width);
drawRect.width = pos.width;
if (m_DataFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_Data);
}
m_IconsFoldout = EditorGUI.Foldout(drawRect, m_IconsFoldout, "Icons");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_IconsFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_IconsSize, m_Icons);
}
EditorGUI.PropertyField(drawRect, m_TextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
PropertyField(prop, "m_IconType");
PropertyField(prop, "m_ItemWidth");
PropertyField(prop, "m_ItemHeight");
PropertyField(prop, "m_ItemGap");
PropertyField(prop, "m_ItemAutoColor");
PropertyField(prop, "m_TextAutoColor");
PropertyField(prop, "m_SelectedMode");
PropertyField(prop, "m_Orient");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_Formatter");
PropertyField(prop, "m_TextStyle");
PropertyListField(prop, "m_Icons");
PropertyListField(prop, "m_Data");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (m_LegendModuleToggle)
{
SerializedProperty location = prop.FindPropertyRelative("m_Location");
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(location);
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_DataFoldout)
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
int num = m_Data.arraySize + 1;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
if (m_IconsFoldout)
{
SerializedProperty m_Icons = prop.FindPropertyRelative("m_Icons");
int num = m_Icons.arraySize + 1;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
}
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -11,52 +11,40 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(LineArrow), true)]
public class LineArrowStyleDrawer : PropertyDrawer
[CustomPropertyDrawer(typeof(Arrow), true)]
public class ArrowDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_LineArrowToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Arrow"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Position = prop.FindPropertyRelative("m_Position");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Height = prop.FindPropertyRelative("m_Height");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_Dent = prop.FindPropertyRelative("m_Dent");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_LineArrowToggle, prop, "Line Arrow", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_LineArrowToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Position);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Height);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Dent);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Height");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_Dent");
PropertyField(prop, "m_Color");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
}
[CustomPropertyDrawer(typeof(LineArrow), true)]
public class LineArrowStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "LineArrow"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_LineArrowToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
++EditorGUI.indentLevel;
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Arrow");
--EditorGUI.indentLevel;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -0,0 +1,96 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(BaseLine), true)]
public class BaseLineDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Line"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
DrawExtendeds(prop);
PropertyField(prop, "m_LineStyle");
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(AxisLine), true)]
public class AxisLineDrawer : BaseLineDrawer
{
public override string ClassName { get { return "AxisLine"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_OnZero");
PropertyField(prop, "m_ShowArrow");
PropertyField(prop, "m_Arrow");
}
}
[CustomPropertyDrawer(typeof(AxisSplitLine), true)]
public class AxisSplitLineDrawer : BaseLineDrawer
{
public override string ClassName { get { return "SplitLine"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_Interval");
}
}
[CustomPropertyDrawer(typeof(AxisTick), true)]
public class AxisTickDrawer : BaseLineDrawer
{
public override string ClassName { get { return "AxisTick"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_AlignWithLabel");
PropertyField(prop, "m_Inside");
PropertyField(prop, "m_ShowStartTick");
PropertyField(prop, "m_ShowEndTick");
}
}
[CustomPropertyDrawer(typeof(GaugeAxisSplitLine), true)]
public class GaugeAxisSplitDrawer : BaseLineDrawer
{
public override string ClassName { get { return "Split Line"; } }
}
[CustomPropertyDrawer(typeof(GaugeAxisTick), true)]
public class GaugeAxisTickDrawer : BaseLineDrawer
{
public override string ClassName { get { return "Axis Tick"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_SplitNumber");
}
}
[CustomPropertyDrawer(typeof(GaugeAxisLine), true)]
public class GaugeAxisLineDrawer : BaseLineDrawer
{
public override string ClassName { get { return "Axis Line"; } }
protected override void DrawExtendeds(SerializedProperty prop)
{
base.DrawExtendeds(prop);
PropertyField(prop, "m_BarColor");
PropertyField(prop, "m_BarBackgroundColor");
PropertyField(prop, "m_StageColor");
}
}
}

View File

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

View File

@@ -1,59 +1,34 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(LineStyle), true)]
public class LineStyleDrawer : PropertyDrawer
public class LineStyleDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_LineStyleToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "LineStyle"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_Width = prop.FindPropertyRelative("m_Width");
SerializedProperty m_Opacity = prop.FindPropertyRelative("m_Opacity");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_LineStyleToggle, prop, "Line Style", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_LineStyleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Width);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Opacity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Color");
PropertyField(prop, "m_ToColor");
PropertyField(prop, "m_ToColor2");
PropertyField(prop, "m_Width");
PropertyField(prop, "m_Length");
PropertyField(prop, "m_Opacity");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_LineStyleToggle, prop))
{
height += 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,92 +11,21 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Location), true)]
public class LocationDrawer : PropertyDrawer
public class LocationDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Location"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty align = prop.FindPropertyRelative("m_Align");
SerializedProperty left = prop.FindPropertyRelative("m_Left");
SerializedProperty right = prop.FindPropertyRelative("m_Right");
SerializedProperty top = prop.FindPropertyRelative("m_Top");
SerializedProperty bottom = prop.FindPropertyRelative("m_Bottom");
EditorGUI.PropertyField(drawRect, align, new GUIContent("Location"));
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, top);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, bottom);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, left);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, right);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// switch ((Location.Align)align.enumValueIndex)
// {
// case Location.Align.TopCenter:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.TopLeft:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.TopRight:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomCenter:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomLeft:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomRight:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.Center:
// break;
// case Location.Align.CenterLeft:
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.CenterRight:
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// }
--EditorGUI.indentLevel;
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
return 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
// SerializedProperty align = prop.FindPropertyRelative("m_Align");
// switch ((Location.Align)align.enumValueIndex)
// {
// case Location.Align.Center:
// return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
// case Location.Align.TopCenter:
// case Location.Align.BottomCenter:
// case Location.Align.CenterLeft:
// case Location.Align.CenterRight:
// return 2 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
// default:
// return 3 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
// }
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Align"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_Left");
PropertyField(prop, "m_Right");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

View File

@@ -0,0 +1,69 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(MarkLine), true)]
public class MarkLineDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "MarkLine"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
PropertyField(prop, "m_Animation");
PropertyListField(prop, "m_Data", true);
--EditorGUI.indentLevel;
}
}
}
[CustomPropertyDrawer(typeof(MarkLineData), true)]
public class MarkLineDataDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "MarkLineData"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
{
++EditorGUI.indentLevel;
var type = (MarkLineType)(prop.FindPropertyRelative("m_Type")).enumValueIndex;
var group = prop.FindPropertyRelative("m_Group").intValue;
PropertyField(prop, "m_Type");
PropertyField(prop, "m_Name");
switch (type)
{
case MarkLineType.None:
PropertyField(prop, "m_XPosition");
PropertyField(prop, "m_YPosition");
PropertyField(prop, "m_XValue");
PropertyField(prop, "m_YValue");
break;
case MarkLineType.Min:
case MarkLineType.Max:
case MarkLineType.Average:
case MarkLineType.Median:
PropertyField(prop, "m_Dimension");
break;
}
PropertyField(prop, "m_Group");
if (group > 0 && type == MarkLineType.None) PropertyField(prop, "m_ZeroPosition");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_StartSymbol");
PropertyField(prop, "m_EndSymbol");
PropertyField(prop, "m_Label");
--EditorGUI.indentLevel;
}
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
@@ -11,39 +11,20 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Polar), true)]
public class PolarDrawer : PropertyDrawer
public class PolarDrawer : BasePropertyDrawer
{
private bool m_PolarModuleToggle = false;
public override string ClassName { get { return "Polar"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Center = prop.FindPropertyRelative("m_Center");
SerializedProperty m_Radius = prop.FindPropertyRelative("m_Radius");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_PolarModuleToggle, "Polar", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_PolarModuleToggle)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
EditorGUI.indentLevel++;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
EditorGUI.PropertyField(drawRect, m_Radius);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
++EditorGUI.indentLevel;
PropertyTwoFiled(prop, "m_Center");
PropertyField(prop, "m_Radius");
PropertyField(prop, "m_BackgroundColor");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_PolarModuleToggle)
return 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
else
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,129 +12,50 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Radar), true)]
public class RadarDrawer : PropertyDrawer
public class RadarDrawer : BasePropertyDrawer
{
SerializedProperty m_Shape;
SerializedProperty m_PositionType;
SerializedProperty m_Radius;
SerializedProperty m_SplitNumber;
SerializedProperty m_Center;
SerializedProperty m_SplitLine;
SerializedProperty m_SplitArea;
SerializedProperty m_Indicator;
SerializedProperty m_IndicatorGap;
SerializedProperty m_CeilRate;
SerializedProperty m_IndicatorList;
SerializedProperty m_IsAxisTooltip;
private Dictionary<string, bool> m_RadarModuleToggle = new Dictionary<string, bool>();
private Dictionary<string, bool> m_IndicatorToggle = new Dictionary<string, bool>();
private bool m_IndicatorJsonAreaToggle = false;
private string m_IndicatorJsonAreaText;
private int m_IndicatorSize;
private int m_BackgroundColorSize;
private void InitProperty(SerializedProperty prop)
{
m_Shape = prop.FindPropertyRelative("m_Shape");
m_PositionType = prop.FindPropertyRelative("m_PositionType");
m_Radius = prop.FindPropertyRelative("m_Radius");
m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
m_Center = prop.FindPropertyRelative("m_Center");
m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
m_Indicator = prop.FindPropertyRelative("m_Indicator");
m_IndicatorGap = prop.FindPropertyRelative("m_IndicatorGap");
m_CeilRate = prop.FindPropertyRelative("m_CeilRate");
m_IndicatorList = prop.FindPropertyRelative("m_IndicatorList");
m_IsAxisTooltip = prop.FindPropertyRelative("m_IsAxisTooltip");
}
public override string ClassName { get { return "Radar"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
InitProperty(prop);
Rect drawRect = pos;
float defaultLabelWidth = EditorGUIUtility.labelWidth;
float defaultFieldWidth = EditorGUIUtility.fieldWidth;
drawRect.height = EditorGUIUtility.singleLineHeight;
int index = ChartEditorHelper.GetIndexFromPath(prop);
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_RadarModuleToggle, prop, "Radar " + index, null, true);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_RadarModuleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUIUtility.labelWidth = defaultLabelWidth;
EditorGUIUtility.fieldWidth = defaultFieldWidth;
EditorGUI.PropertyField(drawRect, m_Shape);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_PositionType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.LabelField(drawRect, "Center");
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
var tempWidth = (pos.width - startX + 35) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - 20, drawRect.y, tempWidth, drawRect.height);
while (m_Center.arraySize < 2) m_Center.arraySize++;
EditorGUI.PropertyField(centerXRect, m_Center.GetArrayElementAtIndex(0), GUIContent.none);
EditorGUI.PropertyField(centerYRect, m_Center.GetArrayElementAtIndex(1), GUIContent.none);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Radius);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_CeilRate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IsAxisTooltip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SplitLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
EditorGUI.PropertyField(drawRect, m_SplitArea);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitArea);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_IndicatorToggle, prop, "Indicators", m_Indicator, false);
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_IndicatorJsonAreaToggle, ref m_IndicatorJsonAreaText, prop, pos.width, 20);
drawRect.width = pos.width;
drawRect.x = pos.x;
if (ChartEditorHelper.IsToggle(m_IndicatorToggle, prop))
{
EditorGUI.PropertyField(drawRect, m_IndicatorGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeList(ref drawRect, ref m_IndicatorSize, m_IndicatorList);
}
PropertyField(prop, "m_Shape");
PropertyField(prop, "m_PositionType");
PropertyTwoFiled(prop, "m_Center");
PropertyField(prop, "m_Radius");
PropertyField(prop, "m_SplitNumber");
PropertyField(prop, "m_CeilRate");
PropertyField(prop, "m_IsAxisTooltip");
PropertyField(prop, "m_OutRangeColor");
PropertyField(prop, "m_ConnectCenter");
PropertyField(prop, "m_LineGradient");
PropertyField(prop, "m_AxisLine");
PropertyField(prop, "m_SplitLine");
PropertyField(prop, "m_SplitArea");
PropertyField(prop, "m_IndicatorList");
--EditorGUI.indentLevel;
}
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
[CustomPropertyDrawer(typeof(Radar.Indicator), true)]
public class RadarIndicatorDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Indicator"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
int propNum = 1;
if (ChartEditorHelper.IsToggle(m_RadarModuleToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, ""))
{
propNum += 9;
if (m_IndicatorJsonAreaToggle) propNum += 4;
float height = propNum * EditorGUIUtility.singleLineHeight + (propNum - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitLine"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitArea"));
if (ChartEditorHelper.IsToggle(m_IndicatorToggle, prop))
{
m_IndicatorList = prop.FindPropertyRelative("m_IndicatorList");
height += EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing;
for (int i = 0; i < m_IndicatorList.arraySize; i++)
{
height += EditorGUI.GetPropertyHeight(m_IndicatorList.GetArrayElementAtIndex(i));
}
}
return height;
}
else
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
++EditorGUI.indentLevel;
PropertyField(prop, "m_Name");
PropertyField(prop, "m_Min");
PropertyField(prop, "m_Max");
PropertyTwoFiled(prop, "m_Range");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
}
}

View File

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

View File

@@ -1,64 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Radar.Indicator), true)]
public class RadarIndicatorDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_RadarModuleToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
SerializedProperty m_Name = prop.FindPropertyRelative("m_Name");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
Rect drawRect = pos;
float defaultLabelWidth = EditorGUIUtility.labelWidth;
float defaultFieldWidth = EditorGUIUtility.fieldWidth;
drawRect.height = EditorGUIUtility.singleLineHeight;
int index = ChartEditorHelper.GetIndexFromPath(prop);
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_RadarModuleToggle, prop, "Indicator " + index, m_Name, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_RadarModuleToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Name);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_RadarModuleToggle, prop))
{
var height = 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
return height;
}
else
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,24 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
[CustomPropertyDrawer(typeof(RadiusAxis), true)]
public class RadiusAxisDrawer : AxisDrawer
{
protected override string GetDisplayName(string displayName)
{
if (displayName.StartsWith("Element"))
{
displayName = displayName.Replace("Element", "Radius Axis");
}
return displayName;
}
}
}

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,413 +12,311 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Serie), true)]
public class SerieDrawer : PropertyDrawer
public class SerieDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_SerieModuleToggle = new Dictionary<string, bool>();
private bool m_IsPolar = false;
private List<bool> m_DataFoldout = new List<bool>();
private bool m_ShowJsonDataArea = false;
private string m_JsonDataAreaText;
public override string ClassName { get { return "Serie"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty type = prop.FindPropertyRelative("m_Type");
SerializedProperty name = prop.FindPropertyRelative("m_Name");
SerializedProperty stack = prop.FindPropertyRelative("m_Stack");
SerializedProperty m_AxisIndex = prop.FindPropertyRelative("m_AxisIndex");
SerializedProperty m_RadarType = prop.FindPropertyRelative("m_RadarType");
SerializedProperty m_RadarIndex = prop.FindPropertyRelative("m_RadarIndex");
SerializedProperty m_VesselIndex = prop.FindPropertyRelative("m_VesselIndex");
SerializedProperty m_MinShow = prop.FindPropertyRelative("m_MinShow");
SerializedProperty m_MaxShow = prop.FindPropertyRelative("m_MaxShow");
SerializedProperty m_MaxCache = prop.FindPropertyRelative("m_MaxCache");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
SerializedProperty m_ItemStyle = prop.FindPropertyRelative("m_ItemStyle");
SerializedProperty m_LineArrow = prop.FindPropertyRelative("m_LineArrow");
SerializedProperty m_LineType = prop.FindPropertyRelative("m_LineType");
SerializedProperty m_SampleDist = prop.FindPropertyRelative("m_SampleDist");
SerializedProperty m_SampleType = prop.FindPropertyRelative("m_SampleType");
SerializedProperty m_SampleAverage = prop.FindPropertyRelative("m_SampleAverage");
SerializedProperty m_BarType = prop.FindPropertyRelative("m_BarType");
SerializedProperty m_BarPercentStack = prop.FindPropertyRelative("m_BarPercentStack");
SerializedProperty m_BarWidth = prop.FindPropertyRelative("m_BarWidth");
SerializedProperty m_BarGap = prop.FindPropertyRelative("m_BarGap");
SerializedProperty m_BarZebraWidth = prop.FindPropertyRelative("m_BarZebraWidth");
SerializedProperty m_BarZebraGap = prop.FindPropertyRelative("m_BarZebraGap");
SerializedProperty m_AreaStyle = prop.FindPropertyRelative("m_AreaStyle");
SerializedProperty m_Symbol = prop.FindPropertyRelative("m_Symbol");
SerializedProperty m_RoseType = prop.FindPropertyRelative("m_RoseType");
SerializedProperty m_Space = prop.FindPropertyRelative("m_Space");
SerializedProperty m_Center = prop.FindPropertyRelative("m_Center");
SerializedProperty m_Radius = prop.FindPropertyRelative("m_Radius");
SerializedProperty m_Label = prop.FindPropertyRelative("m_Label");
SerializedProperty m_Emphasis = prop.FindPropertyRelative("m_Emphasis");
SerializedProperty m_Animation = prop.FindPropertyRelative("m_Animation");
SerializedProperty m_DataDimension = prop.FindPropertyRelative("m_ShowDataDimension");
SerializedProperty m_ShowDataName = prop.FindPropertyRelative("m_ShowDataName");
SerializedProperty m_ShowDataIcon = prop.FindPropertyRelative("m_ShowDataIcon");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_StartAngle = prop.FindPropertyRelative("m_StartAngle");
SerializedProperty m_EndAngle = prop.FindPropertyRelative("m_EndAngle");
SerializedProperty m_RingGap = prop.FindPropertyRelative("m_RingGap");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Clockwise = prop.FindPropertyRelative("m_Clockwise");
SerializedProperty m_RoundCap = prop.FindPropertyRelative("m_RoundCap");
SerializedProperty m_GaugeType = prop.FindPropertyRelative("m_GaugeType");
SerializedProperty m_GaugeAxis = prop.FindPropertyRelative("m_GaugeAxis");
SerializedProperty m_GaugePointer = prop.FindPropertyRelative("m_GaugePointer");
SerializedProperty m_TitleStyle = prop.FindPropertyRelative("m_TitleStyle");
SerializedProperty m_Clip = prop.FindPropertyRelative("m_Clip");
SerializedProperty m_Ignore = prop.FindPropertyRelative("m_Ignore");
SerializedProperty m_IgnoreValue = prop.FindPropertyRelative("m_IgnoreValue");
SerializedProperty m_ShowAsPositiveNumber = prop.FindPropertyRelative("m_ShowAsPositiveNumber");
SerializedProperty m_Large = prop.FindPropertyRelative("m_Large");
SerializedProperty m_LargeThreshold = prop.FindPropertyRelative("m_LargeThreshold");
SerializedProperty m_AvoidLabelOverlap = prop.FindPropertyRelative("m_AvoidLabelOverlap");
SerializedProperty m_WaveHeight = prop.FindPropertyRelative("m_WaveHeight");
SerializedProperty m_WaveLength = prop.FindPropertyRelative("m_WaveLength");
SerializedProperty m_WaveSpeed = prop.FindPropertyRelative("m_WaveSpeed");
SerializedProperty m_WaveOffset = prop.FindPropertyRelative("m_WaveOffset");
SerializedProperty m_Datas = prop.FindPropertyRelative("m_Data");
int index = InitToggle(prop);
string moduleName = "Serie " + index;
var toggle = ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieModuleToggle, prop, moduleName, show);
if (!toggle)
pos.width -= 9;
base.OnGUI(pos, prop, label);
var chart = prop.serializedObject.targetObject as BaseChart;
var type = prop.FindPropertyRelative("m_Type");
var serieType = (SerieType)type.enumValueIndex;
if (!MakeFoldout(prop, "m_Show"))
{
var orderButton = 46;
var orderButton = 48;
var gap = 4;
var drawRect = pos;
drawRect.x += EditorGUIUtility.labelWidth + gap;
drawRect.width = pos.width - drawRect.x + ChartEditorHelper.BOOL_WIDTH - orderButton;
EditorGUI.PropertyField(drawRect, type, GUIContent.none);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
type.enumValueIndex = EditorGUI.Popup(drawRect, (int)serieType, GetChartSerieTypeNames(chart));
}
else
{
var serieType = (SerieType)type.enumValueIndex;
m_IsPolar = chart is PolarChart;
++EditorGUI.indentLevel;
drawRect.x = pos.x;
drawRect.width = pos.width;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, name);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
type.enumValueIndex = EditorGUI.Popup(m_DrawRect, "Type", (int)serieType, GetChartSerieTypeNames(chart));
var hig = EditorGUI.GetPropertyHeight(prop);
m_DrawRect.y += hig;
m_Heights[m_KeyName] += hig;
PropertyField(prop, "m_InsertDataToHead");
PropertyField(prop, "m_Name");
switch (serieType)
{
case SerieType.Line:
EditorGUI.PropertyField(drawRect, stack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AxisIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxCache);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MaxCache.intValue < 0) m_MaxCache.intValue = 0;
EditorGUI.PropertyField(drawRect, m_LineType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleDist);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleAverage);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowAsPositiveNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Large);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LargeThreshold);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
EditorGUI.PropertyField(drawRect, m_LineArrow);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineArrow);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_AreaStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_AreaStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_Stack");
if (m_IsPolar)
{
PropertyField(prop, "m_PolarIndex");
}
else
{
PropertyField(prop, "m_XAxisIndex");
PropertyField(prop, "m_YAxisIndex");
}
PropertyFieldLimitMin(prop, "m_MinShow", 0);
PropertyFieldLimitMin(prop, "m_MaxShow", 0);
PropertyFieldLimitMin(prop, "m_MaxCache", 0);
PropertyField(prop, "m_LineType");
PropertyField(prop, "m_SampleDist");
PropertyField(prop, "m_SampleType");
PropertyField(prop, "m_SampleAverage");
PropertyField(prop, "m_Clip");
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_IgnoreValue");
PropertyField(prop, "m_IgnoreLineBreak");
PropertyField(prop, "m_ShowAsPositiveNumber");
PropertyField(prop, "m_Large");
PropertyField(prop, "m_LargeThreshold");
PropertyField(prop, "m_Symbol");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_LineArrow");
PropertyField(prop, "m_AreaStyle");
PropertyField(prop, "m_MarkLine");
break;
case SerieType.Bar:
EditorGUI.PropertyField(drawRect, stack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AxisIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxCache);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MaxCache.intValue < 0) m_MaxCache.intValue = 0;
EditorGUI.PropertyField(drawRect, m_BarType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarPercentStack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarZebraWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarZebraGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowAsPositiveNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Large);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LargeThreshold);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_Stack");
if (m_IsPolar)
{
PropertyField(prop, "m_PolarIndex");
}
else
{
PropertyField(prop, "m_XAxisIndex");
PropertyField(prop, "m_YAxisIndex");
}
PropertyFieldLimitMin(prop, "m_MinShow", 0);
PropertyFieldLimitMin(prop, "m_MaxShow", 0);
PropertyFieldLimitMin(prop, "m_MaxCache", 0);
PropertyField(prop, "m_BarType");
PropertyField(prop, "m_BarPercentStack");
PropertyField(prop, "m_BarWidth");
PropertyField(prop, "m_BarGap");
PropertyField(prop, "m_BarZebraWidth");
PropertyField(prop, "m_BarZebraGap");
PropertyField(prop, "m_Clip");
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_IgnoreValue");
PropertyField(prop, "m_ShowAsPositiveNumber");
PropertyField(prop, "m_Large");
PropertyField(prop, "m_LargeThreshold");
PropertyField(prop, "m_MarkLine");
break;
case SerieType.Pie:
EditorGUI.PropertyField(drawRect, m_RoseType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Space);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AvoidLabelOverlap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_RoseType");
PropertyField(prop, "m_Space");
PropertyTwoFiled(prop, "m_Center");
PropertyTwoFiled(prop, "m_Radius");
PropertyField(prop, "m_MinAngle");
PropertyField(prop, "m_RoundCap");
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_IgnoreValue");
PropertyField(prop, "m_AvoidLabelOverlap");
break;
case SerieType.Ring:
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_StartAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RingGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clockwise);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TitleStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TitleStyle);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyTwoFiled(prop, "m_Center");
PropertyTwoFiled(prop, "m_Radius");
PropertyField(prop, "m_StartAngle");
PropertyField(prop, "m_RingGap");
PropertyField(prop, "m_RoundCap");
PropertyField(prop, "m_Clockwise");
PropertyField(prop, "m_TitleStyle");
break;
case SerieType.Radar:
EditorGUI.PropertyField(drawRect, m_RadarType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RadarIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_AreaStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_AreaStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_RadarType");
PropertyField(prop, "m_RadarIndex");
PropertyField(prop, "m_Symbol");
PropertyField(prop, "m_LineStyle");
PropertyField(prop, "m_AreaStyle");
break;
case SerieType.Scatter:
case SerieType.EffectScatter:
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_Clip");
PropertyField(prop, "m_Symbol");
break;
case SerieType.Heatmap:
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_IgnoreValue");
break;
case SerieType.Gauge:
EditorGUI.PropertyField(drawRect, m_GaugeType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
//ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_Radius.GetArrayElementAtIndex(0), new GUIContent("Radius"));
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_StartAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_EndAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_SplitNumber.intValue > 36)
{
m_SplitNumber.intValue = 36;
}
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TitleStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TitleStyle);
EditorGUI.PropertyField(drawRect, m_GaugeAxis);
drawRect.y += EditorGUI.GetPropertyHeight(m_GaugeAxis);
EditorGUI.PropertyField(drawRect, m_GaugePointer);
drawRect.y += EditorGUI.GetPropertyHeight(m_GaugePointer);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
PropertyField(prop, "m_GaugeType");
PropertyTwoFiled(prop, "m_Center");
PropertyTwoFiled(prop, "m_Radius");
PropertyField(prop, "m_Min");
PropertyField(prop, "m_Max");
PropertyField(prop, "m_StartAngle");
PropertyField(prop, "m_EndAngle");
PropertyFieldLimitMax(prop, "m_SplitNumber", 36);
PropertyField(prop, "m_RoundCap");
PropertyField(prop, "m_TitleStyle");
PropertyField(prop, "m_GaugeAxis");
PropertyField(prop, "m_GaugePointer");
break;
case SerieType.Liquid:
EditorGUI.PropertyField(drawRect, m_VesselIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveLength);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveSpeed);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
PropertyField(prop, "m_VesselIndex");
PropertyField(prop, "m_Min");
PropertyField(prop, "m_Max");
PropertyField(prop, "m_WaveLength");
PropertyField(prop, "m_WaveHeight");
PropertyField(prop, "m_WaveSpeed");
PropertyField(prop, "m_WaveOffset");
break;
case SerieType.Candlestick:
PropertyField(prop, "m_XAxisIndex");
PropertyField(prop, "m_YAxisIndex");
PropertyFieldLimitMin(prop, "m_MinShow", 0);
PropertyFieldLimitMin(prop, "m_MaxShow", 0);
PropertyFieldLimitMin(prop, "m_MaxCache", 0);
PropertyField(prop, "m_BarWidth");
PropertyField(prop, "m_Clip");
PropertyField(prop, "m_ShowAsPositiveNumber");
PropertyField(prop, "m_Large");
PropertyField(prop, "m_LargeThreshold");
break;
case SerieType.Custom:
var fileds = chart.GetCustomSerieInspectorShowFileds();
if (fileds != null && fileds.Length > 0)
{
foreach (var filed in fileds)
{
PropertyField(prop, filed);
}
}
var customs = chart.GetCustomSerieInspectorCustomFileds();
if (customs != null && customs.Length > 0)
{
foreach (var custom in customs)
{
var customProp = prop.FindPropertyRelative(custom[0]);
var anatherName = custom[1] + " (" + customProp.displayName + ")";
EditorGUI.PropertyField(m_DrawRect, customProp, new GUIContent(anatherName));
m_DrawRect.y += EditorGUI.GetPropertyHeight(prop);
m_Heights[m_KeyName] += hig;
}
}
break;
}
EditorGUI.PropertyField(drawRect, m_Animation);
drawRect.y += EditorGUI.GetPropertyHeight(m_Animation);
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data");
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop, pos.width);
drawRect.width = pos.width;
if (m_DataFoldout[index])
{
EditorGUI.indentLevel++;
PropertyField(prop, "m_ItemStyle");
PropertyField(prop, "m_IconStyle");
PropertyField(prop, "m_Label");
PropertyField(prop, "m_Emphasis");
PropertyField(prop, "m_Animation");
DrawData(pos, prop, serieType, ref m_DrawRect);
--EditorGUI.indentLevel;
}
}
float nameWid = 45;
private string[] GetChartSerieTypeNames(BaseChart chart)
{
var list = System.Enum.GetNames(typeof(SerieType));
for (int i = 0; i < list.Length; i++)
{
if (list[i].Equals("Custom"))
{
var customName = chart.GetCustomSerieTypeName();
if (!string.IsNullOrEmpty(customName))
{
list[i] = customName;
}
}
}
return list;
}
private void DrawData(Rect pos, SerializedProperty prop, SerieType serieType, ref Rect drawRect)
{
SerializedProperty m_Datas = prop.FindPropertyRelative("m_Data");
SerializedProperty m_DataDimension = prop.FindPropertyRelative("m_ShowDataDimension");
SerializedProperty m_ShowDataName = prop.FindPropertyRelative("m_ShowDataName");
SerializedProperty m_ShowDataIcon = prop.FindPropertyRelative("m_ShowDataIcon");
int index = InitToggle(prop);
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data", true);
drawRect.width = pos.width;
AddSingleLineHeight();
if (m_DataFoldout[index])
{
EditorGUI.indentLevel++;
float nameWid = 45;
#if UNITY_2019_3_OR_NEWER
var gap = 2;
var namegap = 3;
#else
var gap = 0;
var namegap = 0;
var gap = 0;
var namegap = 0;
#endif
EditorGUI.PropertyField(new Rect(drawRect.x, drawRect.y, pos.width - 2 * nameWid - 2, pos.height), m_DataDimension);
var nameRect = new Rect(pos.width - 2 * nameWid + 14 + gap, drawRect.y, nameWid - gap, pos.height);
if (GUI.Button(nameRect, new GUIContent("Name")))
{
m_ShowDataName.boolValue = !m_ShowDataName.boolValue;
}
var iconRect = new Rect(pos.width - nameWid + 14, drawRect.y, nameWid + namegap, pos.height);
if (GUI.Button(iconRect, new GUIContent("More...")))
{
m_ShowDataIcon.boolValue = !m_ShowDataIcon.boolValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
var listSize = m_Datas.arraySize;
listSize = EditorGUI.IntField(drawRect, "Size", listSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (listSize < 0) listSize = 0;
if (m_DataDimension.intValue < 1) m_DataDimension.intValue = 1;
int dimension = m_DataDimension.intValue;
bool showName = m_ShowDataName.boolValue;
bool showIcon = m_ShowDataIcon.boolValue;
bool showSelected = (serieType == SerieType.Pie);
if (listSize != m_Datas.arraySize)
{
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
}
if (listSize > 30)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
if (num >= 10)
{
EditorGUI.LabelField(drawRect, "...");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, listSize - 1, pos.width);
}
}
else
{
for (int i = 0; i < m_Datas.arraySize; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
}
drawRect.y += EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
EditorGUI.PropertyField(new Rect(drawRect.x, drawRect.y, pos.width - 2 * nameWid - 2, pos.height),
m_DataDimension);
var nameRect = new Rect(pos.width - 2 * nameWid + 14 + gap, drawRect.y, nameWid - gap, pos.height);
if (XChartsSettings.editorBlockEnable)
{
nameRect.x += ChartEditorHelper.BLOCK_WIDTH;
}
--EditorGUI.indentLevel;
if (GUI.Button(nameRect, new GUIContent("name")))
{
m_ShowDataName.boolValue = !m_ShowDataName.boolValue;
}
var iconRect = new Rect(pos.width - nameWid + 14, drawRect.y, nameWid + namegap, pos.height);
if (XChartsSettings.editorBlockEnable)
{
iconRect.x += ChartEditorHelper.BLOCK_WIDTH;
}
if (GUI.Button(iconRect, new GUIContent("more")))
{
m_ShowDataIcon.boolValue = !m_ShowDataIcon.boolValue;
}
var jsonRect = new Rect(pos.width - 70, drawRect.y - pos.height - 2, 90, pos.height);
if (GUI.Button(jsonRect, new GUIContent("data from json")))
{
PraseJsonDataEditor.chart = prop.serializedObject.targetObject as BaseChart;
PraseJsonDataEditor.serieIndex = index;
PraseJsonDataEditor.ShowWindow();
}
AddSingleLineHeight();
var listSize = m_Datas.arraySize;
listSize = EditorGUI.IntField(drawRect, "Size", listSize);
AddSingleLineHeight();
if (listSize < 0) listSize = 0;
if (m_DataDimension.intValue < 1) m_DataDimension.intValue = 1;
int dimension = m_DataDimension.intValue;
bool showName = m_ShowDataName.boolValue;
bool showIcon = m_ShowDataIcon.boolValue;
bool showSelected = (serieType == SerieType.Pie);
if (listSize != m_Datas.arraySize)
{
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
}
if (listSize > 30 && !XChartsSettings.editorShowAllListData)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
if (num >= 10)
{
EditorGUI.LabelField(drawRect, "...");
AddSingleLineHeight();
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, listSize - 1, pos.width);
}
}
else
{
for (int i = 0; i < m_Datas.arraySize; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
}
AddHeight(EditorGUIUtility.standardVerticalSpacing);
EditorGUI.indentLevel--;
}
}
@@ -449,7 +347,7 @@ namespace XCharts
{
drawRect.width = drawRect.width - 18;
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + index));
drawRect.x = currentWidth - 45;
drawRect.x = currentWidth - 40;
EditorGUI.PropertyField(drawRect, selected, GUIContent.none);
drawRect.x = lastX;
drawRect.width = lastWid;
@@ -458,7 +356,7 @@ namespace XCharts
{
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + index));
}
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
AddHeight(EditorGUI.GetPropertyHeight(element));
}
else
{
@@ -473,7 +371,7 @@ namespace XCharts
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15 + gap;
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 4;
var xWid = dataWid - 2;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
@@ -494,8 +392,7 @@ namespace XCharts
drawRect.width = dataWid + 40 + dimension * namegap;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
AddSingleLineHeight();
drawRect.x = lastX;
drawRect.width = lastWid;
EditorGUIUtility.fieldWidth = lastFieldWid;
@@ -504,6 +401,10 @@ namespace XCharts
if (showDetail)
{
EditorGUI.indentLevel += 2;
var m_Ignore = serieData.FindPropertyRelative("m_Ignore");
var m_Selected = serieData.FindPropertyRelative("m_Selected");
var m_Id = serieData.FindPropertyRelative("m_Id");
var m_EnableIcon = serieData.FindPropertyRelative("m_EnableIconStyle");
var m_Icon = serieData.FindPropertyRelative("m_IconStyle");
var m_EnableLabel = serieData.FindPropertyRelative("m_EnableLabel");
var m_Label = serieData.FindPropertyRelative("m_Label");
@@ -513,150 +414,31 @@ namespace XCharts
var m_Emphasis = serieData.FindPropertyRelative("m_Emphasis");
var m_EnableSymbol = serieData.FindPropertyRelative("m_EnableSymbol");
var m_Symbol = serieData.FindPropertyRelative("m_Symbol");
EditorGUI.PropertyField(drawRect, m_Ignore);
AddHeight(EditorGUI.GetPropertyHeight(m_Ignore));
EditorGUI.PropertyField(drawRect, m_Selected);
AddHeight(EditorGUI.GetPropertyHeight(m_Selected));
EditorGUI.PropertyField(drawRect, m_Id);
AddHeight(EditorGUI.GetPropertyHeight(m_Id));
EditorGUI.PropertyField(drawRect, m_Icon);
drawRect.y += EditorGUI.GetPropertyHeight(m_Icon);
ChartEditorHelper.MakeBool(drawRect, m_EnableIcon, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_Icon));
EditorGUI.PropertyField(drawRect, m_Symbol);
ChartEditorHelper.MakeBool(drawRect, m_EnableSymbol, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
AddHeight(EditorGUI.GetPropertyHeight(m_Symbol));
EditorGUI.PropertyField(drawRect, m_Label);
ChartEditorHelper.MakeBool(drawRect, m_EnableLabel, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
AddHeight(EditorGUI.GetPropertyHeight(m_Label));
EditorGUI.PropertyField(drawRect, m_ItemStyle);
ChartEditorHelper.MakeBool(drawRect, m_EnableItemStyle, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
AddHeight(EditorGUI.GetPropertyHeight(m_ItemStyle));
EditorGUI.PropertyField(drawRect, m_Emphasis);
ChartEditorHelper.MakeBool(drawRect, m_EnableEmphasis, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
AddHeight(EditorGUI.GetPropertyHeight(m_Emphasis));
EditorGUI.indentLevel -= 2;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int index = InitToggle(prop);
if (!m_SerieModuleToggle.ContainsKey(prop.propertyPath) || !m_SerieModuleToggle[prop.propertyPath])
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
SerializedProperty type = prop.FindPropertyRelative("m_Type");
var serieType = (SerieType)type.enumValueIndex;
switch (serieType)
{
case SerieType.Line:
height += 19 * EditorGUIUtility.singleLineHeight + 18 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineArrow"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Bar:
height += 21 * EditorGUIUtility.singleLineHeight + 20 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Pie:
height += 12 * EditorGUIUtility.singleLineHeight + 11 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Ring:
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TitleStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Radar:
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Scatter:
case SerieType.EffectScatter:
height += 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Heatmap:
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Gauge:
height += 13 * EditorGUIUtility.singleLineHeight + 12 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TitleStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_GaugeAxis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_GaugePointer"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Liquid:
height += 11 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
}
if (m_DataFoldout[index])
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
int num = m_Data.arraySize;
if (num > 30)
{
num = 11;
height += (num + 1) * EditorGUIUtility.singleLineHeight + (num) * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += (num) * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
}
height += EditorGUIUtility.standardVerticalSpacing;
if (prop.FindPropertyRelative("m_ShowDataIcon").boolValue)
{
for (int i = 0; i < num; i++)
{
var item = m_Data.GetArrayElementAtIndex(i);
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_IconStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Emphasis"));
}
}
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
private int InitToggle(SerializedProperty prop)
{
int index = 0;
@@ -667,7 +449,7 @@ namespace XCharts
var str = prop.propertyPath.Substring(sindex + 1, eindex - sindex - 1);
int.TryParse(str, out index);
}
if (index >= m_DataFoldout.Count)
while (index >= m_DataFoldout.Count)
{
m_DataFoldout.Add(false);
}

View File

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

View File

@@ -1,123 +1,48 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(SerieLabel), true)]
public class SerieLabelDrawer : PropertyDrawer
public class SerieLabelDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_SerieLabelToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Label"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Position = prop.FindPropertyRelative("m_Position");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_Margin = prop.FindPropertyRelative("m_Margin");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight");
SerializedProperty m_PaddingTopBottom = prop.FindPropertyRelative("m_PaddingTopBottom");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_BackgroundWidth = prop.FindPropertyRelative("m_BackgroundWidth");
SerializedProperty m_BackgroundHeight = prop.FindPropertyRelative("m_BackgroundHeight");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
SerializedProperty m_Line = prop.FindPropertyRelative("m_Line");
SerializedProperty m_LineType = prop.FindPropertyRelative("m_LineType");
SerializedProperty m_LineColor = prop.FindPropertyRelative("m_LineColor");
SerializedProperty m_LineWidth = prop.FindPropertyRelative("m_LineWidth");
SerializedProperty m_LineLength1 = prop.FindPropertyRelative("m_LineLength1");
SerializedProperty m_LineLength2 = prop.FindPropertyRelative("m_LineLength2");
SerializedProperty m_Border = prop.FindPropertyRelative("m_Border");
SerializedProperty m_BorderWidth = prop.FindPropertyRelative("m_BorderWidth");
SerializedProperty m_BorderColor = prop.FindPropertyRelative("m_BorderColor");
SerializedProperty m_NumericFormatter = prop.FindPropertyRelative("m_NumericFormatter");
SerializedProperty m_AutoOffset = prop.FindPropertyRelative("m_AutoOffset");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieLabelToggle, prop, null, show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_SerieLabelToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Position);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
EditorGUI.PropertyField(drawRect, m_AutoOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Margin);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_NumericFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Rotate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_PaddingLeftRight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_PaddingTopBottom);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Border);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Line);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineLength1);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineLength2);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Position");
PropertyField(prop, "m_Offset");
PropertyField(prop, "m_AutoOffset");
PropertyField(prop, "m_Margin");
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_Border");
PropertyField(prop, "m_BorderWidth");
PropertyField(prop, "m_BorderColor");
PropertyField(prop, "m_Line");
PropertyField(prop, "m_LineType");
PropertyField(prop, "m_LineColor");
PropertyField(prop, "m_LineWidth");
PropertyField(prop, "m_LineGap");
PropertyField(prop, "m_LineLength1");
PropertyField(prop, "m_LineLength2");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_SerieLabelToggle, prop))
{
height += 24 * EditorGUIUtility.singleLineHeight + 23 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
}
else
{
height = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
@@ -12,92 +12,47 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(SerieSymbol), true)]
public class SerieSymbolDrawer : PropertyDrawer
public class SerieSymbolDrawer : BasePropertyDrawer
{
private Dictionary<string, bool> m_SerieSymbolToggle = new Dictionary<string, bool>();
public override string ClassName { get { return "Symbol"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_SizeType = prop.FindPropertyRelative("m_SizeType");
SerializedProperty m_Size = prop.FindPropertyRelative("m_Size");
SerializedProperty m_SelectedSize = prop.FindPropertyRelative("m_SelectedSize");
SerializedProperty m_DataIndex = prop.FindPropertyRelative("m_DataIndex");
SerializedProperty m_DataScale = prop.FindPropertyRelative("m_DataScale");
SerializedProperty m_SelectedDataScale = prop.FindPropertyRelative("m_SelectedDataScale");
SerializedProperty m_StartIndex = prop.FindPropertyRelative("m_StartIndex");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_ForceShowLast = prop.FindPropertyRelative("m_ForceShowLast");
SerializedProperty m_Gap = prop.FindPropertyRelative("m_Gap");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieSymbolToggle, prop, null, m_Show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_SerieSymbolToggle, prop))
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Gap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SizeType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
SerieSymbolSizeType sizeType = (SerieSymbolSizeType)m_SizeType.enumValueIndex;
switch (sizeType)
var type = (SerieSymbolType)prop.FindPropertyRelative("m_Type").enumValueIndex;
PropertyField(prop, "m_Type");
if (type == SerieSymbolType.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 ((SerieSymbolSizeType)prop.FindPropertyRelative("m_SizeType").enumValueIndex)
{
case SerieSymbolSizeType.Custom:
EditorGUI.PropertyField(drawRect, m_Size);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SelectedSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Size");
PropertyField(prop, "m_SelectedSize");
break;
case SerieSymbolSizeType.FromData:
EditorGUI.PropertyField(drawRect, m_DataIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_DataScale);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SelectedDataScale);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_DataIndex");
PropertyField(prop, "m_DataScale");
PropertyField(prop, "m_SelectedDataScale");
break;
case SerieSymbolSizeType.Callback:
break;
}
EditorGUI.PropertyField(drawRect, m_StartIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Interval);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ForceShowLast);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_StartIndex");
PropertyField(prop, "m_Interval");
PropertyField(prop, "m_ForceShowLast");
PropertyField(prop, "m_Repeat");
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_SerieSymbolToggle, prop))
{
SerializedProperty m_SizeType = prop.FindPropertyRelative("m_SizeType");
SerieSymbolSizeType sizeType = (SerieSymbolSizeType)m_SizeType.enumValueIndex;
var hig = 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
switch (sizeType)
{
case SerieSymbolSizeType.Custom:
break;
case SerieSymbolSizeType.FromData:
hig += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
break;
case SerieSymbolSizeType.Callback:
break;
}
return hig;
}
else
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

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

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