Compare commits

...

547 Commits

Author SHA1 Message Date
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
monitor1394
e82ee56b7f 发布v1.6.0版本 2020-08-24 22:49:47 +08:00
monitor1394
2c1c50c72b 更新问答29 2020-08-24 09:23:28 +08:00
monitor1394
f290ca2ba6 升级颜色配置到新版本 2020-08-24 09:19:11 +08:00
monitor1394
c9d11b3ab8 优化UpgradeChartColor 2020-08-24 09:18:56 +08:00
monitor1394
411695d0dd 优化UpgradeChartColor 2020-08-24 09:10:22 +08:00
monitor1394
ea62d03142 更新文档 2020-08-23 15:41:11 +08:00
monitor1394
c2aa222bbd 更新文档 2020-08-23 15:34:00 +08:00
monitor1394
872020e729 增加升级颜色配置脚本UpgradeChartColor 2020-08-23 15:31:22 +08:00
monitor1394
951c3fe16c 重构代码,将与绘制相关的Color改为Color32,减少隐式转换 2020-08-23 14:31:26 +08:00
monitor1394
85e8b17171 修复动画问题 2020-08-19 09:11:23 +08:00
monitor1394
b2cba25a1e 性能优化 2020-08-18 09:29:23 +08:00
monitor1394
2cc01d4101 优化PieChart绘制表现效果#85 2020-08-15 08:52:25 +08:00
monitor1394
dbbe6de544 修复serieData的Label设置numericFormatter无效的问题 2020-08-13 12:29:24 +08:00
monitor1394
18be460bee 优化BarChart的数据变更动画#83 2020-08-13 09:05:21 +08:00
monitor1394
c1c7312f2c 增加LiquidChart数据变更动画#83 2020-08-11 09:25:28 +08:00
monitor1394
342337c13e Merge pull request #86 from Bian-Sh/master
ToolTips formatter 数值的格式化支持 0.##
2020-08-11 08:57:27 +08:00
monitor1394
0849b359ce 优化PieChart文本堆叠和引线效果#85 2020-08-11 08:47:20 +08:00
雨落随风
2eeec329b2 Update Tooltip.cs
更新对 Tooltips.formatter 的描述
2020-08-09 18:17:52 +08:00
雨落随风
ef10fd987c Tooltips 支持 ToString 中的格式 “0.##”
本次更新用于改善ToString("f2") 出现 100.00%的情况,“#”代表后面不是0就被保留,反之去掉,也就不会出现100.00%的情况
2020-08-09 18:10:33 +08:00
monitor1394
b52105e798 优化LineChart密集数据的绘制表现 2020-08-08 17:14:33 +08:00
monitor1394
fe15760aab 优化LineChart数据密集时的绘制效果 2020-07-31 23:27:20 +08:00
monitor1394
3c3730db44 优化RadarChart#77 2020-07-31 22:36:34 +08:00
monitor1394
fa118d93f8 增加LineChart可通过VisualMapItemStyle配置渐变#78 2020-07-30 09:31:44 +08:00
monitor1394
04507ee863 修复LiquidChart渐出动画问题 2020-07-27 08:59:42 +08:00
monitor1394
2c25af3694 修复折线图在开启动画时可能不绘制线条的问题 2020-07-26 08:56:45 +08:00
monitor1394
87d7668768 修复LineChart渐出动画绘制异常的问题#79 2020-07-25 19:20:14 +08:00
monitor1394
d17a306f7c 优化LiquidChart满时的绘制表现 2020-07-25 18:33:09 +08:00
monitor1394
6a88d899b7 修复LiquidChart100%时渐变色会失效的问题 2020-07-25 14:38:15 +08:00
monitor1394
2a42bcfbef 增加RadarChartTooltipformatter支持#77 2020-07-25 14:09:57 +08:00
monitor1394
af8765734c 增加RingChart环形渐变支持 2020-07-23 12:53:10 +08:00
monitor1394
3a3c79c3cc 增加RingChart环形渐变支持#75 2020-07-23 12:52:06 +08:00
monitor1394
2cafbc7706 增加AxisLabelSerieLabelformatter可单独配置数值格式化#68 2020-07-21 09:13:51 +08:00
monitor1394
3860d1c862 增加动画完成回调接口 2020-07-17 12:19:21 +08:00
monitor1394
5818c3404f 优化Chart放在ScrollView下时不影响ScrollView的滚动和拖动 2020-07-17 09:26:01 +08:00
monitor1394
87511da0c4 完善文档 2020-07-17 08:53:06 +08:00
monitor1394
ebceea3491 完善文档 2020-07-17 08:52:32 +08:00
monitor1394
fe1c11fc5d Fixed a problem with Tooltip that would also show up if it was blocked on top. 修复Tooltip在上层有遮挡还会显示的问题#74 2020-07-16 09:16:36 +08:00
monitor1394
64178ef88d 完善文档 2020-07-15 09:11:35 +08:00
monitor1394
7c95d2d8b8 整理文档 2020-07-11 07:52:08 +08:00
monitor1394
7144f1a2af 更新文档 2020-07-10 12:33:10 +08:00
monitor1394
70a27f2aca test markdown link 2020-07-10 12:29:49 +08:00
monitor1394
7a90b6c943 整理文档 2020-07-10 09:36:56 +08:00
monitor1394
b59c0c790c 整理文档 2020-07-10 09:20:46 +08:00
monitor1394
6da8784102 整理文档 2020-07-10 09:13:26 +08:00
monitor1394
c2c6b87b2c 优化Scatter类型Serie支持Log轴#68 2020-07-08 09:32:49 +08:00
monitor1394
158e56abdf 优化Scatter类型的Serie支持Log 2020-07-08 09:31:11 +08:00
monitor1394
67fc201e83 优化Scatter类型的Serie支持Log轴#68 2020-07-08 09:22:47 +08:00
monitor1394
d66f22ddc8 优化Scatter类型的Serie支持Log 2020-07-08 09:15:28 +08:00
monitor1394
aed0485ba7 修复SerieLabel位置错乱的问题 2020-07-07 07:29:45 +08:00
monitor1394
bd65007851 增加Tooltipoffset参数配置偏移 2020-07-07 07:16:01 +08:00
monitor1394
aa2f90d048 整理重构代码 2020-07-07 06:53:02 +08:00
monitor1394
d343ff9d07 更新文档 2020-07-06 09:09:24 +08:00
monitor1394
fe8fa90625 增加LiquidChart水位图 2020-07-06 08:41:28 +08:00
monitor1394
cc23df6821 优化PolarChartTooltip 2020-07-02 09:44:25 +08:00
monitor1394
d6859f5543 增加PolarChartclockwise是否顺时针支持 2020-07-02 07:31:32 +08:00
monitor1394
b6139514f5 增加PolarChart极坐标图表 2020-07-01 09:38:00 +08:00
monitor1394
9e48c23225 发布v1.5.2版本 2020-06-25 21:18:20 +08:00
monitor1394
5cf93b6111 add asmref 2020-06-25 21:14:25 +08:00
monitor1394
a3aa610d57 修复BarChart在数值为0时还会绘制一小部分柱条的问题 2020-06-25 21:07:17 +08:00
monitor1394
ce69581a3a 优化折线图绘制效果 2020-06-24 12:50:36 +08:00
monitor1394
523067ad58 优化LineChart的堆叠区域半透明绘制效果 2020-06-24 09:23:35 +08:00
monitor1394
e67bab471c Merge branch 'master' of https://github.com/monitor1394/unity-ugui-XCharts 2020-06-24 09:09:14 +08:00
monitor1394
10fe66fcb8 修复PieChart在设置clockwise后绘制异常的问题#65 2020-06-24 09:09:08 +08:00
monitor1394
1639dcd4ee 修复PieChart在设置clockwise后绘制异常的问题 2020-06-24 09:06:39 +08:00
monitor1394
b8bb3abac7 完善Demo 2020-06-23 12:34:55 +08:00
monitor1394
75a58c6975 优化LineChart在峰谷差异过大时的绘制效果#64 2020-06-23 12:21:27 +08:00
monitor1394
eb9da8210e 修复SerieLabel在重新添加数据时可能不显示的问题 2020-06-18 08:57:11 +08:00
monitor1394
04c69ea9e0 增加SerieData可单独设置SerieSymbol#66 2020-06-17 12:46:04 +08:00
monitor1394
02a5b45e10 修复Check For UpdateUnity 2018部分版本报错的问题#63 2020-06-17 07:00:07 +08:00
monitor1394
5835a372f5 增加SerieavoidLabelOverlap参数避免饼图标签堆叠的情况#56 2020-06-16 09:33:34 +08:00
monitor1394
590a13688d 修复SerieLabel可能显示错乱的问题 2020-06-15 08:56:30 +08:00
monitor1394
45dede8aee 优化Tooltip 2020-06-14 18:16:23 +08:00
monitor1394
e77c9fd327 优化Tooltip 2020-06-14 17:04:50 +08:00
monitor1394
d694c5d9f1 整理代码更新文档 2020-06-12 09:22:51 +08:00
monitor1394
30b6b061e6 优化Tooltip 2020-06-11 12:48:00 +08:00
monitor1394
a65ad893eb 修复Check warning不生效的问题 2020-06-11 09:24:33 +08:00
monitor1394
77fd92d2b0 修复饼图和环形图占比很小时不显示的问题 2020-06-11 08:39:15 +08:00
monitor1394
8c759fd94d 增加TooltiptitleFormatter支持配置占位符{i}表示忽略不显示标题 2020-06-11 07:44:11 +08:00
monitor1394
536cccbfaf 修复Editor下Serie的Data在多维数据下编辑异常的问题#62 2020-06-11 07:32:01 +08:00
monitor1394
64568ce2cc 关闭部分组件的raycastTarget 2020-06-11 06:59:16 +08:00
monitor1394
22ca68e04a 修复SerieData回收时部分配置没有重置的问题 2020-06-10 13:10:24 +08:00
monitor1394
63fd4c81b4 优化Legend的布局 2020-06-09 09:24:08 +08:00
monitor1394
c77d13f5db 增加AnimationcustomFadeInDelay等自定义数据项延时和时长回调函数 2020-06-09 06:57:37 +08:00
monitor1394
63fb591b46 增加QA:为什么serie里设置的参数运行后又被重置了 2020-06-08 07:15:28 +08:00
monitor1394
f93355e6c4 修复图例判断超范围异常的问题 2020-06-07 18:22:57 +08:00
monitor1394
53e988e8d2 优化PieChart在数据全为0时的显示为等份的效果 2020-06-07 07:16:24 +08:00
monitor1394
a2e1cd9840 更新文档 2020-06-05 09:27:51 +08:00
monitor1394
9b0165b291 重构代码,增加BaseGraph基类 2020-06-05 08:52:36 +08:00
monitor1394
91a7c88ea1 增加SerieLabelautoOffset参数设置是否自动判断上下偏移 2020-06-04 12:33:25 +08:00
monitor1394
384c6a842e 增加TooltipalwayShow参数设置触发后一直显示 2020-06-04 07:46:07 +08:00
monitor1394
6590b70db6 优化Tooltipformatter支持{.1}类型的通配符 2020-06-04 07:22:58 +08:00
monitor1394
930fb59755 优化Legend数量过多时自动换行显示 2020-06-04 07:06:41 +08:00
monitor1394
8851e54266 修复Single类型的RadarChart设置ceilRate不生效的问题 2020-06-03 12:27:34 +08:00
monitor1394
e597ab7d3f 发布v1.5.1版本 2020-06-03 06:39:58 +08:00
monitor1394
e1ed738ec9 完善文档 2020-06-02 21:55:41 +08:00
monitor1394
5811ebfda1 增加RadarceilRate,设置最大最小值的取整倍率 2020-06-02 20:20:56 +08:00
monitor1394
c897d78a79 优化Tooltipformatter,支持{c1:1-1:f1}格式配置 2020-06-02 12:37:14 +08:00
monitor1394
9a300dc531 修复背景组件初始化时报错的问题 2020-06-01 12:38:59 +08:00
monitor1394
68cccdec32 优化Background组件的生效条件,需要有单独的父节点 2020-05-31 07:43:29 +08:00
monitor1394
bc6e5675e9 修复Editor下点击Data后数据会多一维的问题 2020-05-30 18:04:01 +08:00
monitor1394
c08367fdac 优化PieChart支持设置ignoreValue不显示指定数据 2020-05-30 10:27:54 +08:00
monitor1394
36200c7386 修复RadarChartCircle时不绘制SplitArea的问题 2020-05-30 09:49:28 +08:00
monitor1394
2c5577f534 优化RadarChart在设置max0时可自动刷新最大值 2020-05-30 09:41:46 +08:00
monitor1394
b9a11845ef 隐藏RadarChart的indicator节点 2020-05-29 08:45:25 +08:00
monitor1394
bacec6dec2 修复PieChart设置space时只有一个数据时绘制异常的问题 2020-05-29 08:35:46 +08:00
monitor1394
af0cc9988b 修复调用UpdateDataName()接口时不会自动刷新的问题 2020-05-29 07:52:21 +08:00
monitor1394
b0aad6405c add ingnore file 2020-05-29 07:10:55 +08:00
monitor1394
738173fe7c 优化圆角绘制 2020-05-28 08:41:10 +08:00
monitor1394
b4a127511c 修复调用UpdateDataName()接口时不会自动刷新的问题 2020-05-27 09:28:50 +08:00
monitor1394
e8eb8a5468 优化柱状图的渐变色效果 2020-05-27 09:09:45 +08:00
monitor1394
3db8eba92c 修复Axis设置boundaryGapAxisTickalignWithLabelTick绘制异常的问题 2020-05-24 18:33:05 +08:00
monitor1394
463305a63e 优化版本更新检测 2020-05-24 08:06:40 +08:00
monitor1394
51f3558b55 在package.json中增加版本更新信息 2020-05-24 08:02:14 +08:00
monitor1394
b56099ad2e 发布v1.5.0版本 2020-05-22 12:51:18 +08:00
monitor1394
f3ec7dc196 优化serie的显示和隐藏处理 2020-05-22 09:01:27 +08:00
monitor1394
382c976f02 调整DebugMode的显示位置 2020-05-22 08:36:49 +08:00
monitor1394
5d85fdb7f9 修复背景组件可能显示在最前面的问题 2020-05-22 08:33:30 +08:00
monitor1394
314362321d 修复圆角绘制异常的问题 2020-05-22 08:25:57 +08:00
monitor1394
a0fd70372f 增加圆角柱图支持渐变 2020-05-21 13:15:14 +08:00
monitor1394
47c8f76252 优化柱状图圆角支持设置百分比 2020-05-21 09:20:01 +08:00
monitor1394
7191f8a5ad 修复CovertXYAxis在2019版本上不会自动刷新的问题 2020-05-21 09:19:32 +08:00
monitor1394
18d02be719 增加Background背景组件 2020-05-21 08:32:52 +08:00
monitor1394
40a1a0cbf6 更新Demo 2020-05-19 09:13:40 +08:00
monitor1394
2f61dfd9bd 隐藏Hierarchy试图下自动生成的子节点 2020-05-19 09:11:06 +08:00
monitor1394
a2394a506c 优化反转下的箭头表现 2020-05-19 08:51:51 +08:00
monitor1394
eabf202755 修复折线图箭头绘制异常的问题 2020-05-19 07:40:56 +08:00
monitor1394
738bee9ed5 优化轴线显示箭头时的轴长绘制 2020-05-19 07:23:08 +08:00
monitor1394
16377cabfa 增加chartName检测 2020-05-19 07:08:57 +08:00
monitor1394
c8165c896e 增加chartName属性可指定图表的别称 2020-05-18 07:36:01 +08:00
monitor1394
54103be0f8 重构代码 2020-05-17 20:36:14 +08:00
monitor1394
7432f75f2f 增加部分鼠标事件回调 2020-05-16 20:33:01 +08:00
monitor1394
55c374c07f 更新教程 2020-05-15 07:44:35 +08:00
monitor1394
f476c2c907 优化内置的示例代码,Demo改名为Example 2020-05-15 06:52:40 +08:00
monitor1394
897d596174 优化demo 2020-05-13 22:38:10 +08:00
monitor1394
2859496156 修复Axis设置interval时AxisLabel不及时刷新的问题 2020-05-13 22:37:36 +08:00
monitor1394
2c420ac336 更新文档 2020-05-13 10:15:34 +08:00
monitor1394
2e2a16bbf4 更新文档 2020-05-13 10:08:47 +08:00
monitor1394
d3484d6283 完善Demo,增加性能演示Demo 2020-05-13 09:58:09 +08:00
monitor1394
9990f54edd 优化性能,优化折线图和柱状图的大数据绘制,重构代码 2020-05-13 09:54:40 +08:00
monitor1394
b234a53b73 修复自由锚点兼容的问题 2020-05-12 14:09:26 +08:00
monitor1394
8916cb5250 优化SerieLabelPool 2020-05-10 14:52:52 +08:00
monitor1394
a178858b85 优化代码,修复报错 2020-05-10 00:20:40 +08:00
monitor1394
00ce32fffd 性能优化 2020-05-09 09:42:41 +08:00
monitor1394
898f1bd563 优化version显示格式 2020-05-07 12:37:28 +08:00
monitor1394
c0cd81bf6f 处理UnityWebRequest版本兼容问题 2020-05-05 16:31:21 +08:00
monitor1394
41d01f0555 优化numericFormatter 2020-05-04 14:25:02 +08:00
monitor1394
b333a87f04 增加numericFormatter参数可配置数值格式化显示,去掉forceENotation参数 2020-05-04 13:29:56 +08:00
monitor1394
00d139d553 修复动态数据时Y轴Label不刷新的问题 2020-04-29 14:22:18 +08:00
monitor1394
f4f1bb4b54 增加自由锚点支持,任意对齐方式 2020-04-28 12:28:05 +08:00
monitor1394
e512d27784 优化GaugeChart和RingChart的label初始化 2020-04-24 12:34:20 +08:00
monitor1394
6cdeb2516b 增加Tooltipformatter{.}{c:0}{c1:1}的支持 2020-04-23 13:07:49 +08:00
monitor1394
6d64156db4 完善demo 2020-04-20 08:05:28 +08:00
monitor1394
a66b8a576c 优化LineChart折线图的区域填充渐变效果 2020-04-19 23:17:35 +08:00
monitor1394
839e1fe9d1 增加AxisLabelonZero参数可将Label显示在0刻度上 2020-04-19 22:08:40 +08:00
monitor1394
c64653cab8 增加SerieAxisLabelshowAsPositiveNumber参数将负数数值显示为正数 2020-04-19 11:08:48 +08:00
monitor1394
3df6465764 优化坐标系外裁剪 2020-04-19 10:03:45 +08:00
monitor1394
b689a18a01 优化柱状图绘制 2020-04-18 23:38:42 +08:00
monitor1394
20886dd1d5 增加Covert XY Axis互换XY轴配置 2020-04-18 12:31:21 +08:00
monitor1394
0e892fbb55 增加Axis可通过inverse参数设置坐标轴反向 2020-04-18 08:19:17 +08:00
monitor1394
6290b9ae91 修复PieChart在设置Space参数后动画绘制异常的问题 2020-04-16 09:36:03 +08:00
monitor1394
753b1d5b2b 修复Check warningUnity2019.3上的显示问题 2020-04-16 08:53:10 +08:00
monitor1394
97a81b7816 修复PieChart在设置Space参数后动画绘制异常的问题 2020-04-16 08:38:36 +08:00
monitor1394
1a0412a984 发布v1.4.0版本 2020-04-11 22:44:50 +08:00
monitor1394
0dde0217f9 整理代码 2020-04-11 20:41:39 +08:00
monitor1394
cc0187291e 增加Check warning检测功能 2020-04-11 15:18:34 +08:00
monitor1394
90f5c1ef8a 优化Legend初始化,防止出现预设下删除异常的问题 2020-04-10 07:32:59 +08:00
monitor1394
b3e9e8833c 优化版本检测 2020-04-09 08:02:46 +08:00
monitor1394
772701a549 修复Legend初始化异常的问题 2020-04-09 07:26:40 +08:00
monitor1394
bef00f18e1 修复仪表盘绘制异常的问题 2020-04-08 12:59:35 +08:00
monitor1394
72cf428bd9 增加饼图边框相关demo 2020-04-08 09:04:39 +08:00
monitor1394
e64486079d 增加PieChart通过ItemStyle设置边框的支持 2020-04-08 09:02:46 +08:00
monitor1394
9a295d674f 增加AxisceilRate设置最大最小值的取整倍率 2020-03-29 15:46:01 +08:00
monitor1394
af8127ef2c 增加圆角柱图 2020-03-29 11:14:34 +08:00
monitor1394
0d63c23493 增加itemStylecornerRadius支持圆角矩形 2020-03-29 10:57:59 +08:00
monitor1394
4c2a5a76ce 优化Editor参数编辑,兼容Unity2019.3及以上版本 2020-03-26 09:13:46 +08:00
monitor1394
99d78549c2 更新Demo 2020-03-24 09:08:31 +08:00
monitor1394
ca1e6957a8 增加Serieinspector上可进行调整顺序、添加和删除操作 2020-03-24 09:08:14 +08:00
monitor1394
25941d2050 修复TitletextStylesubTextStyle无效的问题 2020-03-23 07:58:09 +08:00
monitor1394
0d361555f3 增加BarChart通过barType参数设置胶囊柱状图 2020-03-22 22:50:35 +08:00
monitor1394
d50db7b16c 整理代码,去除warning 2020-03-22 08:45:05 +08:00
monitor1394
27c2c88e26 增加BarChartHeatmapChart可通过ignore参数设置忽略数据的支持 2020-03-21 22:01:47 +08:00
monitor1394
46ecdf430e 更新Demo 2020-03-21 11:28:23 +08:00
monitor1394
0e22dcbcdb 增加ItemStyletooltipFormatter参数可单独配置SerieTooltip显示 2020-03-21 11:26:50 +08:00
monitor1394
a0f20f696e 修复X Axis 1Y Axis 1配置变更时不会自动刷新的问题 2020-03-20 08:59:39 +08:00
monitor1394
541bc421b7 增加AxisTickwidth参数可单独设置坐标轴刻度的宽度 2020-03-20 08:47:34 +08:00
monitor1394
a1018801d4 增加SerieradarType参数设置多圈单圈雷达图 2020-03-20 08:31:22 +08:00
monitor1394
2a3d8dc5b2 增加BarChart可用ItemStylebackgroundColor设置柱条背景颜色 2020-03-17 09:13:55 +08:00
monitor1394
b6c206c299 增加SerieDataItemStyleEmphasis可单独配置数据项样式的支持 2020-03-17 08:37:48 +08:00
monitor1394
cc065edb0f 发布v1.3.1版本 2020-03-14 18:26:20 +08:00
monitor1394
2db035a9e1 修复LineChart开启ingore时部分数据可能绘制异常的问题 2020-03-14 11:52:22 +08:00
monitor1394
78c76878d3 修复LineChartlabel偏移显示异常的问题 2020-03-13 08:37:11 +08:00
monitor1394
f130c8378a 发布v1.3.0版本 2020-03-11 22:04:40 +08:00
monitor1394
43c323153c 优化LineChartlabel偏移显示 2020-03-11 21:53:45 +08:00
monitor1394
64636b1f0f 优化清空并重新添加数据后的自动刷新问题 2020-03-11 08:41:42 +08:00
monitor1394
c42a46b1a9 增加LineChart的普通折线图可通过ignore参数设置忽略数据的支持 2020-03-10 12:35:19 +08:00
monitor1394
11f639ba8d 增加LineChart的普通折线图可通过设置ingore参数过滤数据的支持 2020-03-10 09:15:55 +08:00
monitor1394
7c0534098a 增加LineChart的普通折线图可通过设置ingore参数过滤数据的支持 2020-03-10 09:12:47 +08:00
monitor1394
9118fdb660 增加BarChart可通过ItemStyle配置边框的支持 2020-03-09 22:10:48 +08:00
monitor1394
1cf107f47b 增加RingChart环形图 2020-03-08 10:47:48 +08:00
monitor1394
16f7781e49 调整SeriearcShaped参数重命名为roundCap 2020-03-06 07:09:15 +08:00
monitor1394
ca5839576a 增加运行时和非运行时参数变更自动刷新图表 2020-03-05 20:25:19 +08:00
monitor1394
3ef5f9653a Merge branch 'master' of https://github.com/monitor1394/unity-ugui-XCharts 2020-03-02 18:00:05 +08:00
monitor1394
d6df474182 适配Unity2019版本 2020-03-02 17:59:57 +08:00
monitor1394
5cf7b5d571 重构Legend图例,改变样式,增加自定义图标等设置 2020-02-26 22:52:57 +08:00
monitor1394
8c1cc28776 修复快速添加的图表不响应事件的问题 2020-02-23 14:15:06 +08:00
monitor1394
d4426776b7 渐出动画 2020-02-23 11:17:46 +08:00
monitor1394
2468393f14 增加BaseChart.AnimationFadeOut()渐入动画,重构动画系统 2020-02-23 11:06:16 +08:00
monitor1394
70a303cb12 增加TextStylelineSpacing参数配置行间距 2020-02-13 09:23:30 +08:00
monitor1394
e5f136c954 增加RadarsplitLine参数配置分割线,去掉lineStyle参数 2020-02-12 19:13:44 +08:00
monitor1394
dd72e773e7 new feature 2020-02-11 21:33:58 +08:00
monitor1394
8459bccb1e 增加TooltipbackgroundImage参数配置背景图 2020-02-11 21:30:20 +08:00
monitor1394
c73e1d6e3f 增加TooltippaddingLeftRightpaddingTopBottom参数配置文字和边框的间距 2020-02-11 21:01:01 +08:00
monitor1394
695c2fe311 增加TooltiplineStyle参数配置指示线样式 2020-02-11 20:37:48 +08:00
monitor1394
29598de9b7 增加AxissplitLine参数控制分割线 2020-02-11 20:37:34 +08:00
monitor1394
d60ae1a5cf 增加Serieclip参数控制是否超出坐标系外裁剪 2020-02-10 18:30:05 +08:00
monitor1394
5443e4931a 修复报错 2020-02-08 15:16:28 +08:00
monitor1394
3cee08c434 newfeature 2020-02-08 14:51:31 +08:00
monitor1394
5246d59173 更新demo 2020-02-08 14:51:23 +08:00
monitor1394
5b923f9990 更新文档 2020-02-08 14:14:39 +08:00
monitor1394
c458d4c27c 优化TextLimit文本长度自适应 2020-02-08 14:14:24 +08:00
monitor1394
49ed5ac153 增加SerieSymbolgap参数控制图形标记的外留白距离 2020-02-08 14:13:45 +08:00
monitor1394
616d63a4de 增加TextLimit组件可以设置AxisLabel的文本自适应 2020-01-26 22:34:57 +08:00
monitor1394
8043b116a2 优化Tooltip设置itemFormatter时显示系列颜色 2020-01-20 19:25:08 +08:00
monitor1394
8b7955f498 增加Radar雷达图在inspector配置areaStyle的支持 2020-01-20 19:13:49 +08:00
monitor1394
ce11222784 发布v1.2.0版本 2020-01-15 22:05:53 +08:00
monitor1394
87059b2e7f newfeature 2020-01-15 22:02:32 +08:00
monitor1394
4e7bcceda3 增加AxisLabel格式化为整数的支持 2020-01-15 19:49:09 +08:00
monitor1394
c4f95d3c4f 增加折线图对数轴Log的支持 2020-01-15 19:41:21 +08:00
monitor1394
892b84829d 优化Demo 2020-01-09 21:49:02 +08:00
monitor1394
519063e5e0 修复当设置DataZoomminShowNum时可能异常的问题 2020-01-09 19:30:15 +08:00
monitor1394
9dea742254 修复当设置AxisLineonZero时刻度显示异常的问题 2020-01-08 19:33:30 +08:00
monitor1394
5b9652e48d 增加Mask遮罩遮挡支持 2020-01-08 19:05:56 +08:00
monitor1394
02915db85b 更新版本日期 2019-12-21 20:17:59 +08:00
monitor1394
db36d68788 增加Tooltip的单个数据项和标题的字符串模版格式器 2019-12-21 20:12:27 +08:00
monitor1394
0dbc2e1c5c 增加DataZoom的最小显示数据个数minShowNum 2019-12-21 20:00:58 +08:00
monitor1394
4c27359cc0 更新最新版本日期 2019-12-20 09:19:20 +08:00
monitor1394
44ebca4a39 更新雷达图API接口 2019-12-20 09:18:05 +08:00
monitor1394
c7272f1817 增加Demo40_Radar.cs雷达图代码操作Demo 2019-12-20 09:17:37 +08:00
monitor1394
4898b0060f 添加RadarChart相关API接口 2019-12-20 09:17:15 +08:00
monitor1394
3147eb156e 优化serie的name为空时的tooltip显示问题 2019-12-19 22:15:12 +08:00
monitor1394
6f8017f0bf 优化warning 2019-12-19 22:10:36 +08:00
monitor1394
7e6d7d72d7 优化Grid引起的warning问题 2019-12-19 22:10:19 +08:00
monitor1394
3df991e5c0 发布v1.1.0版本 2019-12-17 09:01:00 +08:00
monitor1394
5d885e190b new feature 2019-12-16 09:45:30 +08:00
monitor1394
be0bdd0248 修复Overlay模式下不显示Tooltip的问题 2019-12-16 09:44:52 +08:00
monitor1394
78cf3dafa7 增加Title的TextStyle支持 2019-12-15 21:36:59 +08:00
monitor1394
03aaa61e91 Merge branch 'master' of https://github.com/monitor1394/unity-ugui-XCharts 2019-12-11 02:15:04 +08:00
monitor1394
44ed434e13 更新文档 2019-12-11 02:14:58 +08:00
monitor1394
067a70e385 修复Legend都隐藏时Value轴还显示数值的问题 2019-12-11 02:14:37 +08:00
monitor1394
ac61213db3 修复Series->Data->Size重置为0后设置无效的问题 2019-12-11 01:39:27 +08:00
monitor1394
59d8b7fb52 修复Series->Data->Size重置为0后设置无效的问题 2019-12-11 01:38:29 +08:00
monitor1394
1a52a8e098 修复数据过小时AxisLabel直接科学计数法显示的问题 2019-12-06 10:08:48 +08:00
monitor1394
9e51e16e9c 优化和完善数据更新UpdateData接口 2019-12-04 09:44:59 +08:00
monitor1394
b29fc0ed02 增加圆环饼图的圆角支持 2019-12-03 09:34:18 +08:00
monitor1394
74b304a72d 增加数据更新动画 2019-12-03 07:49:37 +08:00
monitor1394
ab057cb623 增加GaugeChart仪表盘 2019-11-30 21:28:54 +08:00
monitor1394
3a478c2abc 增加GaugeChart仪表盘 2019-11-30 21:24:04 +08:00
monitor1394
d8a8b5e50e 更新文档链接 2019-11-22 09:55:50 +08:00
monitor1394
8b5ddc725d 更新版本日期 2019-11-22 09:49:09 +08:00
monitor1394
55807ac941 更新版本日期 2019-11-22 09:48:37 +08:00
monitor1394
110f4ee5f8 修复BarChart清空数据重新赋值后SerieLabel显示异常的问题 2019-11-22 09:46:30 +08:00
monitor1394
5aaa53c503 修复Label字体样式参数设置无效的问题 2019-11-16 21:16:43 +08:00
monitor1394
dc3168747c 修复SerieLabel设置color不生效的问题 2019-11-16 20:15:35 +08:00
monitor1394
38d9232136 发布v1.0.5版本 2019-11-12 19:54:39 +08:00
monitor1394
b661c8e3d1 使用Unity2017.4.27f1作为开发版本,更好的支持低版本 2019-11-12 12:49:07 +08:00
monitor1394
1a949ecb50 整理代码 2019-11-12 12:47:25 +08:00
monitor1394
27dca7c67b Merge pull request #23 from jrapoport/master
support standard c# string formatters in axis labels
2019-11-12 12:39:37 +08:00
Jacob Rapoport
a19a917941 support standard c# string formatters on axis labels 2019-11-11 18:21:30 -08:00
Jacob Rapoport
fb08b62839 Merge branch 'master' of ssh://github.com/monitor1394/unity-ugui-XCharts 2019-11-11 18:12:06 -08:00
monitor1394
bd75f43b2a 修复Label坐标显示异常的问题 2019-11-12 09:49:25 +08:00
monitor1394
668aa4ef0f 修复2018.3以下版本打开项目报错的问题 2019-11-12 08:00:47 +08:00
monitor1394
837658ddcc 增加忽略文件 2019-11-12 08:00:36 +08:00
monitor1394
6503ac2e24 修复2018.3以下版本打开报错的问题 2019-11-12 07:59:46 +08:00
monitor1394
eae0afe659 修复Demo脚本丢失问题 2019-11-12 07:57:10 +08:00
monitor1394
ddb526fb42 增加IconStyle子组件,优化SerieData的图标配置 2019-11-12 07:38:02 +08:00
monitor1394
db50c8ffbe 修复图标显示在上覆盖Label的问题 2019-11-11 09:41:21 +08:00
monitor1394
7198734083 修复饼图当数据过小时视觉引导线会穿透的的问题 2019-11-11 09:24:24 +08:00
monitor1394
6cfcf84b5d 修复饼图添加数据时Label异常的问题 2019-11-09 16:34:16 +08:00
monitor1394
70bcebe9ea 更新文档 2019-11-09 07:51:37 +08:00
monitor1394
d45e2695a5 优化结构,分离为XCharts和XChartsDemo两部分 2019-11-09 07:00:58 +08:00
monitor1394
aef05a53ef 发布1.0.4版本 2019-11-05 19:20:06 +08:00
monitor1394
70c9dafda3 增加Radar雷达组件更多样式配置参数支持 2019-11-05 18:58:32 +08:00
monitor1394
6491660432 修复Unity2018.3以下版本代码不兼容的问题 2019-11-04 18:54:05 +08:00
monitor1394
31b0a385de 优化SerieLabel引起的性能问题 2019-11-04 13:09:06 +08:00
Jacob Rapoport
d4e7fdbb9c add UpdateThemeInfo API 2019-10-26 17:19:09 -07:00
530 changed files with 1758319 additions and 614882 deletions

14
.gitignore vendored
View File

@@ -5,16 +5,22 @@
/Library
/Temp
/Logs
/obj
/UnityPackageManager
/Packages
/ProjectSettings/XRSettings.asset
/Assets/Res
/Assets/Res.meta
/Assets/Package
/Assets/Package.meta
/Assets/TextMesh Pro
/Assets/TextMesh Pro.meta
/Doc/*.meta
/Assets/XCharts/Demo/demo_test.unity
/Assets/XCharts/Demo/demo_test.unity.meta
/Assets/XCharts/Demo/empty.unity
/Assets/XCharts/Demo/empty.unity.meta
/Assets/XChartsDemo/demo_test.unity
/Assets/XChartsDemo/demo_test.unity.meta
/Assets/XChartsDemo/empty.unity
/Assets/XChartsDemo/empty.unity.meta
*.sln
*.csproj

View File

@@ -0,0 +1,624 @@
# 更新日志
[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) 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
* (2020.07.25) Added `RadarChart` support for `formatter` of `Tooltip`#77
* (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) 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.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}`格式配置
* (2020.05.31) 优化`Background`组件的生效条件,需要有单独的父节点(升级前需要自己处理旧的背景节点)
* (2020.05.30) 优化`PieChart`支持设置`ignoreValue`不显示指定数据
* (2020.05.30) 修复`RadarChart``Circle`时不绘制`SplitArea`的问题
* (2020.05.30) 优化`RadarChart`在设置`max``0`时可自动刷新最大值
* (2020.05.29) 修复`PieChart`设置`space`时只有一个数据时绘制异常的问题
* (2020.05.27) 修复调用`UpdateDataName()`接口时不会自动刷新的问题
* (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`背景组件
* (2020.05.19) 隐藏`Hierarchy`试图下自动生成的子节点
* (2020.05.18) 增加`chartName`属性可指定图表的别称,可通过`XChartMgr.Instance.GetChart(chartName)`获取图表
* (2020.05.16) 增加部分鼠标事件回调
* (2020.05.15) 优化自带例子,`Demo`改名为`Example`
* (2020.05.13) 增加`Serie``large``largeThreshold`参数配置折线图和柱状图的性能模式
* (2020.05.13) 完善Demo增加性能演示Demo
* (2020.05.13) 优化性能,优化大数据绘制,重构代码
* (2020.05.04) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
* (2020.04.28) 增加`自由锚点`支持,任意对齐方式
* (2020.04.23) 优化`ScatterChart``Tooltip`显示效果
* (2020.04.23) 增加`Tooltip``formatter``{.}``{c:0}``{c1:1}`的支持
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
* (2020.04.19) 增加`AxisLabel``onZero`参数可将`Label`显示在`0`刻度上
* (2020.04.19) 增加`Serie``AxisLabel``showAsPositiveNumber`参数将负数数值显示为正数
* (2020.04.18) 增加`Covert XY Axis`互换XY轴配置
* (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`初始化异常的问题
* (2020.04.08) 增加`PieChart`通过`ItemStyle`设置边框的支持
* (2020.03.29) 增加`Axis``ceilRate`设置最大最小值的取整倍率
* (2020.03.29) 增加`BarChart`可通过`itemStyle``cornerRadius`设置`圆角柱图`
* (2020.03.29) 增加`itemStyle``cornerRadius`支持圆角矩形
* (2020.03.24) 优化`Editor`参数编辑,兼容`Unity2019.3`及以上版本
* (2020.03.24) 增加`Serie``inspector`上可进行调整顺序、添加和删除操作
* (2020.03.23) 修复`Title``textStyle``subTextStyle`无效的问题
* (2020.03.22) 增加`BarChart`通过`barType`参数设置`胶囊柱状图`
* (2020.03.21) 增加`BarChart``HeatmapChart`可通过`ignore`参数设置忽略数据的支持
* (2020.03.21) 增加`ItemStyle``tooltipFormatter`参数可单独配置`Serie``Tooltip`显示
* (2020.03.20) 修复`X Axis 1``Y Axis 1`配置变更时不会自动刷新的问题
* (2020.03.20) 增加`AxisTick``width`参数可单独设置坐标轴刻度的宽度
* (2020.03.20) 增加`Serie``radarType`参数设置`多圈``单圈`雷达图
* (2020.03.17) 增加`BarChart`可用`ItemStyle``backgroundColor`设置数据项背景颜色
* (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) 优化清空并重新添加数据后的自动刷新问题
* (2020.03.10) 增加`LineChart`的普通折线图可通过`ignore`参数设置忽略数据的支持
* (2020.03.09) 增加`BarChart`可通过`ItemStyle`配置边框的支持
* (2020.03.08) 增加`RingChart`环形图
* (2020.03.05) 调整`Serie``arcShaped`参数重命名为`roundCap`
* (2020.03.05) 增加运行时和非运行时参数变更自动刷新图表
* (2020.02.26) 重构`Legend`图例,改变样式,增加自定义图标等设置
* (2020.02.23) 增加`BaseChart.AnimationFadeOut()`渐出动画,重构动画系统
* (2020.02.13) 增加`BaseChart.RefreshTooltip()`接口立即重新初始化`Tooltip`组件
* (2020.02.13) 增加`Tooltip``textStyle`参数配置内容文本样式,去掉`fontSize``fontStyle`参数
* (2020.02.13) 增加`TextStyle``lineSpacing`参数配置行间距
* (2020.02.11) 增加`Radar``splitLine`参数配置分割线,去掉`lineStyle`参数
* (2020.02.11) 增加`Tooltip``backgroundImage`参数配置背景图
* (2020.02.11) 增加`Tooltip``paddingLeftRight``paddingTopBottom`参数配置文字和边框的间距
* (2020.02.11) 增加`Tooltip``lineStyle`参数配置指示线样式
* (2020.02.11) 增加`Axis``splitLine`参数控制分割线,去掉`showSplitLine``splitLineType`参数(更新时需要重新设置分割线相关设置)
* (2020.02.10) 增加`Serie``clip`参数控制是否超出坐标系外裁剪(只适用于折线图、柱状图、散点图)
* (2020.02.08) 增加`SerieSymbol``gap`参数控制图形标记的外留白距离
* (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`的支持
* (2020.01.09) 修复当设置`DataZoom``minShowNum`时可能异常的问题
* (2020.01.08) 修复当设置`AxisLine``onZero`时刻度显示异常的问题
* (2020.01.08) 增加`Mask`遮罩遮挡支持
* (2019.12.21) 增加`Tooltip`的单个数据项和标题的字符串模版格式器
* (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`支持
* (2019.12.11) 修复`Legend`都隐藏时`Value轴`还显示数值的问题
* (2019.12.11) 修复`Series->Data->Size`重置为0后设置无效的问题
* (2019.12.06) 修复数据过小时`AxisLabel`直接科学计数法显示的问题
* (2019.12.04) 优化和完善数据更新`UpdateData`接口
* (2019.12.03) 增加圆环饼图的圆角支持,参数:`serie.arcShaped`
* (2019.12.03) 增加数据更新动画,参数:`serie.animation.dataChangeEnable`
* (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`的图标配置
* (2019.11.11) 修复`Serie`的图标显示在上层遮挡`Label`的问题
* (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.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`安装的支持
* (2019.10.20) 增加`Demo`首页`BarChart`的代码动态控制效果
* (2019.10.18) 增加`Serie``barType`参数,可配置`斑马柱状图`
* (2019.10.18) 增加`Serie``barPercentStack`参数,可配置`百分比堆叠柱状图`
* (2019.10.16) 增加`Demo`首页`LineChart`的代码动态控制效果
* (2019.10.15) 移除`Pie`组件,相关参数放到`Settings`中配置
* (2019.10.15) 增加`Demo`首页,展示代码动态控制效果
* (2019.10.14) 增加`RadarChart``ScatterChart``HeatmapChart`的起始动画效果
* (2019.10.14) 增加`SerieData``radius`自定义数据项的半径
* (2019.10.14) 增加`HeatmapChart`热力图
* (2019.10.14) 增加`VisualMap`视觉映射组件
* (2019.10.14) 增加`ItemStyle`数据项样式组件
* (2019.10.14) 增加`Emphasis`高亮样式组件
* (2019.10.10) 增加`Settings`全局参数配置组件,开放更多参数可配置
* (2019.10.09) 增加`AreaStyle`的高亮相关参数配置鼠标悬浮时高亮之前区域
* (2019.10.09) 优化`DataZoom`组件,增加双指缩放
* (2019.10.05) 增加`SerieLabel``LineType`给饼图配置不同类型的视觉引导线
* (2019.10.02) 增加`ScatterChart`同时对`Scatter``Line`的支持,实现折线图和散点图的组合图
* (2019.10.01) 重构代码,废弃`Series.series`接口,用`Series.list`代替
* (2019.10.01) 增加`customDrawCallback`自定义绘制回调
* (2019.10.01) 增加`SmoothDash`平滑虚线的支持
* (2019.09.30) 增加`Serie`采样类型`sampleType`的相关配置
* (2019.09.29) 增加`SerieSymbol`关于显示间隔的相关配置
* (2019.09.29) 重构代码:
* `BaseChart``sampleDist`删除,`Serie`增加`lineSampleDist`
* `BaseChart``minShowDataNumber`删除,`Serie`增加`minShow`
* `BaseChart``maxShowDataNumber`删除,`Serie`增加`maxShow`
* `BaseChart``maxCacheDataNumber`删除,`Serie`增加`maxCache`
* `BaseChart``AddSerie()`接口参数调整
* `BaseChart``UpdateData()`接口参数调整
* `Axis`增加`maxCache`
* (2019.09.28) 增加`LineChart``BarChart`同时对`Line``Bar`类型`Serie`的支持,实现折线图和柱状图的组合图
* (2019.09.27) 增加`Axis``splitNumber`设置为`0`时表示绘制所有类目数据
* (2019.09.27) 增加`SampleDist`采样距离的配置,对过密的曲线开启采样,优化绘制效率
* (2019.09.27) 增加`XCharts问答``XChartsAPI接口``XCharts配置项手册`等文档
* (2019.09.26) 增加`AnimationReset()`重置初始化动画接口
* (2019.09.26) 优化`LineChart`的密集数据的曲线效果
* (2019.09.25) 优化`SerieData`的自定义图标不与`SerieLabel`关联,可单独控制是否显示
* (2019.09.24) 增加`SerieData`的自定义图标相关配置支持
* (2019.09.23) 增加`Formatter`配置`Axis``AxisLabel`的格式化输出
* (2019.09.23) 增加`Tooltip``FontSize``FontStyle`配置字体大小和样式
* (2019.09.23) 增加`Formatter`配置`SerieLabel``Legend``Tooltip`的格式化输出
* (2019.09.19) 增加`LineArrow`配置带箭头曲线
* (2019.09.19) 增加`Tooltip``FixedWidth``FixedHeight``MinWidth``MinHeight`设置支持
* (2019.09.18) 增加单条堆叠柱状图
* (2019.09.18) 增加虚线`Dash`、点线`Dot`、点划线`DashDot`、双点划线`DashDotDot`等类型的折线图支持
* (2019.09.17) 增加`AnimationEnabel()`启用或取消起始动画接口
* (2019.09.17) 增加`Axis``Interval`强制设置坐标轴分割间隔
* (2019.09.16) 去掉`Serie`中的旧版本数据兼容,不再支持`xData``yData`
* (2019.09.06) 增加`Animation`在重新初始化数据时自启动功能
* (2019.09.06) 增加`SerieLabel``Border`边框相关配置支持
* (2019.09.05) 增加`PieChart``Animation`初始化动画配置支持
* (2019.09.03) 增加`BarChart``Animation`初始化动画配置支持
* (2019.09.02) 增加`LineChart``Animation`初始化动画配置支持
* (2019.08.22) 增加`AxisName``Offset`偏移配置支持
* (2019.08.22) 增加`AxisLine``Width`配置支持
* (2019.08.20) 增加`SerieLabel`的背景宽高、文字边距、文字旋转的配置
* (2019.08.20) 增加`BarChart``Label`配置支持
* (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注释文档整理代码
* (2019.07.29) 增加`Radius``Area`两种南丁格尔玫瑰图展示类型
* (2019.07.29) 增加`SerieLabel`配置饼图标签,支持`Center``Inside``Outside`等显示位置
* (2019.07.28) 增加`PieChart`多饼图支持
* (2019.07.23) 优化`Theme`主题的自定义,切换主题时自定义配置不受影响
* (2019.07.22) 增加`EffectScatter`类型的散点图
* (2019.07.21) 增加`ScatterChart`散点图
* (2019.07.21) 增加`SerieData`支持多维数据配置
* (2019.07.20) 增加`Symbol`配置`Serie`标志图形的显示
* (2019.07.19) 增加用代码添加动态正弦曲线的示例`Demo11_AddSinCurve`
* (2019.07.19) 优化`Legend`的显示和控制
* (2019.07.18) 优化抗锯齿,曲线更平滑
* (2019.07.18) 增加`Tooltip`指示器类型,优化显示控制
* (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`配置坐标轴`刻度标签`
* (2019.07.02) 增加`selected`等相关参数配置`PieChart`的选中效果
* (2019.06.30) 增加`SplitArea`配置坐标轴`分割区域`
* (2019.06.29) 增加`AxisName`配置坐标轴`名称`
* (2019.06.20) 增加`AreaAlpha`控制`RadarChart``Area`透明度
* (2019.06.13) 增加`DataZoom`实现`区域缩放`
* (2019.06.01) 增加`stepType`实现`LineChart``阶梯线图`
* (2019.05.29) 增加`InSameBar`实现`BarChart``非堆叠同柱`
* (2019.05.29) 增加`crossLabel`控制`Tooltip``十字准星指示器`
* (2019.05.24) 增加`堆叠区域图`
* (2019.05.16) 增加`AxisMinMaxType`控制坐标轴最大最小刻度
* (2019.05.15) 完善数据接口
* (2019.05.14) 增加X轴`AxisType.Value`模式支持
* (2019.05.13) 增加负数数值轴支持
* (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

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c6e25b74d4d65457f971a07609658393
guid: 042c85734494346adab5b3233234d261
TextScriptImporter:
externalObjects: {}
userData:

View File

@@ -1,17 +1,502 @@
# 更新日志
[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) 发布`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/2.0/Assets/XCharts/Documentation/XCharts问答.md)进行升级)
* (2020.08.15) 优化`PieChart`绘制表现效果#85
* (2020.08.11) 增加`LiquidChart`数据变更动画#83
* (2020.08.11) 优化`PieChart`文本堆叠和引线效果#85
* (2020.08.08) 优化`LineChart`密集数据的绘制表现效果
* (2020.07.30) 增加`LineChart`可通过`VisualMap``ItemStyle`配置渐变#78
* (2020.07.25) 修复`LineChart`渐出动画绘制异常的问题#79
* (2020.07.25) 修复`LiquidChart``100%`时渐变色会失效的问题#80
* (2020.07.25) 增加`RadarChart``Tooltip``formatter`支持#77
* (2020.07.23) 增加`RingChart`环形渐变支持#75
* (2020.07.21) 增加`AxisLabel``SerieLabel``formatter`可单独配置数值格式化#68
* (2020.07.17) 增加`SerieAnimation`动画完成回调接口
* (2020.07.17) 优化`Chart`放在`ScrollView`下时不影响`ScrollView`的滚动和拖动
* (2020.07.16) 修复`Tooltip`在上层有遮挡还会显示的问题#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`极坐标图表
## v1.5.2
* (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
## v1.5.1
* (2020.06.03) 发布`v1.5.1`版本
* (2020.06.02) 增加`Radar``ceilRate`,设置最大最小值的取整倍率
* (2020.06.02) 优化`Tooltip``formatter`,支持`{c1:1-1:f1}`格式配置
* (2020.05.31) 优化`Background`组件的生效条件,需要有单独的父节点(升级前需要自己处理旧的背景节点)
* (2020.05.30) 优化`PieChart`支持设置`ignoreValue`不显示指定数据
* (2020.05.30) 修复`RadarChart``Circle`时不绘制`SplitArea`的问题
* (2020.05.30) 优化`RadarChart`在设置`max``0`时可自动刷新最大值
* (2020.05.29) 修复`PieChart`设置`space`时只有一个数据时绘制异常的问题
* (2020.05.27) 修复调用`UpdateDataName()`接口时不会自动刷新的问题
* (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`背景组件
* (2020.05.19) 隐藏`Hierarchy`试图下自动生成的子节点
* (2020.05.18) 增加`chartName`属性可指定图表的别称,可通过`XChartMgr.Instance.GetChart(chartName)`获取图表
* (2020.05.16) 增加部分鼠标事件回调
* (2020.05.15) 优化自带例子,`Demo`改名为`Example`
* (2020.05.13) 增加`Serie``large``largeThreshold`参数配置折线图和柱状图的性能模式
* (2020.05.13) 完善Demo增加性能演示Demo
* (2020.05.13) 优化性能,优化大数据绘制,重构代码
* (2020.05.04) 增加`numericFormatter`参数可配置数值格式化显示,去掉`forceENotation`参数
* (2020.04.28) 增加`自由锚点`支持,任意对齐方式
* (2020.04.23) 优化`ScatterChart``Tooltip`显示效果
* (2020.04.23) 增加`Tooltip``formatter``{.}``{c:0}``{c1:1}`的支持
* (2020.04.19) 优化`LineChart`折线图的区域填充渐变效果
* (2020.04.19) 增加`AxisLabel``onZero`参数可将`Label`显示在`0`刻度上
* (2020.04.19) 增加`Serie``AxisLabel``showAsPositiveNumber`参数将负数数值显示为正数
* (2020.04.18) 增加`Covert XY Axis`互换XY轴配置
* (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`初始化异常的问题
* (2020.04.08) 增加`PieChart`通过`ItemStyle`设置边框的支持
* (2020.03.29) 增加`Axis``ceilRate`设置最大最小值的取整倍率
* (2020.03.29) 增加`BarChart`可通过`itemStyle``cornerRadius`设置`圆角柱图`
* (2020.03.29) 增加`itemStyle``cornerRadius`支持圆角矩形
* (2020.03.24) 优化`Editor`参数编辑,兼容`Unity2019.3`及以上版本
* (2020.03.24) 增加`Serie``inspector`上可进行调整顺序、添加和删除操作
* (2020.03.23) 修复`Title``textStyle``subTextStyle`无效的问题
* (2020.03.22) 增加`BarChart`通过`barType`参数设置`胶囊柱状图`
* (2020.03.21) 增加`BarChart``HeatmapChart`可通过`ignore`参数设置忽略数据的支持
* (2020.03.21) 增加`ItemStyle``tooltipFormatter`参数可单独配置`Serie``Tooltip`显示
* (2020.03.20) 修复`X Axis 1``Y Axis 1`配置变更时不会自动刷新的问题
* (2020.03.20) 增加`AxisTick``width`参数可单独设置坐标轴刻度的宽度
* (2020.03.20) 增加`Serie``radarType`参数设置`多圈``单圈`雷达图
* (2020.03.17) 增加`BarChart`可用`ItemStyle``backgroundColor`设置数据项背景颜色
* (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) 优化清空并重新添加数据后的自动刷新问题
* (2020.03.10) 增加`LineChart`的普通折线图可通过`ignore`参数设置忽略数据的支持
* (2020.03.09) 增加`BarChart`可通过`ItemStyle`配置边框的支持
* (2020.03.08) 增加`RingChart`环形图
* (2020.03.05) 调整`Serie``arcShaped`参数重命名为`roundCap`
* (2020.03.05) 增加运行时和非运行时参数变更自动刷新图表
* (2020.02.26) 重构`Legend`图例,改变样式,增加自定义图标等设置
* (2020.02.23) 增加`BaseChart.AnimationFadeOut()`渐出动画,重构动画系统
* (2020.02.13) 增加`BaseChart.RefreshTooltip()`接口立即重新初始化`Tooltip`组件
* (2020.02.13) 增加`Tooltip``textStyle`参数配置内容文本样式,去掉`fontSize``fontStyle`参数
* (2020.02.13) 增加`TextStyle``lineSpacing`参数配置行间距
* (2020.02.11) 增加`Radar``splitLine`参数配置分割线,去掉`lineStyle`参数
* (2020.02.11) 增加`Tooltip``backgroundImage`参数配置背景图
* (2020.02.11) 增加`Tooltip``paddingLeftRight``paddingTopBottom`参数配置文字和边框的间距
* (2020.02.11) 增加`Tooltip``lineStyle`参数配置指示线样式
* (2020.02.11) 增加`Axis``splitLine`参数控制分割线,去掉`showSplitLine``splitLineType`参数(更新时需要重新设置分割线相关设置)
* (2020.02.10) 增加`Serie``clip`参数控制是否超出坐标系外裁剪(只适用于折线图、柱状图、散点图)
* (2020.02.08) 增加`SerieSymbol``gap`参数控制图形标记的外留白距离
* (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`的支持
* (2020.01.09) 修复当设置`DataZoom``minShowNum`时可能异常的问题
* (2020.01.08) 修复当设置`AxisLine``onZero`时刻度显示异常的问题
* (2020.01.08) 增加`Mask`遮罩遮挡支持
* (2019.12.21) 增加`Tooltip`的单个数据项和标题的字符串模版格式器
* (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`支持
* (2019.12.11) 修复`Legend`都隐藏时`Value轴`还显示数值的问题
* (2019.12.11) 修复`Series->Data->Size`重置为0后设置无效的问题
* (2019.12.06) 修复数据过小时`AxisLabel`直接科学计数法显示的问题
* (2019.12.04) 优化和完善数据更新`UpdateData`接口
* (2019.12.03) 增加圆环饼图的圆角支持,参数:`serie.arcShaped`
* (2019.12.03) 增加数据更新动画,参数:`serie.animation.dataChangeEnable`
* (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`的图标配置
* (2019.11.11) 修复`Serie`的图标显示在上层遮挡`Label`的问题
* (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`安装的支持
@@ -75,16 +560,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注释文档整理代码
@@ -103,6 +600,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`配置坐标轴`刻度标签`
@@ -122,4 +622,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

@@ -1,45 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(ChartModule), true)]
public class ChartModuleDrawer : PropertyDrawer
{
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
var lastX = drawRect.x;
var lastWid = drawRect.width;
SerializedProperty m_Name = prop.FindPropertyRelative("m_Name");
SerializedProperty m_Title = prop.FindPropertyRelative("m_Title");
SerializedProperty m_Selected = prop.FindPropertyRelative("m_Selected");
SerializedProperty m_Panel = prop.FindPropertyRelative("m_Panel");
var fieldWid = EditorGUIUtility.currentViewWidth - 30 - 5 - 50 - 90;
drawRect.width = 15;
EditorGUI.PropertyField(drawRect,m_Selected,GUIContent.none);
drawRect.x += 15;
drawRect.width = 50;
EditorGUI.PropertyField(drawRect,m_Name,GUIContent.none);
drawRect.x += 52;
drawRect.width = fieldWid;
EditorGUI.PropertyField(drawRect,m_Title,GUIContent.none);
drawRect.x += fieldWid + 2;
drawRect.width = 90;
EditorGUI.PropertyField(drawRect,m_Panel,GUIContent.none);
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,17 +0,0 @@
{
"name": "XCharts.Editor.Demo",
"references": [
"XCharts.Demo.Runtime",
"XCharts.Runtime"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

View File

@@ -1,39 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using UnityEngine.UI;
namespace XCharts
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Demo12_CustomDrawing : MonoBehaviour
{
LineChart chart;
void Awake()
{
chart = gameObject.GetComponent<LineChart>();
if (chart == null) return;
chart.customDrawCallback = delegate (VertexHelper vh)
{
var dataPoints = chart.series.list[0].dataPoints;
if (dataPoints.Count > 0)
{
var pos = dataPoints[3];
var zeroPos = new Vector3(chart.coordinateX, chart.coordinateY);
var startPos = new Vector3(pos.x, zeroPos.y);
var endPos = new Vector3(pos.x, zeroPos.y + chart.coordinateHeight);
ChartDrawer.DrawLine(vh, startPos, endPos, 1, Color.blue);
ChartDrawer.DrawCricle(vh, pos, 5, Color.blue);
}
};
}
}
}

View File

@@ -1,48 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Demo13_LineSimple : MonoBehaviour
{
void Awake()
{
var chart = gameObject.GetComponent<LineChart>();
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
}
chart.title.show = true;
chart.title.text = "Line Simple";
chart.tooltip.show = true;
chart.legend.show = false;
chart.xAxises[0].show = true;
chart.xAxises[1].show = false;
chart.yAxises[0].show = true;
chart.yAxises[1].show = false;
chart.xAxises[0].type = Axis.AxisType.Category;
chart.yAxises[0].type = Axis.AxisType.Value;
chart.xAxises[0].splitNumber = 10;
chart.xAxises[0].boundaryGap = true;
chart.RemoveData();
chart.AddSerie(SerieType.Line);
for (int i = 0; i < 10; i++)
{
chart.AddXAxisData("x" + i);
chart.AddData(0, Random.Range(10, 20));
}
}
}
}

View File

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

View File

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

View File

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

View File

@@ -1,38 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEngine;
namespace XCharts
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Demo50_Scatter : MonoBehaviour
{
private ScatterChart chart;
void Awake()
{
chart = gameObject.GetComponent<ScatterChart>();
if (chart == null) return;
chart.series.SetSerieSymbolSizeCallback(SymbolSize, SymbolSelectedSize);
}
float SymbolSize(List<float> data)
{
//return Mathf.Clamp(data[1] * 10,1,100);
return (float)(Mathf.Sqrt(data[2]) / 6e2);
}
float SymbolSelectedSize(List<float> data)
{
//return Mathf.Clamp(data[1] * 10,1,100);
return (float)(Mathf.Sqrt(data[2]) / 5e2);
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,41 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using UnityEngine.UI;
namespace XCharts
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Demo_Test : MonoBehaviour
{
LineChart chart;
void Awake()
{
chart = gameObject.GetComponent<LineChart>();
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
}
var buttom = transform.parent.gameObject.GetComponentInChildren<Button>();
buttom.onClick.AddListener(AddData);
}
void AddData()
{
chart.series.list[0].ClearData();
chart.series.list[1].ClearData();
for (int i = 0; i < 5; i++)
{
chart.AddData(0, Random.Range(20, 100));
chart.AddData(1, Random.Range(1, 10));
}
}
}
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -6,17 +6,30 @@
## `BaseChart`
---
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.theme`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
* `BaseChart.series`:系列列表`Series`
* `BaseChart.chartName`:图表的别称。
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.customDrawCallback`:自定义绘制回调函数
* `BaseChart.SetSize(float width, float height)`:设置图表的大小
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测
* `BaseChart.onCustomDraw`自定义底部绘制回调。在绘制Serie前调用
* `BaseChart.onCustomDrawBeforeSerie`自定义Serie绘制回调。在每个Serie绘制完前调用。
* `BaseChart.onCustomDrawAfterSerie`自定义Serie绘制回调。在每个Serie绘制完后调用。
* `BaseChart.onCustomDrawTop`自定义顶部绘制回调。在绘制Tooltip前调用。
* `BaseChart.onPointerClick`:鼠标点击回调。
* `BaseChart.onPointerDown`:鼠标按下回调。
* `BaseChart.onPointerUp`:鼠标弹起回调。
* `BaseChart.onPointerEnter`:鼠标进入图表回调。
* `BaseChart.onPointerExit`:鼠标退出图表回调。
* `BaseChart.onBeginDrag`:鼠标开始拖拽回调。
* `BaseChart.onDrag`:鼠标拖拽回调。
* `BaseChart.onEndDrag`:鼠标结束拖拽回调。
* `BaseChart.onScroll`:鼠标滚动回调。
* `BaseChart.onPointerClickPie`:点击柱条回调。参数:`eventData`, `serieIndex`, `dataIndex`
* `BaseChart.SetSize(float width, float height)` 设置图表的宽高在非stretch pivot下才有效其他情况需要自己调整RectTransform
* `BaseChart.ClearData()`:清除所有数据,系列列表会保留,只是移除列表中系列的数据。
* `BaseChart.RemoveData()`:清除所有系列和图例数据,系列列表也会被清除。
* `BaseChart.RemoveData(string serieName)`:清除指定系列名称的数据。
@@ -29,6 +42,10 @@
* `BaseChart.AddData(int serieIndex, float xValue, float yValue, string dataName = null)`:添加`x,y`数据到指定系列中。
* `BaseChart.UpdateData(string serieName,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(int serieIndex,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateDataName(string serieName,int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.UpdateDataName(int serieIndex, int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.SetActive(string serieName, bool active)`:设置指定系列是否显示。
@@ -38,77 +55,97 @@
* `BaseChart.IsActiveByLegend(string legendName)`:获得指定图例名字的系列是否显示。
* `BaseChart.RefreshChart()`:在下一帧刷新图表。
* `BaseChart.RefreshLabel()`:在下一帧刷新文本标签。
* `BaseChart.RefreshTooltip()`:立即刷新`Tooltip`组件。
* `BaseChart.UpdateTheme(Theme theme)`:切换图表主题。
* `BaseChart.AnimationEnable(bool flag)`:启用或关闭起始动画。
* `BaseChart.AnimationStart()`开始初始动画。
* `BaseChart.AnimationStop()`:停止初始化动画。
* `BaseChart.AnimationReset()`重置初始动画,重新播放
* `BaseChart.AnimationEnable(bool flag)`:启用或关闭动画。
* `BaseChart.AnimationFadeIn()`渐入动画。
* `BaseChart.AnimationFadeOut()`:渐出动画。
* `BaseChart.AnimationPause()`暂停动画
* `BaseChart.AnimationResume()`:继续动画。
* `BaseChart.AnimationReset()`:重置动画。
* `BaseChart.ClickLegendButton(int legendIndex, string legendName, bool show)`:点击图例按钮。
* `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()`:立即刷新数值坐标轴的最大最小值(更新坐标轴标签并触发重绘)。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector3 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(float x, float y)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.ClampInGrid(grid, Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
## `LineChart`
---
* 继承 `BaseChart`
* 继承自 `CoordinateChart`
## `BarChart`
---
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `PieChart`
* `BarChart.onPointerClickBar`:点击柱条回调。参数:`eventData`, `dataIndex`
---
* 继承自 `BaseChart`
## `RadarChart`
---
* 继承自 `BaseChart`
* `radars`:雷达组件列表 `Radar`
* `RadarChart.radars`:雷达坐标系组件列表 `Radar`
* `RadarChart.RemoveRadar()`:移除所有雷达坐标系组件。
* `RadarChart.AddRadar(Radar radar)`:添加雷达坐标系组件。
* `RadarChart.AddRadar(Radar.Shape shape, Vector2 center, float radius, int splitNumber = 5,float lineWidth = 0.6f, bool showIndicator = true, bool showSplitArea = true)`:添加雷达坐标系组件。
* `RadarChart.AddIndicator(int radarIndex, string name, float min, float max)`:添加指示器。
* `RadarChart.UpdateIndicator(int radarIndex, int indicatorIndex, string name, float min, float max)`:更新指示器。
* `RadarChart.GetRadar(int radarIndex)`:获得指定索引的雷达坐标系组件。
* `RadarChart.GetIndicator(int radarIndex, int indicatorIndex)`:获得指定雷达坐标系组件指定索引的指示器。
## `ScatterChart`
---
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `HeatmapChart`
---
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `RingChart`
* 继承自 `BaseChart`
* `RingChart.UpdateMax(int serieIndex, int dataIndex, float value)`:更新指定系列执行数据项的最大值。
* `RingChart.UpdateMax(int serieIndex, float value)`:更新指定系列的所有数据项的最大值。
* `RingChart.UpdateMax(float value)`:更新第一个系列第一个数据项的最大值。
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)

File diff suppressed because it is too large Load Diff

View File

@@ -6,27 +6,33 @@
[QA 1如何调整坐标轴与背景的边距](#如何调整坐标轴与背景的边距)
[QA 2如何让初始动画重新播放](#如何让初始动画重新播放)
[QA 3如何自定义折线图、饼图等数据项的颜色](#如何自定义折线图饼图等数据项的颜色)
[QA 4如何格式化文字如我想给坐标轴标签加上单位](#如何格式化文字如我想给坐标轴标签加上单位)
[QA 3如何自定义折线图、饼图等数据项的颜色](#如何自定义折线图_饼图等数据项的颜色)
[QA 4如何格式化文字如我想给坐标轴标签加上单位](#如何格式化文字_如我想给坐标轴标签加上单位)
[QA 5如何让柱形图的柱子堆叠显示](#如何让柱形图的柱子堆叠显示)
[QA 6如何让柱形图的柱子同柱但不重叠](#如何让柱形图的柱子同柱但不重叠)
[QA 7如何调整柱形图的柱子宽度和间距](#如何调整柱形图的柱子宽度和间距)
[QA 8如何调整柱形图单个柱子的颜色](#如何调整柱形图单个柱子的颜色)
[QA 9如何调整图表的对齐方式](#如何调整图表的对齐方式)
[QA 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
[QA 11折线图可以画虚线、点线、点划线吗](#折线图可以画虚线点线点划线吗)
[QA 12如何限定Y轴Value轴的值范围](#如何限定Y轴Value轴的值范围)
[QA 11折线图可以画虚线、点线、点划线吗](#折线图可以画虚线_点线_点划线吗)
[QA 12如何限定Y轴Value轴的值范围](#如何限定Y轴的值范围)
[QA 13如何自定义数值轴刻度大小](#如何自定义数值轴刻度大小)
[QA 14如何在数据项顶上显示文本](#如何在数据项顶上显示文本)
[QA 15如何给数据项自定义图标](#如何给数据项自定义图标)
[QA 16锯齿太严重如何让图表更顺滑](#锯齿太严重如何让图表更顺滑)
[QA 17为什么鼠标移上图表Tooltip不显示](#为什么鼠标移上图表`Tooltip`不显示)
[QA 18如何取消Tooltip的竖线](#如何取消`Tooltip`的竖线)
[QA 19如何让Y轴数值轴显示多位小数](#如何让Y轴数值轴显示多位小数)
[QA 20如何用代码动态更新数据?](#如何用代码动态更新数据)
[QA 21如何显示图例?](#如何显示图例)
[QA 22如何做成预设?](#如何做成预设)
[QA 23如何在图表上画点画线等自定义内容?](#如何在图表上画点画线等自定义内容)
[QA 16锯齿太严重如何让图表更顺滑](#锯齿太严重_如何让图表更顺滑)
[QA 17为什么鼠标移上图表 Tooltip 不显示?](#为什么鼠标移上图表Tooltip不显示)
[QA 18如何取消 Tooltip 的竖线?](#如何取消Tooltip的竖线)
[QA 19如何自定义 Tooltip 的显示内容?](#如何自定义Tooltip的显示内容)
[QA 20如何让Y轴数值轴显示多位小数](#如何让Y轴显示多位小数)
[QA 21如何用代码动态更新数据?](#如何用代码动态更新数据)
[QA 22如何显示图例?为什么有时候图例无法显示?](#如何显示图例_为什么有时候图例无法显示)
[QA 23如何做成预设?](#如何做成预设)
[QA 24如何在图表上画点画线等自定义内容](#如何在图表上画点画线等自定义内容)
[QA 25如何实现心电图类似的数据移动效果](#如何实现心电图类似的数据移动效果)
[QA 26如何使用背景组件有什么条件限制](#如何使用背景组件_有什么条件限制)
[QA 27Mesh can not have more than 65000 vertices?](#Mesh_cannot_have_more_than_65000_vertices)
[QA 28为什么serie里设置的参数运行后又被重置了?](#为什么serie里设置的参数运行后又被重置了)
[QA 29为什么升级到1.6.0版本后很多自定义颜色丢失了?应该如何升级?](#为什么升级到1_6_0版本后很多自定义颜色丢失了_应该如何升级)
## 如何调整坐标轴与背景的边距
@@ -36,13 +42,13 @@
答:调用`AnimationReset()`接口。
## 如何自定义折线图饼图等数据项的颜色
## 如何自定义折线图_饼图等数据项的颜色
答:通过`Theme``colorPalette`调整,或者部分`Serie`下的`LineStyle``ItemStyle`
## 如何格式化文字如我想给坐标轴标签加上单位
## 如何格式化文字_如我想给坐标轴标签加上单位
答:通过`formatter`参数,在`Legend``Axis``AxisLabel``Tooltop``Serie``Label`都提供参数的配置。
答:通过`formatter``numericFormatter`参数,在`Legend``Axis``AxisLabel``Tooltop``Serie``Label`都提供参数的配置。
## 如何让柱形图的柱子堆叠显示
@@ -58,21 +64,21 @@
## 如何调整柱形图单个柱子的颜色
答:目前暂不支持调整单子柱子的颜色,但可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
答:可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
## 如何调整图表的对齐方式
默认为左下角对齐暂不支持调整。可以通过包一层parent来辅助控制。
默认为左下角对齐暂不支持调整。可以通过包一层parent来辅助控制。(最新版本`1.5.0`及以上已支持任意锚点可和做UI一样任意调整对其方式
## 可以显示超过1000以上的大数据吗
答:可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie``symbol``label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。
答:可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie``symbol``label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large``largeThreshold`参数来开启性能模式。
## 折线图可以画虚线点线点划线吗
## 折线图可以画虚线_点线_点划线吗
答:可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。
## 如何限定Y轴Value轴的值范围
## 如何限定Y轴的值范围
答:设置`Axis`下的`minMaxType``Custom`,自定义`min``max`
@@ -88,29 +94,33 @@
答:通过设置`Serie``data`下的数据项可单独设置`icon`相关参数。
## 锯齿太严重如何让图表更顺滑
## 锯齿太严重_如何让图表更顺滑
开启抗锯齿设置。调整UI渲染模式为Camera模式开启MSAA设置4倍或更高抗锯齿。锯齿只能减少难以避免,像素越高锯齿越不明显。
答:开启抗锯齿设置(在`Unity`里设置)。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。
## 为什么鼠标移上图表`Tooltip`不显示
## 为什么鼠标移上图表Tooltip不显示
答:确认`Tooltip`是否开启确认父节点是否关闭了鼠标事件。
答:确认`Tooltip`是否开启确认父节点是否关闭了鼠标事件。
## 如何取消`Tooltip`的竖线
## 如何取消Tooltip的竖线
答:设置`Tooltip``type``None`
答:设置`Tooltip``type``None`或者调整`lineStyle`的参数。
## 如何让Y轴数值轴显示多位小数
## 如何自定义Tooltip的显示内容
答:设置`Axis`下的`AxisLabel`中的`formatter``{value:f1}``{value:f2}`
答:自定义总的内容可以通过`Tooltip``formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter``titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie``itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](XCharts配置项手册.md)。
## 如何让Y轴显示多位小数
答:设置`Axis`下的`AxisLabel`中的`formatter``{value:f1}``{value:f2}``1.5.0`及以上版本通过`numericFormatter`设置。
## 如何用代码动态更新数据
答:请查阅`Demo`下的代码,`Demo10_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能。
答:请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能相关API请查看文档[XChartsAPI接口](XChartsAPI.md)
## 如何显示图例
## 如何显示图例_为什么有时候图例无法显示
答:首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例即可
答:首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示
## 如何做成预设
@@ -118,7 +128,39 @@
## 如何在图表上画点画线等自定义内容
答:xcharts有自定义绘制回调`customDrawCallback`,具体可参考`Demo12_CustomDrawing.cs`
答:`XCharts`有自定义绘制回调`onCustomDraw`,具体可参考`Example12_CustomDrawing.cs`
## 如何实现心电图类似的数据移动效果
答:参考`Example`目录下的`Example_Dynamic.cs`。主要通过设置`maxCache`参数实现。`axis``serie`都设置相同的`maxCache``maxCache`可固定数据个数,当数据超过设定时会先删除第一个在添加新数据,实现数据移动效果。
## 如何使用背景组件_有什么条件限制
答:设置`background`组件的`show``true`
## 区域折线图在用半透明颜色时有时候会一条叠加的线
这是区域折线图绘制的bug。可以用浅的不透的颜色替代半透明颜色。
## Mesh_cannot_have_more_than_65000_vertices
答:这是`UGUI`对单个`Graphic`的顶点数限制。`XCharts`是将图形绘制在单个`Graphic`上,所以也会有这个限制。解决的办法可以参考:[QA 10可以显示超过1000以上的大数据吗](#可以显示超过1000以上的大数据吗)
## 为什么serie里设置的参数运行后又被重置了
答:检测下代码里是否调用了`RemoveData()`并重新添加`Serie`了。如果想保留`Serie`的配置可以只`ClearData()`,然后重新添加数据。
## 为什么升级到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/2.0/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级。
升级步骤如下:
1. 备份好你的项目。
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`)。
6. 升级`XCharts`到最新版本。
7. 通过`菜单栏->XCharts->ImportColorConfig``color.config`导入即可恢复自定义的颜色(如果`color.config`不在升级后的项目的`Assets`下的话需要拷贝到此目录下)。
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)

View File

@@ -0,0 +1,148 @@
# XCharts API
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)
## `BaseChart`
* `BaseChart.theme`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
* `BaseChart.series`:系列列表`Series`
* `BaseChart.chartName`:图表的别称。
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测。
* `BaseChart.onCustomDraw`自定义底部绘制回调。在绘制Serie前调用。
* `BaseChart.onCustomDrawBeforeSerie`自定义Serie绘制回调。在每个Serie绘制完前调用。
* `BaseChart.onCustomDrawAfterSerie`自定义Serie绘制回调。在每个Serie绘制完后调用。
* `BaseChart.onCustomDrawTop`自定义顶部绘制回调。在绘制Tooltip前调用。
* `BaseChart.onPointerClick`:鼠标点击回调。
* `BaseChart.onPointerDown`:鼠标按下回调。
* `BaseChart.onPointerUp`:鼠标弹起回调。
* `BaseChart.onPointerEnter`:鼠标进入图表回调。
* `BaseChart.onPointerExit`:鼠标退出图表回调。
* `BaseChart.onBeginDrag`:鼠标开始拖拽回调。
* `BaseChart.onDrag`:鼠标拖拽回调。
* `BaseChart.onEndDrag`:鼠标结束拖拽回调。
* `BaseChart.onScroll`:鼠标滚动回调。
* `BaseChart.SetSize(float width, float height)` 设置图表的宽高在非stretch pivot下才有效其他情况需要自己调整RectTransform
* `BaseChart.ClearData()`:清除所有数据,系列列表会保留,只是移除列表中系列的数据。
* `BaseChart.RemoveData()`:清除所有系列和图例数据,系列列表也会被清除。
* `BaseChart.RemoveData(string serieName)`:清除指定系列名称的数据。
* `BaseChart.AddSerie(SerieType type, string serieName = null, bool show = true)`:添加一个系列到系列列表中。
* `BaseChart.AddData(string serieName, float data, string dataName = null)`:添加一个数据到指定的系列中。
* `BaseChart.AddData(int serieIndex, float data, string dataName = null)`:添加一个数据到指定的系列中。
* `BaseChart.AddData(string serieName, List<float> multidimensionalData, string dataName = null)`:添加多维数据`x,y,z...`到指定的系列中。
* `BaseChart.AddData(int serieIndex, List<float> multidimensionalData, string dataName = null)`:添加多维数据`x,y,z...`到指定的系列中。
* `BaseChart.AddData(string serieName, float xValue, float yValue, string dataName)`:添加`x,y`数据到指定系列中。
* `BaseChart.AddData(int serieIndex, float xValue, float yValue, string dataName = null)`:添加`x,y`数据到指定系列中。
* `BaseChart.UpdateData(string serieName,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(int serieIndex,int dataIndex, float value)`:更新指定系列中的指定索引数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, List<float> multidimensionalData)`:更新指定系列指定索引的数据项的多维数据。
* `BaseChart.UpdateData(string serieName, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateData(int serieIndex, int dataIndex, int dimension, float value)`更新指定系列指定索引指定维数的数据。维数从0开始。
* `BaseChart.UpdateDataName(string serieName,int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.UpdateDataName(int serieIndex, int dataIndex, string dataName)`:更新指定系列中的指定索引数据名称。
* `BaseChart.SetActive(string serieName, bool active)`:设置指定系列是否显示。
* `BaseChart.SetActive(int serieIndex, bool active)`:设置指定系列是否显示。
* `BaseChart.IsActive(string serieName)`:获取指定系列是否显示。
* `BaseChart.IsActive(int serieIndex)`:获取指定系列是否显示。
* `BaseChart.IsActiveByLegend(string legendName)`:获得指定图例名字的系列是否显示。
* `BaseChart.RefreshChart()`:在下一帧刷新图表。
* `BaseChart.RefreshLabel()`:在下一帧刷新文本标签。
* `BaseChart.RefreshTooltip()`:立即刷新`Tooltip`组件。
* `BaseChart.UpdateTheme(Theme theme)`:切换图表主题。
* `BaseChart.AnimationEnable(bool flag)`:启用或关闭动画。
* `BaseChart.AnimationFadeIn()`:渐入动画。
* `BaseChart.AnimationFadeOut()`:渐出动画。
* `BaseChart.AnimationPause()`:暂停动画。
* `BaseChart.AnimationResume()`:继续动画。
* `BaseChart.AnimationReset()`:重置动画。
* `BaseChart.ClickLegendButton(int legendIndex, string legendName, bool show)`:点击图例按钮。
* `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.xAxes`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxes`:左右两个 `Y` 轴组件 `YAxis`
* `CoordianteChart.xAxis0`X轴
* `CoordianteChart.xAxis1`X轴
* `CoordianteChart.xAxis0`Y轴
* `CoordianteChart.yAxis1`Y轴
* `CoordinateChart.dataZoom`:区域缩放组件 `DataZoom`
* `CoordinateChart.ClearAxisData()`清除所有x轴和y轴的类目数据。
* `CoordinateChart.AddXAxisData(string category, int xAxisIndex = 0)`:添加一个类目数据到指定的 `X` 轴。
* `CoordinateChart.AddYAxisData(string category, int yAxisIndex = 0)`:添加一个类目数据到指定的 `Y` 轴。
* `CoordinateChart.IsValue()`:是否是纯数值坐标。
* `CoordinateChart.RefreshDataZoom()`在下一帧刷新DataZoom组件。
* `CoordinateChart.RefreshAxisMinMaxValue()`:立即刷新数值坐标轴的最大最小值(更新坐标轴标签并触发重绘)。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector3 local)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(float x, float y)`:坐标是否在坐标轴内。
* `CoordinateChart.IsInCooridate(Vector2 local)`:坐标是否在坐标轴内。
* `CoordinateChart.ClampInGrid(grid, Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
## `LineChart`
* 继承 `BaseChart`
* 继承自 `CoordinateChart`
## `BarChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
* `BarChart.onPointerClickBar`:点击柱条回调。参数:`eventData`, `dataIndex`
## `PieChart`
* 继承自 `BaseChart`
* `PieChart.onPointerClickPie`:点击柱条回调。参数:`eventData`, `serieIndex`, `dataIndex`
## `RadarChart`
* 继承自 `BaseChart`
* `RadarChart.radars`:雷达坐标系组件列表 `Radar`
* `RadarChart.RemoveRadar()`:移除所有雷达坐标系组件。
* `RadarChart.AddRadar(Radar radar)`:添加雷达坐标系组件。
* `RadarChart.AddRadar(Radar.Shape shape, Vector2 center, float radius, int splitNumber = 5,float lineWidth = 0.6f, bool showIndicator = true, bool showSplitArea = true)`:添加雷达坐标系组件。
* `RadarChart.AddIndicator(int radarIndex, string name, float min, float max)`:添加指示器。
* `RadarChart.UpdateIndicator(int radarIndex, int indicatorIndex, string name, float min, float max)`:更新指示器。
* `RadarChart.GetRadar(int radarIndex)`:获得指定索引的雷达坐标系组件。
* `RadarChart.GetIndicator(int radarIndex, int indicatorIndex)`:获得指定雷达坐标系组件指定索引的指示器。
## `ScatterChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `HeatmapChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `RingChart`
* 继承自 `BaseChart`
* `RingChart.UpdateMax(int serieIndex, int dataIndex, float value)`:更新指定系列执行数据项的最大值。
* `RingChart.UpdateMax(int serieIndex, float value)`:更新指定系列的所有数据项的最大值。
* `RingChart.UpdateMax(float value)`:更新第一个系列第一个数据项的最大值。
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f74b65f3be5d64689a5db6bdbc91df3e
guid: 529e55126e1d04a629b14d857f76fffd
TextScriptImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,963 @@
# XCharts Configuration
[XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts API](xcharts-api-EN.md)
[XCharts Q&A](xcharts-questions-and-answers-EN.md)
The translation work is still in progress.
__Main component:__
* [Axis](#XAxis)
* [Background](#Background)
* [DataZoom](#DataZoom)
* [Grid](#Grid)
* [Legend](#Legend)
* [Polar](#Polar)
* [Radar](#Radar)
* [Series](#Series)
* [Serie-Line](#Serie-Line)
* [Serie-Bar](#Serie-Bar)
* [Serie-Pie](#Serie-Pie)
* [Serie-Radar](#Serie-Radar)
* [Serie-Scatter](#Serie-Scatter)
* [Serie-Heatmap](#Serie-Heatmap)
* [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)
* [Tooltip](#Tooltip)
* [Vessel](#Vessel)
* [VisualMap](#VisualMap)
__Sub component:__
* [AreaStyle](#AreaStyle)
* [AxisLabel](#AxisLabel)
* [AxisLine](#AxisLine)
* [AxisName](#AxisName)
* [AxisSplitLine](#AxisSplitLine)
* [AxisSplitArea](#AxisSplitArea)
* [AxisTick](#AxisTick)
* [Emphasis](#Emphasis)
* [ItemStyle](#ItemStyle)
* [LineArrow](#LineArrow)
* [LineStyle](#LineStyle)
* [Location](#Location)
* [MarkLine](#MarkLine)
* [SerieAnimation](#SerieAnimation)
* [SerieData](#SerieData)
* [SerieLabel](#SerieLabel)
* [SerieSymbol](#SerieSymbol)
* [TextLimit](#TextLimit)
* [TextStyle](#TextStyle)
* [IconStyle](#IconStyle)
## `Theme`
Theme components. Topics are used to configure other parameters such as the global color scheme for the chart.
Parameters:
* `theme`: Built-in theme types. There are `Default`, `Light`, `Dark` three optional built-in theme.
* `font`: A common font for all text.
* `backgroundColor`: Chart background color.
* `titleTextColor`: The text color of the main title.
* `titleSubTextColor`: The text color of the sub title.
* `legendTextColor`: Legend text color when actived.
* `legendUnableColor`: Legend text color when unactived.
* `axisTextColor`: The text color of axis label.
* `axisLineColor`: The color of axis line.
* `axisSplitLineColor`: The color of the dividing line of the coordinate axis is the same as the default color of the axis.
* `tooltipBackgroundColor`: The background color of the tooltip.
* `tooltipFlagAreaColor`: The color of the shadow indicator for the tooltip.
* `tooltipTextColor`: The text color of Tooltip.
* `tooltipLabelColor`: The cross indicator in the tooltip coordinates the background color of the label.
* `tooltipLineColor`: The color of the indicator line in the tooltip.
* `dataZoomTextColor`: The text color of dataZoom.
* `dataZoomLineColor`: The line color of dataZoom.
* `dataZoomSelectedColor`: The selected area color of dataZoom.
* `colorPalette`: Palette color list. The color list of palette. If no color is set in series, the colors would be adopted sequentially and circularly from this list as the colors of series.
API:
* `GetColor(int index)`: Gets the color of the specified index from the palette.
* `GetColorStr(int index)`: Gets the hexadecimal color string of the specified index from the palette.
* `GetColor(string hexColorStr)`: Convert the html string to color.
## `Title`
Title component, including main title and subtitle.
Parameters:
* `show`: Whether to show title component.Set this to false to prevent the title component from showing.
* `text`: The content of main title, supporting `\n` for newlines.
* `textStyle`: The text style of main title [TextStyle](#TextStyle).
* `subText`: The content of sub title, supporting `\n` for newlines.
* `subTextStyle`: The text style of sub title [TextStyle](#TextStyle).
* `itemGap`: The gap between the main title and sub title.
* `location`: The location of title component [Location](#Location).
## `TitleStyle`
Sub component for serie title.
* `show`: Whether to show serie title.
* `textStyle`: The text style of title [TextStyle](#TextStyle).
## `Legend`
Legend component.The legend component shows different sets of symbol, colors, and names. You can control which series are not displayed by clicking on the legend.
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.
* `None`: cant select.
* `orient`: horizontal or vertical layout:
* `Horizonal`: horizontal layout.
* `Vertical`: vertical layout.
* `location`: the localtion of legend in chart [Location](#Location).
* `itemWidth`: the width of legend icon.
* `itemHeight`: the height of legend icon.
* `itemGap`: The distance between each legend, horizontal distance in horizontal layout, and vertical distance in vertical layout.
* `itemAutoColor`: Whether the legend symbol matches the color automatically.
* `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 style of text [TextStyle](#TextStyle).
API:
* `ClearData()`: Clear legend data.
* `ContainsData(string name)`: Whether include in legend data by the specified name.
* `RemoveData(string name)`: Remove legend from data.
* `AddData(string name)`: Add legend.
* `GetData(int index)`: Get legend.
* `GetIndex(string legendName)`: Get the index of legend.
## `Polar`
Polar coordinate can be used in scatter and line chart. Every polar coordinate has an angleAxis and a radiusAxis.
Parameters:
* `show`: Whether to show the polor component.
* `center`: The center of ploar. 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.
* `radius`: the radius of polar.
* `backgroundColor`: Background color of polar, which is transparent by default.
## `Radar`
Radar coordinate conponnet for radar charts.
* `shape`: Radar render type, in which `Polygon` and `Circle` are supported.
* `Polygon`: Polygon.
* `Circle`: Circle.
* `positionType`: The position type of radar indicator label display.
* `Vertice`: Display at the vertex.
* `Between`: Display at the middle of line.
* `radius`: The radius of radar.[default:0.3f].
* `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].
* `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.
* `indicatorGap`: The gap of indicator and radar.
* `indicatorList`: The indicator list [Radar.Indicator](#Radar.Indicator).
## `Radar.Indicator`
Indicator of radar chart, which is used to assign multiple variables(dimensions) in radar chart.
* `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`
Text character limitation and adaptation component. When the length of the text exceeds the set length, it is cropped and suffixes are appended to the end. Only valid in the category axis.
* `enable`: Whether to enable text limit. [default: `true`].
* `maxWidth`: Set the maximum width. A default of 0 indicates automatic fetch; otherwise, custom. Clipping occurs when the width of the text is greater than this value. [default: `0f`].
* `gap`: White pixel distance at both ends. [default: `10f`].
* `suffix`: Suffixes when the length exceeds. [default: `"..."`].
## `TextStyle`
The component of settings related to text.
* `rotate`: rotate of text. [default: `0f`].
* `offset`: offset of text position. [default: `Vector2.zero`].
* `color`: color of text. [default: `Color.clear`].
* `backgroundColor`: color of text background. [default: `Color.clear`].
* `font`: the font of text. When `null`, the theme's font is used by default. [default: `null`].
* `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`
Tooltip component.
* `show`: Whether to show the tooltip component.
* `type`: Indicator type. Indicator types are:
* `Line`: line indicator.
* `Shadow`: shadow crosshair indicator.
* `None`: no indicator displayed.
* `Corss`: crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.
* `formatter`: A string template formatter for the total content of the prompt box. Support for wrapping lines with `\n`. When formatter is not null, use formatter first, otherwise use itemFormatter.
* Template variables are `{.}`, `{a}`, `{b}`, `{c}`, `{d}`.
* `{.}` is the dot of the corresponding color of `serie` that is currently indicated or whose `index` is `0`.`
* `{a}` is the `name` of the `serie` that is currently indicated or whose `index` is `0`.
* `{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).
* `{c1:2-2}` represents the third data item from `serie`'s third data item indexed to `1` (i.e., which data item must be specified to specify).
* `{d1:2: F2}` indicates that a formatted string with a value specified separately is `F2` (`numericFormatter` is used when not specified).
* 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>
* `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.
* `minHeight`: Minimum height. If `fixedHeight` has a value, get `fixedHeight` first.
* `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.
* `lineStyle`: the line style of indicator line [LineStyle](#LineStyle).
* `textStyle`: the text style of content [TextStyle](#TextStyle).
## `Vessel`
Vessel component for liquid chart. There can be multiple vessels in a Chart, which can be matched by vesselIndex in Serie.
* `show`: Whether to show the vessel. [defaut: `true`]
* `shape`: The shape of vessel. [default: `Shape.Circle`]
* `shapeWidth`: Thickness of vessel. [defaut: `5f`]
* `gap`: The gap between the vessel and the liquid. [defaut: `10f`]
* `center`: The center of vessel. 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.45f]`]
* `radius`: The radius of vessel. When value between 0 and 1 represents a percentage relative to the chart. [default: `0.35f`]
* `smoothness`: The smoothness of wave. [default: `1f`]
* `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.
* `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).
* `supportSlider`: Whether a slider is supported. There are separate sliders on which the user zooms or roams.
* ~~`filterMode`: The mode of data filter, not support yet.~~
* ~~`Filter`: data that outside the window will be filtered, which may lead to some changes of windows of other axes. For each data item, it will be filtered if one of the relevant dimensions is out of the window.~~
* ~~`WeakFilter`: data that outside the window will be filtered, which may lead to some changes of windows of other axes. For each data item, it will be filtered only if all of the relevant dimensions are out of the same side of the window.~~
* ~~`Empty`: data that outside the window will be set to NaN, which will not lead to changes of windows of other axes.~~
* ~~`None`: Do not filter data.~~
* ~~`xAxisIndex`: Specify which xAxis is controlled by the dataZoom.~~
* ~~`yAxisIndex`: Specify which yAxis is controlled by the dataZoom.~~
* `showDataShadow`: Whether to show data shadow, to indicate the data tendency in brief. [default: `true`]
* `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.
* `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`]
* `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`
VisualMap component. mapping data to visual elements such as colors.
* `enable`: Whether enable visualMap component. [default: false]
* `show`: Whether to display components. If set to false, it will not show up, but the data mapping function still exists. [default: true]
* `type`: the type of visualmap component.
* `Continuous`: Continuous.
* ~~`Piecewise`: Piecewise.~~
* ~~`selectedMode`: the selected mode for Piecewise visualMap.~~
* ~~`Multiple`: Multiple.~~
* ~~`Single`: Single.~~
* `autoMinMax`: Automatically set min, Max value.
* `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`].~~
* ~~`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).
* ~~`realtime`: Whether to update in real time while dragging.~~
* `itemWidth`: The width of the figure, that is, the width of the color bar.
* `itemHeight`: The height of the figure, that is, the height of the color bar.
* `borderWidth`: 边框线宽单位px。
* `dimension`: Specifies which `dimension` of the `Data` to map to the visual element. `Data` is series.data. Starting at 1, the default is 0 to take the last dimension in data.
* `hoverLink`: When the hoverLink function is turned on, when the mouse hovers over the visualMap component, the corresponding value of the mouse position is highlighted in the corresponding graphic element in the diagram. Conversely, when the mouse hovers over a graphic element in a diagram, the corresponding value of the visualMap component is triangulated in the corresponding position.
* `orient`: Is the layout horizontal or vertical.
* `location`: The location of component.
* `inRange`: Defines the visual color in the selected range.
* ~~`outOfRange`: Defines a visual color outside of the selected range.~~
## `Grid`
Grid component. Drawing grid in rectangular coordinate. In a single grid, at most two X and Y axes each is allowed. Line chart, bar chart, and scatter chart can be drawn in grid. There is only one single grid component at most in a single echarts instance.
* `show`: Whether to show the grid in rectangular coordinate.
* `left`: Distance between grid component and the left side of the container.
* `right`: Distance between grid component and the right side of the container.
* `top`: Distance between grid component and the top side of the container.
* `bottom`: Distance between grid component and the bottom side of the container.
* `backgroundColor`: Background color of grid, which is transparent by default.
## `GaugeAxis`
GaugeAxis sub component. Settings related to gauge axis line.
* `axisLine`: axis line style.
* `splitLine`: slit line style.
* `axisTick`: axis tick style.
* `axisLabel`: axis label style.
* `axisLabelText`: Coordinate axis scale label custom content. When the content is empty, `axisLabel` automatically displays the content according to the scale; otherwise, the content is taken from the list definition.
## `GaugePointer`
GaugePointer sub component. Settings related to gauge pointer.
* `show`: Whether to display a pointer.
* `width`: Pointer width.
* `length`: Pointer length. It can be an absolute value, or it can be a percentage relative to the radius (0-1).
## `XAxis`
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 `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`.
* `Default`: 0 - max.
* `MinMax`: min - max.
* `Custom`: Custom min - max.
* `min`: The minimun value of axis. Valid when `minMaxType` is `Custom`.
* `max`: The maximum value of axis. Valid when `minMaxType` is `Custom`.
* `ceilRate`: The ratio of maximum and minimum values rounded upward. The default is 0, which is automatically calculated.
* `splitNumber`: Number of segments that the axis is split into. The default is `5`, When `splitNumber` is set to `0`, it draws all the category data.
* `interval`: Compulsively set segmentation interval for axis.This is unavailable for category axis. The `splitNumber` is invalid when set.
* `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`
Background component.Due to the limitations of the framework, there are two limitations to the use of background component:
1: The parent node of chart cannot have a layout control class component.
2: The parent node of Chart can only have one child node of the current chart.
* `show`: Whether to enable the background component. However, the ability to activate the background component is subject to other conditions.
* `image`: the image of background.
* `imageType`: the fill type of background image.
* `imageColor`: the color of background image, The default is `white`.
* `hideThemeBackgroundColor`: Whether to hide the background color set in the `theme` when the background component is on.
## `YAxis`
The y axis in cartesian(rectangular) coordinate. a grid component can place at most 2 y axis, one on the left and another on the right.
The parameters are the same as XAxis.
## `Series`
Serie list. Each serie determines its own chart type by `type`.
Check each serie for parameters.
## `Serie-Line`
Line chart serie.
* `show`: Whether to show serie in chart.
* `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.
* `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.
* `sampleDist`: The minimum horizontal pixel distance of sampling, which defaults to `0` without sampling. When the horizontal pixel distance between two data points is less than this value, start sampling to ensure that the horizontal pixel distance between two points is not less than this value.
* `sampleType`: Sample type. This is valid when `sampleDist` is greater than `0`. The following five sampling types are supported:
* `Peak`: Take a peak. When the average value of the filter point is greater than or equal to `sampleAverage`, take the maximum value; If you do it the other way around, you get the minimum.
* `Average`: Take the average of the filter points.
* `Max`: Take the maximum value of the filter point.
* `Min`: Take the minimum value of the filter point.
* `Sum`: Take the sum of the filter points.
* `sampleAverage`: Set the sampling average. When `sampleType` is `Peak`, is the maximum or minimum value used to compare the average value of the filtered data. The default of `0` is to calculate the average of all data in real time.
* `clip`: 是否裁剪超出坐标系部分的图形。
* `ignore`: 是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。
* `ignoreValue`: 忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
* `showAsPositiveNumber`: 将负数数值显示为正数。一般和`AxisLabel``showAsPositiveNumber`配合使用。仅在折线图和柱状图中有效。
* `large`: 是否开启大数据量优化,在数据图形特别多而出现卡顿时候可以开启。开启后配合 largeThreshold 在数据量大于指定阈值的时候对绘制进行优化。缺点: 优化后不能自定义设置单个数据项的样式不能显示Label折线图不绘制Symbol。
* `largeThreshold`: 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
* `areaStyle`: 区域填充样式 [AreaStyle](#AreaStyle)。
* `symbol`: 标记的图形 [SerieSymbol](#SerieSymbol)。
* `lineType`: 折线图样式类型。支持以下十种类型:
* `Normal`: 普通折线图。
* `Smooth`: 平滑曲线。
* `SmoothDash`: 平滑虚线。
* `StepStart`: 阶梯线图: 当前点。
* `StepMiddle`: 阶梯线图: 当前点和下一个点的中间。
* `StepEnd`: 阶梯线图: 下一个拐点。
* `Dash`: 虚线。
* `Dot`: 点线。
* `DashDot`: 点划线。
* `DashDotDot`: 双点划线。
* `lineStyle`: 线条样式 [LineStyle](#LineStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `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`
折线图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Bar`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`: 数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `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时超过指定值会移除旧数据再插入新数据。
* `barType`: 柱状图类型。以下几种类型:
* `Normal`: 普通柱状图。
* `Zebra`: 斑马柱状图。
* `Capsule`: 胶囊柱状图。
* `barPercentStack`: 是否百分比堆叠柱状图,相同 `stack``serie` 只要有一个 `barPercentStack``true`,则就显示成百分比堆叠柱状图。
* `barWidth`: 柱条的宽度,不设时自适应。支持设置成相对于类目宽度的百分比。
* `barGap`: 不同系列的柱间距离。为百分比(如 `'0.3f'`,表示柱子宽度的 `30%`)。如果想要两个系列的柱子重叠,可以设置 `barGap``'-1f'`。这在用柱子做背景的时候有用。在同一坐标系上,此属性会被多个 `'bar'` 系列共享。此属性应设置于此坐标系中最后一个 `'bar'` 系列上才会生效,并且是对此坐标系中所有 `'bar'` 系列生效。
* `barCategoryGap`: 同一系列的柱间距离默认为类目间距的20%,可设固定值。在同一坐标系上,此属性会被多个 `'bar'` 系列共享。此属性应设置于此坐标系中最后一个 `'bar'` 系列上才会生效,并且是对此坐标系中所有 `'bar'` 系列生效。
* `barZebraWidth`: 斑马线的粗细。`barType``Zebra` 时有效。
* `barZebraGap`: 斑马线的间距。`barType``Zebra` 时有效。
* `clip`: 是否裁剪超出坐标系部分的图形。
* `ignore`: 是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。
* `ignoreValue`: 忽略数据的默认值。默认值默认为0`ignore``true` 才有效。
* `showAsPositiveNumber`: 将负数数值显示为正数。一般和`AxisLabel``showAsPositiveNumber`配合使用。仅在折线图和柱状图中有效。
* `large`: 是否开启大数据量优化,在数据图形特别多而出现卡顿时候可以开启。开启后配合 largeThreshold 在数据量大于指定阈值的时候对绘制进行优化。缺点: 优化后不能自定义设置单个数据项的样式不能显示Label折线图不绘制Symbol。
* `largeThreshold`: 开启大数量优化的阈值。只有当开启了large并且数据量大于该阀值时才进入性能模式。
* `symbol`: 标记的图形 [SerieSymbol](#SerieSymbol)。
* `itemStyle`: 柱条样式 [ItemStyle](#ItemStyle)。
* `areaStyle`: 区域填充样式 [AreaStyle](#AreaStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Pie`
饼图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Pie`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `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` 才有效。
* `avoidLabelOverlap`: 在饼图且标签外部显示的情况下,是否启用防止标签重叠策略,默认关闭,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Radar`
雷达图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Radar`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `radarType`: 雷达图类型`RadarType`,支持以下类型:
* `Multiple`: 多圈雷达图。此时可一个雷达里绘制多个圈,一个`serieData`就可组成一个圈(多维数据)。
* `Single`: 单圈雷达图。此时一个雷达只能绘制一个圈,多个`serieData`组成一个圈,数据取自`data[1]`
* `radarIndex`: 雷达图所使用的 `radar` 组件的 `index`
* `symbol`: 标记的图形 [SerieSymbol](#SerieSymbol)。
* `lineStyle`: 线条样式 [LineStyle](#LineStyle)。
* `itemStyle`: 标记样式 [ItemStyle](#ItemStyle)。
* `areaStyle`: 区域填充样式 [AreaStyle](#AreaStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Scatter`
散点图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Scatter`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `clip`: 是否裁剪超出坐标系部分的图形。
* `symbol`: 标记的图形 [SerieSymbol](#SerieSymbol)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Heatmap`
热力图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Scatter`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `ignore`: 是否开启忽略数据。当为 `true` 时,数据值为 `ignoreValue` 时不进行绘制。
* `ignoreValue`: 忽略数据的默认值。默认值默认为`0`,当 `ignore``true` 才有效。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Gauge`
仪表盘系列。
* `show`: 系列是否显示在图表上。
* `type`: `Gauge`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `gaugeType`: 仪表盘类型,支持以下类型:
* `Pointer`: 指针类型。
* `ProgressBar`: 进度条类型。
* `center`: 中心点坐标。当值为0-1的浮点数时表示百分比。
* `radius`: 仪表盘半径。
* `min`: 最小的数据值。映射到`startAngle`
* `max`: 最大的数据值。映射到`endAngle`
* `startAngle`: 仪表盘起始角度。和时钟一样,`12`点钟位置是`0`度,顺时针到`360`度。
* `endAngle`: 仪表盘结束角度。和时钟一样,`12`点钟位置是`0`度,顺时针到`360`度。
* `splitNumber`: 仪表盘刻度分割段数。
* `roundCap`: 是否启用圆弧效果。
* `titleStyle`: 仪表盘标题 [TitleStyle](#TitleStyle)。
* `gaugeAxis`: 仪表盘坐标轴 [GaugeAxis](#GaugeAxis)。
* `gaugePointer`: 仪表盘指针 [GaugePointer](#GaugePointer)。
* `itemStyle`: 仪表盘指针样式 [ItemStyle](#ItemStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。仪表盘的数据一般只有一个,值通过`label`样式显示,`name`通过`titleStyle`样式显示。
## `Serie-Ring`
环形图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Ring`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `center`: 中心点坐标。当值为`0-1`的浮点数时表示百分比。
* `radius`: 仪表盘半径。
* `startAngle`: 仪表盘起始角度。和时钟一样,`12`点钟位置是`0`度,顺时针到`360`度。
* `ringGap`: 环形图的环间隙。
* `roundCap`: 是否启用圆弧效果。
* `clockwise`: 是否顺时针,默认为`true`
* `titleStyle`: 环形图中心标题 [TitleStyle](#TitleStyle)。
* `itemStyle`: 环形图的圆环样式,包括设置背景颜色和边框等 [ItemStyle](#ItemStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`: 高亮样式 [Emphasis](#Emphasis)。
* `animation`: 起始动画 [SerieAnimation](#SerieAnimation)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。环形图的数据只有二维,`data[0]`表示当前值,`data[1]`表示最大值。
## `Serie-Liquid`
水位图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Liquid`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `vesselIndex`: 水位图所使用的`vessel`组件的`index`
* `min`: 最小值。
* `max`: 最大值。
* `waveLength`: 水波长。
* `waveHeight`: 水波高。
* `waveSpeed`: 水波移动速度。正数时左移,负数时右移。
* `waveOffset`: 水波偏移。
* `itemStyle`: 环形图的圆环样式,包括设置背景颜色和边框等 [ItemStyle](#ItemStyle)。
* `label`: 图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `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`: 线段的分割距离。普通折线图的线是由很多线段组成,段数由该数值决定。值越小段数越多,但顶点数也会随之增加。当开启有渐变的区域填充时,数值越大渐变过渡效果越差。
* `cicleSmoothness`: 圆形(包括扇形、环形等)的平滑度。数越小圆越平滑,但顶点数也会随之增加。
## `SerieAnimation`
* `enable`: 是否开启动画系统。
* ~~`threshold`: 是否开启动画的阈值,当单个系列显示的图形数量大于这个阈值时会关闭动画。~~
* `fadeInDelay`: 设定的渐入动画延时,单位毫秒。如果要设置单个数据项的延时,可以用代码定制: `customFadeInDelay`
* `fadeInDuration`: 设定的渐入动画时长,单位毫秒。如果要设置单个数据项的渐入时长,可以用代码定制: `customFadeInDuration`
* `fadeOutDelay`: 设定的渐出动画延时,单位毫秒。如果要设置单个数据项的延时,可以用代码定制: `customFadeOutDelay`
* `fadeOutDuration`: 设定的渐出动画时长,单位毫秒。如果要设置单个数据项的渐出时长,可以用代码定制: `customFadeOutDuration`
* `dataChangeEnable`: 是否开启数据变更动画。
* `dataChangeDuration`: 数据变更动画时长,单位毫秒。
## `AreaStyle`
* `show`: 是否显示区域填充。
* `origin`: 区域填充的起始位置 `AreaOrigin`。有以下三种填充方式:
* `Auto`: 填充坐标轴轴线到数据间的区域。
* `Start`: 填充坐标轴底部到数据间的区域。
* `End`: 填充坐标轴顶部到数据间的区域。
* `color`: 区域填充的颜色,默认取 `serie` 对应的颜色。如果 `toColor` 不是默认值,则表示渐变色的起点颜色。
* `toColor`: 区域填充的渐变色的终点颜色。
* `highlightColor`: 高亮时区域填充的颜色,默认取 `serie` 对应的颜色。如果 `highlightToColor` 不是默认值,则表示渐变色的起点颜色。
* `highlightToColor`: 高亮时区域填充的渐变色的终点颜色。
* `opacity`: 图形透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
* `tooltipHighlight`: 鼠标悬浮时是否高亮之前的区域。
## `AxisLabel`
* `show`: 是否显示刻度标签。
* `interval`: 坐标轴刻度标签的显示间隔,在类目轴中有效。`0`表示显示所有标签,`1`表示隔一个隔显示一个标签,以此类推。
* `inside`: 刻度标签是否朝内,默认朝外。
* `margin`: 刻度标签与轴线之间的距离。
* `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`
* `show`: 是否显示坐标轴轴线。
* `onZero`: `X` 轴或者 `Y` 轴的轴线是否在另一个轴的 `0` 刻度上,只有在另一个轴为数值轴且包含 `0` 刻度时有效。
* `width`: 坐标轴线线宽。
* `symbol`: 是否显示箭头。
* `symbolWidth`: 箭头宽。
* `symbolHeight`: 箭头高。
* `symbolOffset`: 箭头偏移。
* `symbolDent`: 箭头的凹陷程度。
## `AxisName`
* `show`: 是否显示坐标名称。
* `name`: 坐标轴名称。
* `location`: 坐标轴名称的位置。支持以下类型:
* `Start`: 坐标轴起始处。
* `Middle`: 坐标轴中间。
* `End`: 坐标轴末端。
* `textStyle`: The style of text [TextStyle](#TextStyle).
## `AxisSplitLine`
* `show`: 是否显示坐标分割线。
* `interval`: 分割线的显示间隔。`0` 表示显示所有分割线,`1` 表示隔一个隔显示一个分割线,以此类推。
* `lineStyle`: 线条样式 [LineStyle](#LineStyle)。
## `AxisSplitArea`
* `show`: 是否显示坐标分割区域。
* `color`: 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
## `AxisTick`
* `show`: 是否显示坐标轴刻度。
* `alignWithLabel`: 类目轴中在 `boundaryGap``true` 的时候有效,可以保证刻度线和标签对齐。
* `inside`: 坐标轴刻度是否朝内,默认朝外。
* `length`: 坐标轴刻度的长度。
* `width`: 坐标轴刻度的宽度。默认为0时宽度和坐标轴一致。
* `showStartTick`:是否显示第一个刻度。
* `showEndTick`:是否显示最后一个刻度。
## `Emphasis`
* `show`: 是否启用高亮样式。
* `label`: 图形文本标签样式 [SerieLabel](#SerieLabel)。
* `itemStyle`: 图形样式 [ItemStyle](#ItemStyle)。
## `ItemStyle`
* `show`: 是否启用。
* `color`: 颜色。对于K线图对应阳线的颜色。
* `color0`: 颜色。对于K线图对应阴线的颜色。
* `toColor`: 渐变颜色1。
* `toColor2`: 渐变颜色2。只在折线图中有效。
* `backgroundColor`: 背景颜色。
* `backgroundWidth`: 背景的宽。
* `centerColor`: 中心区域的颜色。如环形图的中心区域。
* `centerGap`: 中心区域的间隙。如环形图的中心区域于最内环的间隙。
* `borderType`: 边框的类型。
* `borderColor`: 边框的颜色。对于K线图对应阳线的边框颜色。
* `borderColor0`: 边框的颜色。对于K线图对应阴线的边框颜色。
* `borderWidth`: 边框宽。
* `opacity`: 透明度。
* `tooltipFormatter`: 提示框单项的字符串模版格式器。具体配置参考`Tooltip``formatter`
* `numericFormatter`: 标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式: `A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`。此字段优先于`SerieLabel``Tooltip``numericFormatter`
* `cornerRadius`: 圆角半径。用数组分别指定4个圆角半径顺时针左上右上右下左下。支持用0-1的浮点数设置百分比。
## `LineArrow`
* `show`: 是否显示箭头。
* `position`: 箭头显示位置。支持以下两种位置:
* `End`: 末端显示。最后一个数据上显示箭头。
* `Start`: 起始端显示。第一个数据上显示箭头。
* `width`: 箭头宽。
* `height`: 箭头长。
* `offset`: 箭头偏移。默认箭头的中心点和数据坐标点一致,可通过 `offset` 调整偏移。
* `dent`: 箭头的凹度。
## `LineStyle`
* `show`: 是否显示线条。当作为子组件,它的父组件有参数控制是否显示时,改参数无效。
* `type`: 线条类型。支持以下五种类型:
* `None`: 不显示分割线。
* `Solid`: 实线。
* `Dashed`: 虚线。
* `Dotted`: 点线。
* `DashDot`: 点划线。
* `DashDotDot`: 双点划线。
* `color`: 线条颜色。默认和 `serie` 一致。
* `toColor`: 线的渐变颜色(需要水平方向渐变时)。
* `toColor2`: 线的渐变颜色2需要水平方向三个渐变色的渐变时
* `width`: 线条宽。
* `opacity`: 线条的透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
## `Location`
* `align`: 对齐方式。有以下对齐方式。
* `TopLeft`: 左上角对齐。
* `TopRight`: 右上角对齐。
* `TopCenter`: 置顶居中对齐。
* `BottomLeft`: 左下对齐。
* `BottomRight`: 右下对齐。
* `BottomCenter`: 底部居中对齐。
* `Center`: 居中对齐。
* `CenterLeft`: 中部靠左对齐。
* `CenterRight`: 中部靠右对齐。
* `left`: 离容器左侧的距离。
* `right`: 离容器右侧的距离。
* `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`: 单个数据项的标签设置。
* `enableItemStyle`: 是否启用单个数据项的样式。
* `itemStyle`: 单个数据项的样式设置。
* `enableEmphasis`: 是否启用单个数据项的高亮样式。
* `emphasis`: 单个数据项的高亮样式设置。
* `enableSymbol`: 是否启用单个数据项的标记设置。
* `symbol`: 单个数据项的标记设置。
* `data`: 可指定任意维数的数值列表。对于折线图和柱状图,`data`其实是`size``2`的数组,`data[0]`是x的编号`data[1]``y`的数值,默认显示`data[1]`。其他图表看需求而定是长度大于`2`的数组。可通过`Serie``showDataDimension`指定数据长度。
## `SerieLabel`
* `show`: 是否显示文本标签。
* `position`: 标签的位置。折线图时强制默认为 `Center`,支持以下 `5` 种位置:
* `Outside`: 饼图扇区外侧,通过视觉引导线连到相应的扇区。只在饼图种可用。
* `Inside`: 饼图扇区内部。只在饼图可用。
* `Center`: 在中心位置(折线图,柱状图,饼图)。
* `Top`: 顶部(柱状图)。
* `Bottom`: 底部(柱状图)。
* `formatter`: 标签内容字符串模版格式器。支持用 `\n` 换行。模板变量有: `{a}`: 系列名;`{b}`: 数据名;`{c}`: 数据值;`{d}`: 百分比。示例: `{b}:{c}`
* `numericFormatter`: 标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式: `A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `offset`: 距离图形元素的偏移。
* `autoOffset`: 是否开启自动偏移。当开启时Y的偏移会自动判断曲线的开口来决定向上还是向下偏移。
* `backgroundWidth`: 标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
* `backgroundHeight`: 标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
* `paddingLeftRight`: 标签文字和边框的左右边距。
* `paddingTopBottom`: 标签文字和边框的上下边距。
* `line`: 是否显示视觉引导线。在 `label` 位置 设置为 `'Outside'` 的时候会显示视觉引导线。
* `lineType`: 视觉引导线类型。支持以下几种类型:
* `BrokenLine`: 折线。
* `Curves`: 曲线。
* `HorizontalLine`: 水平线。
* `lineColor`: 视觉引导线自定义颜色。
* `lineWidth`: 视觉引导线的宽度。
* `lineLength1`: 视觉引导线第一段的长度。
* `lineLength2`: 视觉引导线第二段的长度。
* `border`: 是否显示边框。
* `borderWidth`: 边框宽度。
* `borderColor`: 边框颜色。
* `textStyle`: The style of text [TextStyle](#TextStyle).
## `SerieSymbol`
* `show`: 是否显示标记。
* `type`: 标记类型。支持以下六种类型:
* `EmptyCircle`: 空心圆。
* `Circle`: 实心圆。
* `Rect`: 正方形。可通过设置`itemStyle``cornerRadius`变成圆角矩形。
* `Triangle`: 三角形。
* `Diamond`: 菱形。
* `None`: 不显示标记。
* `gap`: 图形标记的外留白距离。
* `sizeType`: 标记图形的大小获取方式。支持以下三种类型:
* `Custom`: 自定义大小。
* `FromData`: 通过 `dataIndex` 从数据中获取,再乘以一个比例系数 `dataScale`
* `Callback`: 通过回调函数 `sizeCallback` 获取。
* `size`: 标记的大小。
* `selectedSize`: 被选中的标记的大小。
* `dataIndex`: 当 `sizeType` 指定为 `FromData` 时,指定的数据源索引。
* `dataScale`: 当 `sizeType` 指定为 `FromData` 时,指定的倍数系数。
* `selectedDataScale`: 当 `sizeType` 指定为 `FromData` 时,指定的高亮倍数系数。
* `sizeCallback`: 当 `sizeType` 指定为 `Callback` 时,指定的回调函数。
* `selectedSizeCallback`: 当 `sizeType` 指定为 `Callback` 时,指定的高亮回调函数。
* `color`: 标记图形的颜色,默认和系列一致。
* `opacity`: 图形标记的透明度。
* `startIndex`: 开始显示图形标记的索引。
* `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

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 9a4780a4fbaf446cc9d948b6b2c803d6
guid: 3fa7a80a30cd846139159beaadba05f2
TextScriptImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,161 @@
# XCharts Q&A
[XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts API](xcharts-api-EN.md)
[XCharts Configuration](xcharts-configuration-EN.md)
[QA 1: How to adjust the margin between the axis and the background?](#How-to-adjust-the-margin-between-the-axis-and-the=-background)
[QA 2: How to play agian the fadeIn animation?](#How-to-play-agian-the-fadeIn-animation)
[QA 3: How to customize the color of data item in line chart and pie chart?](#How-to-customize-the-color-of-data-item-in-line-chart-and-pie-chart)
[QA 4: How to formatter the text of axis label, such as add a units text?](#How-to-formatter-the-text-of-axis-label-such-as-add-a-units-text)
[QA 5: How to stack the bar of bar chart](#How-to-stack-the-bar-of-bar-chart)
[QA 6: How to make the bar serie in the same bar but not stack?](#How-to-make-the-bar-serie-in-the-same-bar-but-not-stack)
[QA 7: How to adjust the bar width and gap of barchart?](#How-to-adjust-the-bar-width-and-gap-of-barchart)
[QA 8: How to adjust the color of bar?](#How-to-adjust-the-color-of-bar)
[QA 9: Can I adjust the anchor of chart?](#Can-I-adjust-the-anchor-of-chart)
[QA 10: Can display more than 1000 data?](#Can-display-more-than-1000-data)
[QA 11: Can line chart drawing be dash, dot and dash-dot?](#Can-line-chart-drawing-be-dash-dot-and-dash-dot)
[QA 12: How to limit the value range of the Y-axis?](#How-to-limit-the-value-range-of-the-Y-axis)
[QA 13: How to customize the tick value range of value axis?](#How-to-customize-the-tick-value-range-of-value-axis)
[QA 14: How to display text at the top of data items?](#How-to-display-text-at-the-top-of-data-items)
[QA 15: How do I customize icons for data items?](#How-do-I-customize-icons-for-data-items)
[QA 16: How to anti-aliasing and make the chart smoother?](#How-to-anti-aliasing-and-make-the-chart-smoother)
[QA 17: Why does mouse over chart Tooltip not show?](#Why-does-mouse-over-chart-Tooltip-not-show)
[QA 18: How not to display the bar line of Tooltip?](#How-not-to-display-the-bar-line-of-Tooltip)
[QA 19: How do I customize the display of Tooltip?](#How-do-I-customize-the-display-of-Tooltip)
[QA 20: How do I get the Y-axis to display multiple decimal places?](#How-do-I-get-the-Y-axis-to-display-multiple-decimal-places)
[QA 21: How do I dynamically update data with code?](#How-do-I-dynamically-update-data-with-code)
[QA 22: How to display legend? Why are legends sometimes not displayed?](#How-to-display-legend?Why-are-legends-sometimes-not-displayed)
[QA 23: How to make chart as prefab?](#How-to-make-chart-as-prefab)
[QA 24: How do I draw custom graphic in chart,such as line or dot?](#How-do-I-draw-custom-content-in-chart-such-as-line-or-dot)
[QA 25: How to achieve similar data movement effect of ELECTRO cardiogram?](#How-to-achieve-similar-data-movement-effect-of-ELECTRO-cardiogram)
[QA 26: How do I use the background component? What are the conditions?](#How-do-I-use-the-background-component-What-are-the-conditions)
[QA 27: Mesh can not have more than 65000 vertices?](#Mesh-cannot-have-more-than-65000-vertices)
[QA 28: Why are the parameters set in Serie reset after they run?](#Why-are-the-parameters-set-in-Serie-reset-after-they-run)
[QA 29: Why are many custom colors lost after upgrading to 1.6.0? How should I upgrade?](#Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade)
## How-to-adjust-the-margin-between-the-axis-and-the=-background
A: `Grid` conponentwhich can adjust the left, right, up, down margins of chart.
## How-to-play-agian-the-fadeIn-animation
A: call the `chart.AnimationReset()` API.
## How-to-customize-the-color-of-data-item-in-line chart-and-pie-chart
A: `Theme`->`colorPalette`, or the sub component `LineStyle` and `ItemStyle` of `Serie`.
## How-to-formatter-the-text-of-axis-label-such-as-add-a-units-text
A: Adjust `formatter` and `numericFormatter` parameter of `Legend`, `AxisLabel`, `Tooltop`, `SerieLabel`.
## How-to-stack-the-bar-of-bar-chart
A: Set the `stack` parameter of `Serie`, the series will stack in a bar with the same `stack`.
## How-to-make-the-bar-serie-in-the-same-bar-but-not-stack
A: Set the `barGap` of `Serie` to `-1``stack` to null.
## How-to-adjust-the-bar-width-and-gap-of-barchart
A: Adjust the `barWidth` and `barGap` parameter of `Serie`, the last `serie`'s `barWidth` and `barGap` are valid when multiple `serie`.
## How-to-adjust-the-color-of-bar
A: Adjust the `ItemStyle` of `Data` in `inspector`.
## Can-I-adjust-the-anchor-of-chart
A: Yes, you can set any one of 16 anchors but the value use default.
## Can-display-more-than-1000-data
A: Yes. But `UGUI` limits `65000` vertices to a single `Graphic`, so too much data may not be displayed completely. The sampling simplification curve can be turned on by setting the sampling distance `sampleDist`. You can also set some parameters to reduce the number of vertices in the chart to help show more data. Such as reducing the size of the chart, close or reduce the axis of the client drawing, close `Symbol` and `Label` display. A `Normal` line chart occupies fewer vertices than a `Smooth` line chart. The `1.5.0` and above versions can set `large` and `largeThreshold` parameters to enable performance mode.
## Can-line-chart-drawing-be-dash-dot-and-dash-dot
A: Yes. Adjust the `lineType` of `Serie`.
## How-to-limit-the-value-range-of-the-Y-axis
A: Select the `minMaxType` of `Axis` as `Custom`, then set `min` and `max` to the values you want.
## How-to-customize-the-tick-value-range-of-value-axis
A: By default, it is automatically split by the `splitNumber` of `Axis`. Also, you can customize the `interval` to the range you want.
## How-to-display-text-at-the-top-of-data-items
A: Adjust the `Label` of `Serie`.
## How-do-I-customize-icons-for-data-items
A: Set the `Icon` of `Data` in `Serie`.
## How-to-anti-aliasing-and-make-the-chart-smoother
A: Open the `Anti-Aliasing` setting in `Unity`. Selected the UI Canvas `Render Mode` as `Screen Space-Camera`, selected `MSAA`, set `4` times or higher anti-aliasing. The sawtooth can only be reduced and unavoidable. The higher the pixel, the less obvious the sawtooth is.
## Why-does-mouse-over-chart-Tooltip-not-show
A: Verify `Toolip` is opened. Verify that the parent node of chart has turned off mouse events.
## How-not-to-display-the-bar-line-of-Tooltip
A: Set the `type` of `Tooltup` as `None`. Or adjust the parameters of `lineStyle`.
## How-do-I-customize-the-display-of-Tooltip
A: See the `formatter`, `itemFormatter`, `titleFormatter` parameters of `Tooltip`.
## How-do-I-get-the-Y-axis-to-display-multiple-decimal-places
A: Set the `numericFormatter` parameter of `AxisLabel`.
## How-do-I-dynamically-update-data-with-code
A: See example: `Example01_UpdateData.cs`
## How-to-display-legend?Why-are-legends-sometimes-not-displayed
A: First, the `name` in `Serie` must have a value that is not null. Then set `Legend` is `show`, where `data` can be empty by default, indicating that all legends are displayed. If you only want to display part of the `Serie` legend, fill in `data` with the `name` of the legend you want to display. If none of the values in `data` are `name` of the series, the legend will not be displayed.
## How-to-make-chart-as-prefab
A: Before make prefab, please delete all sub gameObject under chart which auto-created by `XCharts`.
## How-do-I-draw-custom-content-in-chart-such-as-line-or-dot
A: Implement `onCustomDraw` of chart, see `Example12_CustomDrawing.cs`.
## How-to-achieve-similar-data-movement-effect-of-ELECTRO-cardiogram
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.
## Mesh-cannot-have-more-than-65000-vertices
A: This is the limit of `UGUI` on the number of vertices for a single `Graphic`. `XCharts` is draw chart on a single `Graphic`, so there is also this limitation. The solution can be referred to: [QA 10: Can display more than 1000 data](#Can-display-more-than-1000-data)
## Why-are-the-parameters-set-in-Serie-reset-after-they-run
A: Check whether `RemoveData()` and add new `Serie` in the code. If you want to keep the configuration of `Serie`, you can only `ClearData()` which just clear data and then readd the data to the old serie.
## Why_are_many_custom_colors_lost_after_upgrading_to_1_6_0_How_should_I_upgrade
A: In version `1.6.0`, in order to reduce implicit conversion, all drawing related `Color` was changed to `Color32`, so some custom colors were lost. The main components affected are: `ItemStyle`, `LineStyle`, `AreaStyle`, `Vessel`, `VisualMap`, `AxisSplitArea`, `AxisSplitLine`, `GaugeAxis`,`SerieLabel`, etc. Can use the script [UpgradeChartColor.cs](https://github.com/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/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).
[XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts API](xcharts-api-EN.md)
[XCharts Configuration](xcharts-configuration-EN.md)

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 81071e0166b9e49958800af4678e69ae
guid: ca54a17a3a60f4b36b0be43df9f1c33d
TextScriptImporter:
externalObjects: {}
userData:

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,7 +1,5 @@
fileFormatVersion: 2
guid: 5acea6fd06c0e9c498c434f941e4cba9
timeCreated: 1554219116
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,58 +1,93 @@
/******************************************/
/* */
/* 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;
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_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;
protected float m_DefaultLabelWidth;
protected float m_DefaultFieldWidth;
private int m_SeriesSize;
private Vector2 scrollPos;
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_Title = serializedObject.FindProperty("m_Title");
m_Legend = serializedObject.FindProperty("m_Legend");
m_Tooltip = serializedObject.FindProperty("m_Tooltip");
m_Settings = serializedObject.FindProperty("m_Settings");
m_Background = serializedObject.FindProperty("m_Background");
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;
@@ -64,29 +99,243 @@ namespace XCharts
OnStartInspectorGUI();
OnMiddleInspectorGUI();
OnEndInspectorGUI();
OnDebugInspectorGUI();
EditorGUILayout.Space();
serializedObject.ApplyModifiedProperties();
}
protected virtual void OnStartInspectorGUI()
{
EditorGUILayout.PropertyField(m_Script);
EditorGUILayout.PropertyField(m_ChartWidth);
EditorGUILayout.PropertyField(m_ChartHeight);
EditorGUILayout.PropertyField(m_ThemeInfo, true);
EditorGUILayout.PropertyField(m_Title, true);
EditorGUILayout.PropertyField(m_Legend, true);
EditorGUILayout.PropertyField(m_Tooltip, true);
BlockStart();
EditorGUILayout.BeginHorizontal();
var version = string.Format("v{0}_{1}", XChartsMgr.version, XChartsMgr.versionDate);
if (m_EnableTextMeshPro.boolValue)
{
version += " TMP";
}
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()
{
}
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("Remove All Chart Object"))
{
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_Chart.CheckWarning();
}
if (GUILayout.Button("Hide Warning"))
{
m_CheckWarning = false;
}
EditorGUILayout.EndHorizontal();
sb.Length = 0;
sb.AppendFormat("v{0}", XChartsMgr.fullVersion);
if (!string.IsNullOrEmpty(m_Chart.warningInfo))
{
sb.AppendLine();
sb.Append(m_Chart.warningInfo);
}
else
{
sb.AppendLine();
sb.Append("Perfect! No warning!");
}
EditorGUILayout.HelpBox(sb.ToString(), MessageType.Warning);
}
else
{
if (GUILayout.Button("Check warning"))
{
m_CheckWarning = true;
m_Chart.CheckWarning();
}
}
EditorGUILayout.Space();
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: d7f1cff1e5bae244a872040086b1cfa8
timeCreated: 1554217495
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

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

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: dfc9b72c568f74d1dbf37310311aac8e
guid: 1bc2ab7ace40d480e839052673b65a5d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,79 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
public class CheckVersionEditor : EditorWindow
{
private Vector2 scrollPos;
private static CheckVersionEditor window;
[MenuItem("Component/XCharts/Check For Update")]
private static void ShowWindow()
{
window = GetWindow<CheckVersionEditor>();
window.titleContent = new GUIContent("XCharts Check For Update");
window.minSize = new Vector2(550, window.minSize.y);
window.Show();
XChartsMgr.Instance.CheckVersion();
}
private void OnGUI()
{
var mgr = XChartsMgr.Instance;
GUILayout.Label("");
GUILayout.Label("当前版本:" + mgr.nowVersion);
if (mgr.needUpdate && !mgr.isCheck)
{
GUILayout.BeginHorizontal();
GUILayout.Label("最新版本:" + mgr.newVersion);
if (mgr.isCheck) GUILayout.Label("检测中...");
else GUILayout.Label("有更新!");
if (GUILayout.Button("去Github主页"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts");
}
GUILayout.EndHorizontal();
GUILayout.Label("");
if (!string.IsNullOrEmpty(mgr.desc))
{
GUILayout.Label(mgr.desc);
GUILayout.Label("");
}
scrollPos = GUILayout.BeginScrollView(scrollPos);
GUILayout.TextArea(mgr.changeLog);
GUILayout.EndScrollView();
}
else
{
if (mgr.isCheck) GUILayout.Label("最新版本:检测中...");
else GUILayout.Label("最新版本:" + mgr.newVersion);
if (!mgr.needUpdate && !mgr.isCheck)
{
GUILayout.Label("");
GUILayout.Label("已是最新版本!");
GUILayout.Label("");
if (!string.IsNullOrEmpty(mgr.desc))
{
GUILayout.Label(mgr.desc);
GUILayout.Label("");
}
if (GUILayout.Button("去Github主页"))
{
Application.OpenURL(mgr.homepage);
}
}
}
}
}
}

View File

@@ -1,55 +1,62 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
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();
EditorGUILayout.PropertyField(m_DataZoom);
EditorGUILayout.PropertyField(m_VisualMap);
EditorGUILayout.PropertyField(m_Grid);
for (int i = 0; i < m_XAxises.arraySize; i++)
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 MoreDebugInspector()
{
base.MoreDebugInspector();
CovertXYAxis();
}
private void CovertXYAxis()
{
if (GUILayout.Button("Covert XY Axis"))
{
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);
(m_Chart as CoordinateChart).CovertXYAxis(0);
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: 1dd7acd8b13f3f14e9891af4e8dd0b0b
timeCreated: 1554475249
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

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 GaugeChart.
/// </summary>
[CustomEditor(typeof(GaugeChart), false)]
public class GaugeChartEditor : BaseChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
if(target == null) return;
m_Chart = (GaugeChart)target;
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e27021e8c8377464a8b439cf785080ee
guid: bd96c5068df484d1c95748a85d8380a8
MonoImporter:
externalObjects: {}
serializedVersion: 2

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

@@ -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

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: 6bd1a238bc5b407408b8f902aa3db9fd
timeCreated: 1554539035
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -5,13 +5,16 @@
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// 从json导入数据接口
/// Editor class used to edit UI LiquidChart.
/// </summary>
public interface IJsonData
[CustomEditor(typeof(LiquidChart), false)]
public class LiquidChartEditor : BaseChartEditor
{
void ParseJsonData(string json);
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 060e74df53e174634b42ea5f3c852e94
guid: 307a1578a6be1403c98fdc27d99d1808
MonoImporter:
externalObjects: {}
serializedVersion: 2

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

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: 28de30021bed0f945af09633584fcb44
timeCreated: 1554768152
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,41 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI PolarChart.
/// </summary>
[CustomEditor(typeof(PolarChart), false)]
public class PolarChartEditor : BaseChartEditor
{
protected SerializedProperty m_Polars;
protected SerializedProperty m_RadiusAxes;
protected SerializedProperty m_AngleAxes;
protected override void OnEnable()
{
base.OnEnable();
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();
var showAll = m_MultiComponentMode.boolValue;
BlockListField(showAll, m_Polars);
BlockListField(showAll, m_RadiusAxes);
BlockListField(showAll, m_AngleAxes);
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: ce2fe7c8c98c644b9a8585050ea1d963
guid: 157ef5f1d75e04aa1814e0b188591912
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,8 +1,6 @@
fileFormatVersion: 2
guid: 0ad1e8940e4805b49a18ea7a2cbd4bce
folderAsset: yes
timeCreated: 1554304641
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:

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(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_Duration = prop.FindPropertyRelative("m_Duration");
SerializedProperty m_Delay = prop.FindPropertyRelative("m_Delay");
SerializedProperty m_Threshold = prop.FindPropertyRelative("m_Threshold");
SerializedProperty m_ActualDuration = prop.FindPropertyRelative("m_ActualDuration");
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_Duration);
if (m_Duration.intValue < 0) m_Duration.intValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Delay);
if (m_Delay.intValue < 0) m_Delay.intValue = 0;
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.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.intValue + " 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

@@ -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

@@ -1,68 +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_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_ShowSplitLine = prop.FindPropertyRelative("m_ShowSplitLine");
SerializedProperty m_SplitLineType = prop.FindPropertyRelative("m_SplitLineType");
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_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
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;
if (type == Axis.AxisType.Value)
PropertyField(prop, isPolar ? "m_PolarIndex" : "m_GridIndex");
PropertyField(prop, "m_Type");
if (type == Axis.AxisType.Time)
{
EditorGUI.PropertyField(drawRect, m_MinMaxType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
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)
{
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 || type == Axis.AxisType.Time)
{
PropertyField(prop, "m_MinMaxType");
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
switch (minMaxType)
{
@@ -72,136 +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;
}
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;
if (m_ShowSplitLine.boolValue)
PropertyField(prop, "m_SplitNumber");
if (type == Axis.AxisType.Category)
{
drawRect.width = EditorGUIUtility.labelWidth + 10;
EditorGUI.PropertyField(drawRect, m_ShowSplitLine);
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.x = EditorGUIUtility.labelWidth + 35;
drawRect.width = EditorGUIUtility.currentViewWidth - EditorGUIUtility.labelWidth - 55;
EditorGUI.PropertyField(drawRect, m_SplitLineType, GUIContent.none);
drawRect.x = pos.x;
drawRect.width = pos.width;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_InsertDataToHead");
PropertyField(prop, "m_MaxCache");
PropertyField(prop, "m_BoundaryGap");
}
else
{
EditorGUI.PropertyField(drawRect, m_ShowSplitLine);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
PropertyField(prop, "m_Interval");
}
EditorGUI.PropertyField(drawRect, m_BoundaryGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
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_SplitArea);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitArea);
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)
{
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);
}
PropertyListField(prop, "m_Data", true);
}
EditorGUI.indentLevel--;
}
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
[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)
{
int index = InitToggle(prop);
if (!m_AxisModuleToggle[index])
base.DrawExtendeds(prop);
PropertyField(prop, "m_StartAngle");
PropertyField(prop, "m_Clockwise");
}
}
[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)
{
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");
float height = 0;
height += 11 * EditorGUIUtility.singleLineHeight + 10 * 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 += EditorGUIUtility.singleLineHeight + 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);
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;
}
}
}
private int InitToggle(SerializedProperty prop)
[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)
{
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_Name");
PropertyField(prop, "m_Location");
PropertyField(prop, "m_TextStyle");
--EditorGUI.indentLevel;
}
if (index >= m_AxisModuleToggle.Count)
}
}
[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)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
m_AxisModuleToggle.Add(false);
++EditorGUI.indentLevel;
PropertyField(prop, "m_Color");
--EditorGUI.indentLevel;
}
return index;
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: d0544f1db7f17644bb3cbe7c85da84d5
timeCreated: 1554507809
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,71 +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_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
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_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_ForceENotation);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLabelToggle, prop))
{
height += 9 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

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,11 +0,0 @@
fileFormatVersion: 2
guid: 866eefe266c3c47809d9dff3e89be0ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,74 +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 += 7 * EditorGUIUtility.singleLineHeight + 6 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

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,11 +0,0 @@
fileFormatVersion: 2
guid: 988570bd6485942da9879649ed4adb5b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,52 +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");
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.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (m_AxisTickToggle)
{
height += 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 7c7d45bc59dedc140b08f6e9d26ccd9d
timeCreated: 1555890921
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Background), true)]
public class BackgroundDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Background"; } }
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_Image");
PropertyField(prop, "m_ImageType");
PropertyField(prop, "m_ImageColor");
PropertyField(prop, "m_HideThemeBackgroundColor");
--EditorGUI.indentLevel;
}
}
}
}

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,92 +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_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;
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 += 7;
if (prop.FindPropertyRelative("m_SupportSlider").boolValue) num += 6;
}
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: cba26e421f79077499f05aaf10d06b4f
timeCreated: 1559609801
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

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,70 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis), true)]
public class GaugeAxisDrawer : BasePropertyDrawer
{
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 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;
}
}
[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"))
{
++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,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,36 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(IconStyle), true)]
public class IconStyleDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "IconStyle"; } }
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_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;
}
}
}
}

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,62 +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 Dictionary<string, bool> m_ItemStyleToggle = 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_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");
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_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;
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 += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * 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,85 +11,30 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Legend), true)]
public class LegendDrawer : PropertyDrawer
public class LegendDrawer : BasePropertyDrawer
{
private bool m_DataFoldout = false;
private int m_DataSize = 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 itemFontSize = prop.FindPropertyRelative("m_ItemFontSize");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
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, itemFontSize);
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);
}
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 += 7 * EditorGUIUtility.singleLineHeight + 6 * 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_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
}
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: b96d10541649a23468168ba0bf1c0bc5
timeCreated: 1554395454
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

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,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

@@ -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,82 +11,20 @@ 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;
switch ((Location.Align)align.enumValueIndex)
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Align"))
{
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)
{
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;
++EditorGUI.indentLevel;
PropertyField(prop, "m_Top");
PropertyField(prop, "m_Bottom");
PropertyField(prop, "m_Left");
PropertyField(prop, "m_Right");
--EditorGUI.indentLevel;
}
}
}

View File

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: 34092595791508d4b94b074a8788c388
timeCreated: 1554307767
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

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

@@ -0,0 +1,30 @@
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Polar), true)]
public class PolarDrawer : BasePropertyDrawer
{
public override string ClassName { get { return "Polar"; } }
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
base.OnGUI(pos, prop, label);
if (MakeFoldout(prop, "m_Show"))
{
++EditorGUI.indentLevel;
PropertyTwoFiled(prop, "m_Center");
PropertyField(prop, "m_Radius");
PropertyField(prop, "m_BackgroundColor");
--EditorGUI.indentLevel;
}
}
}
}

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,116 +12,50 @@ using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Radar), true)]
public class RadarDrawer : PropertyDrawer
public class RadarDrawer : BasePropertyDrawer
{
SerializedProperty m_Shape;
SerializedProperty m_Radius;
SerializedProperty m_SplitNumber;
SerializedProperty m_Center;
SerializedProperty m_LineStyle;
SerializedProperty m_SplitArea;
SerializedProperty m_Indicator;
SerializedProperty m_IndicatorList;
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_Radius = prop.FindPropertyRelative("m_Radius");
m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
m_Center = prop.FindPropertyRelative("m_Center");
m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
m_Indicator = prop.FindPropertyRelative("m_Indicator");
m_IndicatorList = prop.FindPropertyRelative("m_IndicatorList");
}
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, false);
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.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.InsertArrayElementAtIndex(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_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
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))
{
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 += 6;
if (m_IndicatorJsonAreaToggle) propNum += 4;
float height = propNum * EditorGUIUtility.singleLineHeight + (propNum - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitArea"));
if (ChartEditorHelper.IsToggle(m_IndicatorToggle, prop))
{
m_IndicatorList = prop.FindPropertyRelative("m_IndicatorList");
height += EditorGUIUtility.singleLineHeight * 2 + 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

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: 09bf71ecf64f321468ac28af28bec878
timeCreated: 1555563898
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,62 +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_Color = prop.FindPropertyRelative("m_Color");
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_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (ChartEditorHelper.IsToggle(m_RadarModuleToggle,prop))
{
return 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

@@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: 7fb5d2a98871919459956dc252632435
timeCreated: 1556220585
licenseType: Free
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,227 +12,316 @@ 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_RadarIndex = prop.FindPropertyRelative("m_RadarIndex");
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_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"))
{
drawRect.x = EditorGUIUtility.labelWidth - (EditorGUI.indentLevel - 1) * 15 - 2 + 20;
drawRect.width = pos.width - drawRect.x + 15;
EditorGUI.PropertyField(drawRect, type, GUIContent.none);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
var orderButton = 48;
var gap = 4;
var drawRect = pos;
drawRect.x += EditorGUIUtility.labelWidth + gap;
drawRect.width = pos.width - drawRect.x + ChartEditorHelper.BOOL_WIDTH - orderButton;
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;
EditorGUI.PropertyField(drawRect, stack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (serieType == SerieType.Radar)
{
EditorGUI.PropertyField(drawRect, m_RadarIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
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;
if (serieType == SerieType.Line)
{
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;
}
if (serieType == SerieType.Line
|| serieType == SerieType.Scatter
|| serieType == SerieType.EffectScatter
|| serieType == SerieType.Radar)
{
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
}
if (serieType == SerieType.Bar)
{
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;
}
if (serieType == 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");
}
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;
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
if (serieType == SerieType.Line)
PropertyField(prop, "m_InsertDataToHead");
PropertyField(prop, "m_Name");
switch (serieType)
{
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);
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++;
float nameWid = 40;
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, drawRect.y, nameWid, 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, pos.height);
if (GUI.Button(iconRect, new GUIContent("Icon")))
{
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.InsertArrayElementAtIndex(m_Datas.arraySize);
while (listSize < m_Datas.arraySize)
m_Datas.DeleteArrayElementAtIndex(m_Datas.arraySize - 1);
}
if (listSize > 30)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
case SerieType.Line:
PropertyField(prop, "m_Stack");
if (m_IsPolar)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
PropertyField(prop, "m_PolarIndex");
}
if (num >= 10)
else
{
EditorGUI.LabelField(drawRect, "...");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, listSize - 1, pos.width);
PropertyField(prop, "m_XAxisIndex");
PropertyField(prop, "m_YAxisIndex");
}
}
else
{
for (int i = 0; i < m_Datas.arraySize; i++)
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:
PropertyField(prop, "m_Stack");
if (m_IsPolar)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
PropertyField(prop, "m_PolarIndex");
}
}
EditorGUI.indentLevel--;
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:
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:
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:
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:
PropertyField(prop, "m_Clip");
PropertyField(prop, "m_Symbol");
break;
case SerieType.Heatmap:
PropertyField(prop, "m_Ignore");
PropertyField(prop, "m_IgnoreValue");
break;
case SerieType.Gauge:
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:
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;
}
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;
}
}
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;
#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 (XChartsSettings.editorBlockEnable)
{
nameRect.x += ChartEditorHelper.BLOCK_WIDTH;
}
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--;
}
}
private void DrawDataElement(ref Rect drawRect, int dimension, SerializedProperty m_Datas, bool showName,
bool showIconDetail, bool showSelected, int index, float currentWidth)
bool showDetail, bool showSelected, int index, float currentWidth)
{
var lastX = drawRect.x;
var lastWid = drawRect.width;
@@ -248,35 +337,49 @@ namespace XCharts
if (fieldCount <= 1)
{
while (2 > data.arraySize)
data.InsertArrayElementAtIndex(data.arraySize);
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
SerializedProperty element = data.GetArrayElementAtIndex(1);
if (showSelected)
{
drawRect.width = drawRect.width - 18;
EditorGUI.PropertyField(drawRect, element);
drawRect.x = currentWidth - 45;
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + index));
drawRect.x = currentWidth - 40;
EditorGUI.PropertyField(drawRect, selected, GUIContent.none);
drawRect.x = lastX;
drawRect.width = lastWid;
}
else
{
EditorGUI.PropertyField(drawRect, element);
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + index));
}
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
AddHeight(EditorGUI.GetPropertyHeight(element));
}
else
{
#if UNITY_2019_3_OR_NEWER
var gap = 2;
var namegap = 3;
#else
var gap = 0;
var namegap = 0;
#endif
EditorGUI.LabelField(drawRect, "Element " + index);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
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++)
{
if (i >= data.arraySize - 1)
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
{
data.InsertArrayElementAtIndex(data.arraySize);
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 40;
@@ -286,108 +389,53 @@ namespace XCharts
if (showName)
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40;
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;
EditorGUIUtility.labelWidth = lastLabelWid;
}
if (showIconDetail)
if (showDetail)
{
EditorGUI.indentLevel++;
var m_ShowIcon = serieData.FindPropertyRelative("m_ShowIcon");
var m_IconImage = serieData.FindPropertyRelative("m_IconImage");
var m_IconColor = serieData.FindPropertyRelative("m_IconColor");
var m_IconWidth = serieData.FindPropertyRelative("m_IconWidth");
var m_IconHeight = serieData.FindPropertyRelative("m_IconHeight");
var m_IconOffset = serieData.FindPropertyRelative("m_IconOffset");
EditorGUI.PropertyField(drawRect, m_ShowIcon);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IconImage);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IconColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IconWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IconHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.LabelField(drawRect, "Icon Offset");
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
var tempWidth = (drawRect.width - startX + 72) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - 58, drawRect.y, tempWidth, drawRect.height);
var x = EditorGUI.FloatField(centerXRect, m_IconOffset.vector3Value.x);
var y = EditorGUI.FloatField(centerYRect, m_IconOffset.vector3Value.y);
m_IconOffset.vector3Value = new Vector3(x, y);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int index = InitToggle(prop);
if (!m_SerieModuleToggle[prop.propertyPath])
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 9 * EditorGUIUtility.singleLineHeight + 8 * EditorGUIUtility.standardVerticalSpacing;
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"));
SerializedProperty type = prop.FindPropertyRelative("m_Type");
var serieType = (SerieType)type.enumValueIndex;
if (serieType == SerieType.Line
|| serieType == SerieType.Scatter
|| serieType == SerieType.EffectScatter
|| serieType == SerieType.Radar)
{
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
}
if (serieType == SerieType.Pie)
{
height += 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
}
if (serieType == SerieType.Line)
{
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineArrow"));
height += 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
}
if (serieType == SerieType.Bar)
{
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
}
if (m_DataFoldout[index])
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
int num = m_Data.arraySize + 2;
if (num > 30) num = 15;
if (prop.FindPropertyRelative("m_ShowDataIcon").boolValue)
{
num *= 5;
num += 2;
}
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
}
return height;
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");
var m_EnableItemStyle = serieData.FindPropertyRelative("m_EnableItemStyle");
var m_ItemStyle = serieData.FindPropertyRelative("m_ItemStyle");
var m_EnableEmphasis = serieData.FindPropertyRelative("m_EnableEmphasis");
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);
ChartEditorHelper.MakeBool(drawRect, m_EnableIcon, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_Icon));
EditorGUI.PropertyField(drawRect, m_Symbol);
ChartEditorHelper.MakeBool(drawRect, m_EnableSymbol, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_Symbol));
EditorGUI.PropertyField(drawRect, m_Label);
ChartEditorHelper.MakeBool(drawRect, m_EnableLabel, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_Label));
EditorGUI.PropertyField(drawRect, m_ItemStyle);
ChartEditorHelper.MakeBool(drawRect, m_EnableItemStyle, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_ItemStyle));
EditorGUI.PropertyField(drawRect, m_Emphasis);
ChartEditorHelper.MakeBool(drawRect, m_EnableEmphasis, 1, "(enable)");
AddHeight(EditorGUI.GetPropertyHeight(m_Emphasis));
EditorGUI.indentLevel -= 2;
}
}
@@ -401,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

@@ -1,7 +1,5 @@
fileFormatVersion: 2
guid: c30d9496b99e39944a6987e390bed91f
timeCreated: 1555200849
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,124 +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_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_ForceENotation = prop.FindPropertyRelative("m_ForceENotation");
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.LabelField(drawRect, "Offset");
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * 15;
var tempWidth = (drawRect.width - startX + 52) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - 38, drawRect.y, tempWidth, drawRect.height);
var x = EditorGUI.FloatField(centerXRect, m_Offset.vector3Value.x);
var y = EditorGUI.FloatField(centerYRect, m_Offset.vector3Value.y);
m_Offset.vector3Value = new Vector3(x, y);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
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;
EditorGUI.PropertyField(drawRect, m_ForceENotation);
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 += 23 * EditorGUIUtility.singleLineHeight + 22 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height = EditorGUIUtility.singleLineHeight + 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 System.Collections.Generic;
using UnityEditor;
@@ -12,90 +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_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_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_Opacity = prop.FindPropertyRelative("m_Opacity");
SerializedProperty m_StartIndex = prop.FindPropertyRelative("m_StartIndex");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_ForceShowLast = prop.FindPropertyRelative("m_ForceShowLast");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieSymbolToggle, prop, null, m_Type, 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_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_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Opacity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
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;
switch (sizeType)
{
case SerieSymbolSizeType.Custom:
return 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
case SerieSymbolSizeType.FromData:
return 10 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
case SerieSymbolSizeType.Callback:
return 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
}
return 9 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
return 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 UnityEditor;
using UnityEngine;
@@ -13,9 +13,6 @@ namespace XCharts
[CustomPropertyDrawer(typeof(Series), true)]
public class SeriesDrawer : PropertyDrawer
{
private int m_DataSize = 0;
private bool m_ShowJsonDataArea = false;
private string m_JsonDataAreaText;
private bool m_SeriesModuleToggle = false;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
@@ -23,16 +20,8 @@ namespace XCharts
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Series = prop.FindPropertyRelative("m_Series");
drawRect.width = EditorGUIUtility.labelWidth + 10;
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SeriesModuleToggle, "Series");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
//ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop);
drawRect.width = pos.width;
if (m_SeriesModuleToggle)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_Series);
}
m_SeriesModuleToggle = ChartEditorHelper.MakeListWithFoldout(ref drawRect,
m_Series, m_SeriesModuleToggle, true, true);
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
@@ -44,13 +33,9 @@ namespace XCharts
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
for (int i = 0; i < m_Data.arraySize; i++)
{
height += EditorGUI.GetPropertyHeight(m_Data.GetArrayElementAtIndex(i));
height += EditorGUI.GetPropertyHeight(m_Data.GetArrayElementAtIndex(i)) + EditorGUIUtility.standardVerticalSpacing;
}
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing;
}
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
return height;
}

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