Compare commits

...

821 Commits

Author SHA1 Message Date
monitor1394
19744ec124 3.12.1 2024-12-01 10:22:23 +08:00
monitor1394
1bdb756ad1 修复Tooltip在图表设置其他锚点时手机上显示位置异常的问题 2024-11-30 23:48:53 +08:00
monitor1394
bc1a11c4e3 修复Tooltip在图表设置其他锚点时手机上显示位置异常的问题 2024-11-30 23:45:28 +08:00
monitor1394
6c42fe6399 优化性能 2024-11-27 23:24:09 +08:00
monitor1394
ad77a79308 修复Unity6的一些代码警告问题 2024-11-27 22:28:47 +08:00
monitor1394
d5647a448d 修复Tooltip在特殊情况下可能会超出屏幕显示不完整的问题 2024-11-26 23:18:49 +08:00
monitor1394
756df47fe3 修复UITable在拖拽时也会点选的问题 2024-11-25 08:39:48 +08:00
monitor1394
1dd31f747e 修复Time时间轴在开启Animation时动态变更效果异常的问题 2024-11-22 22:10:12 +08:00
monitor1394
6568595abb 优化Line在数据点过密时有更好的绘制效果 2024-11-18 23:14:51 +08:00
monitor1394
61fb717d20 修复Animation无法通过代码开启的问题 (#334) 2024-11-16 17:22:40 +08:00
monitor1394
0a923400b2 修复Animation无法通过代码开启的问题 2024-11-16 17:18:06 +08:00
monitor1394
7fb0765c6c 修复DataZoom的start和end在代码动态修改时图表不刷新的问题 2024-11-13 08:40:56 +08:00
monitor1394
e6c68be728 更新文档 2024-11-05 22:17:23 +08:00
monitor1394
fdc7b41e8e 修复Title设置隐藏后运行还显示的问题 2024-11-05 08:28:57 +08:00
monitor1394
45972a4cd9 更新文档 2024-11-01 08:22:36 +08:00
monitor1394
d0d25b0221 更新文档 2024-10-31 23:28:46 +08:00
monitor1394
143a037761 更新文档 2024-10-28 22:25:14 +08:00
monitor1394
dc254fb722 更新文档 2024-10-21 08:44:16 +08:00
monitor1394
b0d6bea256 更新文档 2024-10-19 23:23:38 +08:00
monitor1394
4f38b59288 3.12.0 2024-10-01 22:59:59 +08:00
monitor1394
ad3a8f9ad8 3.12.0 2024-09-30 18:12:57 +08:00
monitor1394
8c1dc44e1e 3.11.2 2024-09-30 18:04:46 +08:00
monitor1394
25a06afb50 3.11.2 2024-09-30 17:42:55 +08:00
monitor1394
df4223421f 完善教程 2024-09-27 19:08:25 +08:00
monitor1394
f9b1eadd40 完善Legendformatter对多Serie的支持 (#332) 2024-09-24 18:28:21 +08:00
monitor1394
c61ad794a7 调整文档显示样式 2024-09-24 18:26:45 +08:00
monitor1394
3b6ce91c65 调整文档显示样式 2024-09-22 09:54:11 +08:00
monitor1394
c2a19ee47b 调整文档显示样式 2024-09-21 13:31:16 +08:00
monitor1394
768cf8d404 增加numericFormatterdatetime的支持 2024-09-11 08:12:14 +08:00
monitor1394
9a98d6a5df 完善AreaStyleorigin参数设置区域填充起始位置 2024-09-03 08:41:09 +08:00
monitor1394
e40e19c197 增加RingradiusGradient参数设置渐变方向 2024-08-31 22:22:33 +08:00
monitor1394
59cd12d0eb 优化Axis为时间轴时首个Label的位置 2024-08-31 22:22:16 +08:00
monitor1394
e7978cbc30 3.11.2 2024-07-31 22:52:33 +08:00
monitor1394
10a36e0295 3.11.2 2024-07-31 22:43:35 +08:00
monitor1394
5853376a44 修复Tooltip在微信小游戏平台上报错的兼容问题 (#326) 2024-07-29 22:51:02 +08:00
monitor1394
1bb9b455b4 调整AxisAxisName的默认位置 2024-07-27 23:06:02 +08:00
monitor1394
de4f650e4f 优化Axis的轴动画在初始化时关闭 2024-07-27 11:34:13 +08:00
monitor1394
feb5e7fc32 优化Axis的轴动画在初始化时关闭 2024-07-25 23:26:30 +08:00
monitor1394
378fccf8b4 优化PieLabelTooltip触发时的表现 2024-07-22 22:58:27 +08:00
monitor1394
9e1dd027e9 修复Tooltip在开启DataZoom时指示内容不准确的问题 2024-07-21 15:13:08 +08:00
monitor1394
71ecebb466 优化AxisTime时间轴时的分割效果 2024-07-20 22:21:22 +08:00
monitor1394
4903ac53f0 优化AxisTime时间轴时的分割效果 2024-07-20 21:02:24 +08:00
monitor1394
35e8f3e902 修复MarkLineLabel在初始化时可能会闪烁的问题 2024-07-17 23:16:22 +08:00
monitor1394
d5fbd33534 优化AxisTime时间轴时的Tooltip默认效果 2024-07-16 23:03:31 +08:00
monitor1394
c458846990 优化AxisTime时间轴的splitNumber为0时的表现 2024-07-14 15:23:13 +08:00
monitor1394
e3098e6e16 优化AxisTime时间轴的滚动表现 2024-07-14 15:07:26 +08:00
monitor1394
b22288eac4 优化Label显示体验 2024-07-12 21:22:53 +08:00
monitor1394
99d824e3a0 修复Label在初始化时会堆积的问题 2024-07-12 19:53:30 +08:00
monitor1394
6d41daa678 修复Label在初始化时会堆积的问题 2024-07-12 08:48:01 +08:00
monitor1394
cdac6acd8c 修复Label在初始化时会堆积的问题 2024-07-09 23:16:08 +08:00
monitor1394
94d1398bd3 修复Chart在动态创建时背景没有自适应的问题 (#323) 2024-07-06 11:33:47 +08:00
monitor1394
e2c7779493 3.11.1 2024-07-01 08:24:02 +08:00
monitor1394
9e95b8daa7 修复Serie有多个时颜色异常的问题 2024-07-01 08:15:08 +08:00
monitor1394
6d16a9c16a 修复Label在初始化时会堆积的问题 2024-06-23 22:03:09 +08:00
monitor1394
3b7e8184b0 3.11.0 2024-06-16 21:59:31 +08:00
monitor1394
33b7e5c1a4 3.11.0 2024-06-16 19:21:25 +08:00
monitor1394
24270e5c69 3.11.0 2024-06-16 19:05:40 +08:00
monitor1394
e3fb5685bf 增加EditorData的添加、删除、上下移动操作按钮 2024-06-15 13:21:38 +08:00
monitor1394
89e7a09e64 增加Edge判断接口 2024-06-13 23:04:35 +08:00
monitor1394
ee5efa9f8d 增加DrawEdge绘制由上下坐标列表组成的边 2024-06-13 22:59:37 +08:00
monitor1394
2fe9a40f42 3.11.0-preview2 2024-06-11 08:28:46 +08:00
monitor1394
ddbd82bebf 修复AxisIndicatorLabel可能会遮挡住Tooltip的问题 2024-06-11 08:14:34 +08:00
monitor1394
549ee43a37 修复TooltipCrossAxisIndicatorLabel可能不显示的问题 (#315) 2024-06-11 08:11:27 +08:00
monitor1394
3b9af0f8ec 调整TooltipCorss重命名为Cross 2024-06-10 22:42:20 +08:00
monitor1394
caee79630b 增加Axism_MinCategorySpacing设置类目轴默认的最小类目间距 2024-06-09 22:59:38 +08:00
monitor1394
a12c98b1a5 修复TooltipCross在开启DataZoom时指示位置不准确的问题 2024-06-09 22:13:26 +08:00
monitor1394
8617475808 优化一个Chart里有多个Serie时的Tooltip显示问题 2024-06-08 13:24:24 +08:00
monitor1394
922901380e 修复SerieClone时动画异常问题 (#320) 2024-06-06 13:07:34 +08:00
monitor1394
96cb7ffc74 修复Seriestate在代码动态设置时不刷新的问题 2024-06-04 08:40:43 +08:00
monitor1394
74cf4fe4ce 优化坐标轴Tick最小间距 2024-06-03 08:13:17 +08:00
monitor1394
eb948f03d5 完善关系图初始化 2024-06-03 08:12:32 +08:00
monitor1394
6a6ab72ed8 调整XChartsHierarchy视图下的右键菜单到UI/XCharts 2024-05-29 21:58:31 +08:00
monitor1394
df66f5c7ee 增加3D坐标系显示边框参数 2024-05-29 13:14:21 +08:00
monitor1394
042f9d3c01 增加3D坐标系对类目轴的支持 2024-05-29 08:33:00 +08:00
monitor1394
1e6140a138 3.11.0-preview1 2024-05-20 08:33:09 +08:00
monitor1394
86125c597e 优化Editor下编辑性能 2024-05-19 11:02:03 +08:00
monitor1394
fc346d30fb 优化第三方数据导入 2024-05-19 11:01:46 +08:00
monitor1394
3e8bf7caee 优化Line3D绘制 2024-05-15 13:19:34 +08:00
monitor1394
4e3182edfc 增加JsonUtil工具类 2024-05-09 13:13:51 +08:00
monitor1394
b86cae6717 Merge pull request #311 from stefanbursuc/fix-gc-allocations-in-tooltiphandler
Fix for GC Allocations inside TooltipHandler
2024-05-01 22:22:04 +08:00
monitor1394
0c92d08f0d 修复ConvertXYAxis()多次调用后图表异常的问题 2024-04-23 22:16:28 +08:00
monitor1394
b1522a27d4 修复DataZoom控制多个轴时的GridCoord获取可能不正确的问题 (#317) 2024-04-22 22:35:39 +08:00
monitor1394
120c6d5408 增加GridCoord3D3D坐标系 2024-04-22 22:25:12 +08:00
monitor1394
e2120b3da6 优化DateTimeUtil时间戳转DateTime接口时区的问题 2024-04-16 22:30:04 +08:00
monitor1394
58e6108bb2 优化GridCoord在开启GridLayout时也显示Left Right Top Bottom参数 (#316) 2024-04-15 08:18:12 +08:00
monitor1394
3ef2e7c23c 修复TooltipCross在开启DataZoom的情况下label位置不正确的问题 (#315) 2024-04-14 19:09:08 +08:00
monitor1394
a361e191da 修复Candlesticks效果不对的问题 (#313) 2024-04-12 08:30:34 +08:00
Stefan Bursuc
f5a41b5119 Fix for GC Allocations inside TooltipHandler
In the case where the pointer is not in the chart, both calls to
ListPool<Serie>.Get() from inside the function UpdateTooltipData
are executed.

And because the pointer is not in the chart, m_ShowTooltip is set to
false in the last else clause.

This makes UpdateTooltip to skip all logic and miss the chance to release
the list back to the pool.
2024-04-08 11:24:28 +02:00
monitor1394
42079848dc 优化桑吉图折叠显示 2024-03-20 22:23:58 +08:00
monitor1394
4b8374b1ae 修复Pie在设置ItemStyleopacity时颜色不对的问题 (#309) 2024-03-20 13:36:31 +08:00
monitor1394
0990b11c1c 增加TooltiptriggerOn指定触发条件 2024-03-20 13:34:21 +08:00
monitor1394
99b1624b54 增加数据图的折叠和展开支持 2024-03-20 08:31:05 +08:00
monitor1394
113c3887ae 3.10.2 2024-03-11 08:12:28 +08:00
monitor1394
9f5040435f 修复Tooltip移出坐标系后还显示的问题 2024-03-11 08:04:07 +08:00
monitor1394
f21e9c6a32 修复Legendformatter在设置{d}通配符时显示可能不匹配的问题 (#304) 2024-03-11 08:04:00 +08:00
monitor1394
a071956675 修复Legendformatter在设置{d}通配符时显示可能不匹配的问题 2024-03-11 08:03:53 +08:00
monitor1394
eab4f9530b 修复Tooltiptitle从旧版本升级后可能不显示的问题 2024-03-11 08:03:48 +08:00
monitor1394
ce8b03b692 3.10.1 2024-02-21 08:38:45 +08:00
monitor1394
2505a48ac2 修复Tooltip的圆点标记不会自适应颜色的问题 2024-02-19 08:53:31 +08:00
monitor1394
74e75e93af 修复Tooltip的圆点标记不会自适应颜色的问题 2024-02-19 08:51:06 +08:00
monitor1394
4f8390b515 3.10.0 2024-02-01 13:23:04 +08:00
monitor1394
d91ebeee3a 修复divide by zero的问题 2024-01-31 22:40:50 +08:00
monitor1394
b9c5623687 修复Tooltip在设置itemFormatter-后整个不显示的问题 2024-01-31 13:21:20 +08:00
monitor1394
34b4096482 修复Attempted to divide by zero报错 #302 2024-01-30 23:40:27 +08:00
monitor1394
bc75865a5e 修复TextLimit在开启TextMeshPro后无效的问题 (#301) 2024-01-27 13:40:16 +08:00
monitor1394
c987cb1ef7 修复TextLimit在开启TextMeshPro后无效的问题 (#301) 2024-01-27 13:35:47 +08:00
monitor1394
d93f7830de 增加Bar支持X轴和Y轴都为Category类目轴 2024-01-24 13:31:06 +08:00
monitor1394
61a2da10ba 增加{y}通配符用于获取Y轴的类目名 2024-01-23 22:56:03 +08:00
monitor1394
9e39150009 增加Line支持X轴和Y轴都为Category类目轴 2024-01-23 22:55:46 +08:00
monitor1394
653b81cc48 3.10.0 2024-01-21 22:33:45 +08:00
monitor1394
e68e41a939 3.10.0 2024-01-21 21:17:34 +08:00
monitor1394
d0448a5b11 修复Animationtype代码动态修改无效的问题 2024-01-18 22:41:32 +08:00
monitor1394
daec83c4a5 调整UI组件相关代码 2024-01-16 22:29:15 +08:00
monitor1394
6aa11249c5 Editor上添加第二个X轴或Y轴时自动设置位置 2024-01-14 10:56:36 +08:00
monitor1394
9a56985b3a 增加Chart的更多快捷创建图表菜单 2024-01-13 22:37:13 +08:00
monitor1394
fff04347fa 增加Chart的更多快捷创建图表菜单 2024-01-13 22:16:16 +08:00
monitor1394
5a5ad1e108 优化图表细节 2024-01-13 22:11:01 +08:00
monitor1394
3c233d1cb1 屏蔽ChartInit()接口,动态创建图表不再需要调用 2024-01-12 13:23:46 +08:00
monitor1394
c44583772c 完善动态创建图表功能 2024-01-12 08:29:02 +08:00
monitor1394
29e9593179 增加MainComponent的order设置执行优先级 2024-01-11 22:34:18 +08:00
monitor1394
318bdcb1f2 增加BackgroundborderStyle,给图表默认设置圆角 2024-01-11 08:03:36 +08:00
monitor1394
c3489fbc1e 修复Tooltop的第一个ContentLabelStyle设置color无效的问题 2024-01-07 22:13:03 +08:00
monitor1394
91db00a173 增加BorderStyle边框样式 2024-01-01 22:57:50 +08:00
monitor1394
a3533dbc02 增加DrawRoundRectangleWithBorder接口 2024-01-01 22:55:50 +08:00
monitor1394
f1c504e81a 增加HeatmapmaxCache参数支持 2023-12-26 23:08:41 +08:00
monitor1394
178215d980 修复Line开启clip时绘制的顶点数可能反而增加的问题 2023-12-25 23:05:06 +08:00
monitor1394
cbd527316e 修复Scatter散点图部分边界数据不显示的问题 2023-12-22 17:16:21 +08:00
monitor1394
3580df9117 修复TriggerTooltip()接口在指定0或最大index时可能无法触发的问题 2023-12-21 22:41:12 +08:00
monitor1394
11bdbba286 update doc 2023-12-20 13:26:29 +08:00
monitor1394
4ed22190d6 update doc 2023-12-20 13:19:07 +08:00
monitor1394
06ef86a9d6 修复LegendLabelStyleformatter不生效的问题 2023-12-19 22:02:05 +08:00
monitor1394
3d73578063 更新FAQ 2023-12-17 22:11:35 +08:00
monitor1394
07caa54631 更新FAQ 2023-12-17 22:05:57 +08:00
monitor1394
023eeb9ea8 优化border 2023-12-16 22:34:00 +08:00
monitor1394
2431a001b1 优化border 2023-12-16 22:31:34 +08:00
monitor1394
e83eeabf9c 优化Bar的边框绘制 2023-12-16 10:03:28 +08:00
monitor1394
9c5b83dc22 修复settings的lineSmoothness用代码设置无效的问题 2023-12-14 19:33:11 +08:00
monitor1394
9d2b14afef 代码优化 2023-12-14 19:22:02 +08:00
monitor1394
63173cdce6 代码优化 2023-12-14 10:20:48 +08:00
monitor1394
922a944881 增加LegendTextLimit可限制图例显示文本的长度 2023-12-12 10:22:32 +08:00
monitor1394
53c7ddf9d4 修复Serie添加double.MaxValue时坐标绘制失败的问题 2023-12-11 13:43:03 +08:00
monitor1394
a50bda5344 增加SerieminShowLabel可隐藏小于指定值的label 2023-12-10 21:23:57 +08:00
monitor1394
e8c8ab87aa 增加桑基图相关支持 2023-12-09 23:22:00 +08:00
monitor1394
1c6904f074 增加ResetChartStatus()可主动重置图表状态 2023-12-05 22:43:49 +08:00
monitor1394
225fc69e70 3.9.0 2023-12-01 21:26:27 +08:00
monitor1394
546077459f 3.9.0 2023-12-01 21:19:24 +08:00
monitor1394
bdc6c3b289 3.9.0 2023-12-01 21:16:28 +08:00
monitor1394
bbf1dc862c 3.9.0 2023-12-01 20:54:11 +08:00
monitor1394
c841ac4a93 3.9.0 2023-12-01 20:52:57 +08:00
monitor1394
bece2eb564 修复TooltiptitleFormatter设置为{b}后显示不准确的问题 2023-12-01 08:39:27 +08:00
monitor1394
735e36d6e5 增加SerieData可单独添加Label的支持 2023-11-30 22:36:24 +08:00
monitor1394
0a19b2a6cc 修复Tooltip在对数轴时指示不准确的问题 2023-11-28 10:04:15 +08:00
monitor1394
7ea260b986 修复报错 (#293) 2023-11-25 21:57:49 +08:00
monitor1394
cdc182191b 修复ChartUpdateData()接口返回值不准确的问题 2023-11-24 08:36:54 +08:00
monitor1394
45be0748aa 修复Axis的更新数据时效果不顺畅的问题 2023-11-24 08:29:55 +08:00
monitor1394
1f970cbb36 增加AxisAnimation支持动画效果 2023-11-24 08:29:42 +08:00
monitor1394
4aee1b0a92 3.9.0 2023-11-21 08:34:18 +08:00
monitor1394
079d1030ae 完善注释和文档 2023-11-16 13:15:09 +08:00
monitor1394
ddf44a8c1d 取消Legendformatter,用LabelStyle的代替 2023-11-16 08:40:28 +08:00
monitor1394
f94f678661 完善注释和文档 2023-11-16 08:20:26 +08:00
monitor1394
9816c34701 3.8.2 2023-11-14 13:23:32 +08:00
monitor1394
b959b15c71 完善LabelStyleformatter的注释和文档(#291) 2023-11-14 13:18:31 +08:00
monitor1394
c9ac0daed9 修复Documentation部分注释生成文档不完整的问题 (#290) 2023-11-11 23:36:28 +08:00
monitor1394
65684f2952 调整中英文注释的分隔符为|| 2023-11-11 23:32:24 +08:00
monitor1394
509bd97741 修复Legendformatter在数据变更时没有自动刷新的问题 2023-11-11 22:46:08 +08:00
monitor1394
83db4dd951 修复SerieEventDatavalue一直是0的问题 (#287) 2023-11-05 20:09:28 +08:00
monitor1394
a730404935 修复Bar设置渐变色时鼠标移出效果异常的问题 (#285) 2023-11-03 08:25:10 +08:00
monitor1394
f51e5f1859 优化SerieData设置ignoreformatter的忽略问题 2023-11-02 22:37:11 +08:00
monitor1394
e8204fc41e update doc 2023-11-02 08:43:08 +08:00
monitor1394
304726debf 增加MarkLineonTop设置是否显示在最上层 2023-11-01 22:41:47 +08:00
monitor1394
d8ecb94dd9 完善UIComponent 2023-11-01 08:53:18 +08:00
monitor1394
573f9efcaf 修复Pie有0数据时Label的位置异常的问题 2023-10-21 22:08:03 +08:00
monitor1394
985f70c3c9 增加Axis的对数轴支持子刻度 2023-10-21 13:29:50 +08:00
monitor1394
68d5bc36d6 优化Log对数轴 2023-10-19 23:06:26 +08:00
monitor1394
6b931497ab 修复Pie设置玫瑰图时引导线异常的问题 2023-10-19 22:51:22 +08:00
monitor1394
4bbedc8ef6 update doc 2023-10-17 22:16:37 +08:00
monitor1394
7f2de53af9 优化UIComponent 2023-10-17 21:39:57 +08:00
monitor1394
48a4fb470a 增加数据刷新接口SetDataDirty() 2023-10-17 14:51:16 +08:00
monitor1394
c67d3a3a80 3.8.2 2023-10-16 08:15:27 +08:00
monitor1394
6a5026e907 修复Line设置AnimationAlongPath时动画异常的问题 (#281) 2023-10-15 21:04:01 +08:00
monitor1394
38716facba 修复MarkLine指定yValue时对数值轴无效的问题 2023-10-13 08:15:25 +08:00
monitor1394
86f0ae5739 修复MarkLine指定yValue时对数值轴无效的问题 2023-10-12 21:55:16 +08:00
monitor1394
fea5ab34c0 修复SerieshowDataDimension设置无效的问题 2023-10-11 22:21:16 +08:00
monitor1394
789ab008f6 update doc 2023-10-11 08:32:48 +08:00
monitor1394
7f525ebaf0 update LICENSE 2023-10-11 08:32:21 +08:00
monitor1394
4fd7650726 3.8.1 2023-10-02 10:22:10 +08:00
monitor1394
66c01d55b9 修复Bar在水平方向时Label设置为Bottom不生效的问题 2023-09-29 23:52:50 +08:00
monitor1394
54bb49dfa7 3.8.1 2023-09-23 22:25:55 +08:00
monitor1394
c065245e00 增加Line平滑曲线对Dash虚线的支持 2023-09-22 08:34:06 +08:00
monitor1394
51697a54f4 修复Pie无数据时绘制异常的问题 (#278) 2023-09-21 08:11:31 +08:00
monitor1394
00123e0f94 修复Pie无数据时绘制异常的问题 (#279) 2023-09-21 08:10:00 +08:00
monitor1394
8c840404e0 修复Tooltip在类目轴无数据时异常报错的问题 (#279) 2023-09-16 20:57:39 +08:00
monitor1394
c5d7e5369d 修复Pie无数据时绘制异常的问题 2023-09-16 10:04:59 +08:00
monitor1394
8750bbc22a 增加PieradiusGradient可设置半径方向的渐变效果 2023-09-12 22:42:36 +08:00
monitor1394
680b9d5c20 update README.md 2023-09-12 08:03:19 +08:00
monitor1394
23dee8bd44 update support.md 2023-09-09 23:28:27 +08:00
monitor1394
6c1b402d2d 优化LabelLinelineEndXPie中的表现 2023-09-05 23:21:17 +08:00
monitor1394
c6e78f9cb9 修复RingTriggerTooltip()接口无效的问题 2023-09-05 13:34:11 +08:00
monitor1394
7402925512 修复Radar数据全为0时绘制报错的问题 2023-09-05 13:13:44 +08:00
monitor1394
5d5f32b55e 3.8.0 2023-09-03 23:53:00 +08:00
monitor1394
c8cb47da63 增加Example_Test调试用 2023-09-03 22:34:43 +08:00
monitor1394
66d666192a 完善Example01_RandomData 2023-09-03 22:32:45 +08:00
monitor1394
2a815e54db 增加Serie的totalDataIndex 2023-09-03 22:31:00 +08:00
monitor1394
367844a86c 开启部分Serie的MaxCache设置 2023-09-03 21:43:38 +08:00
monitor1394
910b9194ac 修复Scatter散点图渐出动画异常的问题 2023-09-03 11:07:06 +08:00
monitor1394
eb196a237f 优化Animation 2023-09-02 10:43:10 +08:00
monitor1394
71038a9f88 优化RadarCoord可通过AxisName控制label是否显示 2023-09-01 08:04:29 +08:00
monitor1394
a6ba17ee00 增加TooltipAuto自动设置显示类型和触发类型 2023-09-01 08:01:27 +08:00
monitor1394
9deb120446 增加RinggridIndex支持设置指定网格 2023-08-29 22:28:18 +08:00
monitor1394
8df1dbe0fb 增加PieRadargridIndex支持设置指定网格 2023-08-29 22:20:29 +08:00
monitor1394
e4fbe5670f 增加GridLayout网格布局组件 2023-08-29 18:30:11 +08:00
monitor1394
e0f6b8c2dc update FUNDING 2023-08-25 13:29:02 +08:00
monitor1394
32b2137b87 修复MarkLine多个时只显示一个Label的问题 2023-08-25 13:22:24 +08:00
monitor1394
dc46477c15 修复MarkLine在开启Clip后还绘制在坐标系外的问题 2023-08-25 07:39:10 +08:00
monitor1394
d6f1c82a08 更新日志 2023-08-24 08:17:22 +08:00
monitor1394
267cb7472c 优化DataZoom开启时的新增动画表现 2023-08-24 08:13:42 +08:00
monitor1394
6d04cac38b 优化YAxis在数据全为0时默认设置0-1的范围 2023-08-24 07:42:19 +08:00
monitor1394
0331804a85 修复YAxisLabel可能会重复的问题 2023-08-23 22:02:00 +08:00
monitor1394
11eccbc39b 修复Bar隐藏时表现异常的问题 2023-08-22 23:48:57 +08:00
monitor1394
80d596a721 优化Bar的Tooltip表现 2023-08-22 23:43:33 +08:00
monitor1394
637fde799e 更新文档 2023-08-22 23:14:05 +08:00
monitor1394
9a198b35b1 优化Zebra斑马柱图的绘制表现 (#276) 2023-08-22 23:13:10 +08:00
monitor1394
3476c56eb6 修复Scatter动态添加数据时图表不及时刷新的问题 2023-08-22 08:16:12 +08:00
monitor1394
d9e1c1211c update readme 2023-08-21 23:20:33 +08:00
monitor1394
9fab42a9e7 update readme 2023-08-21 23:16:05 +08:00
monitor1394
d69327e301 更新订阅服务 2023-08-19 08:35:08 +08:00
monitor1394
2566641b5f 更新订阅服务 2023-08-19 08:25:20 +08:00
monitor1394
fea083035f 更新订阅服务 2023-08-19 08:18:48 +08:00
monitor1394
938ae62905 增加ChartLabel的IsActiveByScale接口 2023-08-17 19:51:48 +08:00
monitor1394
8eec52939c Merge pull request #274 from Ambitroc/ambitroc
修复Chart在特定情况下销毁时UGUI报错问题
2023-08-17 19:41:58 +08:00
zhengzhipeng
151a2ed01f 修复Chart在特定情况下销毁时UGUI报错问题 2023-08-17 15:05:55 +08:00
monitor1394
3aa6daf97c update doc 2023-08-16 08:23:56 +08:00
monitor1394
c3c6eb5719 Merge pull request #273 from Ambitroc/ambitroc
修复数据在-1到1之间坐标轴显示错误问题
2023-08-15 21:34:21 +08:00
zhengzhipeng
4fde95eab7 修复数据在-1到1之间坐标轴显示错误问题 2023-08-15 11:47:41 +08:00
monitor1394
3d4360a10a remove meta 2023-08-14 22:33:31 +08:00
monitor1394
64187fea3f 更新asmdef 2023-08-14 21:58:30 +08:00
monitor1394
0c187b6ff9 修复XCharts本地开启TextMeshProNewInputSystem后更新版本会报错的问题 (#272) 2023-08-14 21:57:17 +08:00
monitor1394
71c8bc1499 修复Chart在运行时被删除时会异常报错的问题 (#269) 2023-08-12 22:18:25 +08:00
monitor1394
d0d5c2a101 修复DataZoom开启时可能会导致无法添加数据的问题 2023-08-11 08:41:19 +08:00
monitor1394
95dddd9448 修复SerieData单独添加ItemStyle后设置itemFormatter不生效的问题 2023-08-11 07:41:02 +08:00
monitor1394
9ed80d3b59 优化BarChartTooltipTriggerItem时的表现 2023-08-10 13:19:05 +08:00
monitor1394
01a49de373 增加Axis可通过设置IconStylecolorclear来实现动态图标颜色的支持 2023-08-09 13:27:03 +08:00
monitor1394
2e2ad0a1f2 增加SymbolEmptyTriangleEmptyDiamond的支持 2023-08-09 08:39:44 +08:00
monitor1394
5356e2304c 增加PieLabelLinelineEndX的支持 2023-08-08 13:24:37 +08:00
monitor1394
0d1d2460a0 修复Tooltip不显示的问题 2023-08-08 06:03:54 +08:00
monitor1394
f88ac6b4c4 整理Examples的代码,删除不必要的用例 2023-08-05 09:41:33 +08:00
monitor1394
9d3d8543a5 增加LabelLinelineEndX可设置引导线固定X位置的支持 2023-08-04 08:39:05 +08:00
monitor1394
ea819bfa42 增加RingavoidLabelOverlap避免文本堆叠的支持 (#247) 2023-08-04 08:26:21 +08:00
monitor1394
618fe0fb01 完善ChartonSerieEnteronSerieExitonSerieClick回调 2023-08-03 07:52:20 +08:00
monitor1394
43ba7d47c5 修复BarChartonSerieEnteronSerieExit回调无效的问题 2023-08-02 08:31:58 +08:00
monitor1394
e3e01587ab 增加SymbolPlus加号和Minus减号的支持 2023-08-02 07:23:28 +08:00
monitor1394
f36ca34055 增加SymbolEmptyTriangleEmptyDiamond的支持,优化Symbol表现效果 2023-07-31 13:32:53 +08:00
monitor1394
0ffc6d7efe 优化Line的默认配置效果 2023-07-31 07:29:53 +08:00
monitor1394
ec89828c67 增加Serie部分配置修改时的自刷新 2023-07-28 08:39:56 +08:00
monitor1394
18c0d3218d 修复饼图在Inspector上修改相关参数后不刷新的问题 2023-07-28 08:09:31 +08:00
monitor1394
f867ac7efd 增加AnimationHiding隐藏动画 2023-07-28 08:08:49 +08:00
monitor1394
fc7655fd76 增加SerieminRadius可设置最小半径 2023-07-27 07:58:10 +08:00
monitor1394
0c09d40654 完善Pie饼图的交互动画效果 2023-07-27 07:17:37 +08:00
monitor1394
758d578ad2 增加MLValue多样式数值 2023-07-26 08:41:06 +08:00
monitor1394
318b4146a9 增加XLog日志系统 2023-07-26 07:51:59 +08:00
monitor1394
ea4dac65e1 完善Pie饼图的交互动画效果 2023-07-25 13:19:06 +08:00
monitor1394
b27f0ec6ec 完善Pie饼图的交互动画效果 2023-07-19 13:23:57 +08:00
monitor1394
f5e8ba4082 完善Pie饼图的交互动画效果 2023-07-18 13:23:41 +08:00
monitor1394
816e26f517 增加AnimationInteraction交互动画配置支持 2023-07-17 22:15:54 +08:00
monitor1394
58d6d52747 增加AnimationInteraction交互动画配置支持 2023-07-14 08:14:00 +08:00
monitor1394
ccd71710ce 3.8.0 2023-07-12 13:20:54 +08:00
monitor1394
e103c87d10 重构Animation动画系统,增加Addition新增动画支持 2023-07-12 13:18:58 +08:00
monitor1394
e515908f9b 重构Animation动画系统,增加Addition新增动画支持 2023-07-12 08:28:42 +08:00
monitor1394
eca0c6ea46 3.8.0 2023-07-11 23:11:05 +08:00
monitor1394
1229c1bfa2 重构Animation动画系统,增加Addition新增动画支持 2023-07-11 23:05:31 +08:00
monitor1394
f678477c88 增加AnimationAddition动画支持 2023-07-11 13:32:50 +08:00
monitor1394
0adc9e71e5 增加Animation的添加动画支持 2023-07-04 13:07:44 +08:00
monitor1394
bc1596f8d3 增加PolarCoodindicatorLabelOffset设置指示文本偏移的支持 2023-07-03 23:10:35 +08:00
monitor1394
4a754c0021 增加PolarCoodindicatorLabelOffset设置指示文本偏移的支持 2023-06-30 08:25:14 +08:00
monitor1394
2c382fda00 修复AxisIndicatorLabel的背景颜色可能不正常的问题 2023-06-30 07:55:21 +08:00
monitor1394
45159b186f 修复AxisIndicatorLabel无法自定义color的问题 2023-06-30 07:48:44 +08:00
monitor1394
00274567cf 修复AxisLabelformatterFunction在数值轴时value不对的问题 2023-06-12 08:05:10 +08:00
monitor1394
42c2c91f03 3.7.0 2023-06-09 08:04:14 +08:00
monitor1394
9c26716e7c 3.7.0 2023-06-08 08:18:01 +08:00
monitor1394
c8a5560a67 修复Serie的名字带_线导致Legend无法触发的问题 (#252) 2023-06-07 08:05:57 +08:00
monitor1394
ad707ec14d Merge pull request #260 from svr2kos2/master
修复Serie名中包含下划线时,会导致Legend组件无法点击的问题
2023-06-04 22:28:53 +08:00
monitor1394
b6c0962ff3 更新文档 2023-06-04 21:52:37 +08:00
monitor1394
86e66984d4 增加HelpDoc帮助文档跳转 2023-06-04 21:52:23 +08:00
svr2kos2
04d646ed8c 修复Serie名中包含下划线时,会导致Legend组件无法点击的问题
由于实现方法是index和name使用下划线合并到物体名称中, 之后在接受事件时用下划线分割后获取index和name. 修改限制分割为2部分
2023-05-30 14:16:57 +08:00
monitor1394
0f83a70b54 更新文档 2023-05-30 07:32:24 +08:00
monitor1394
6b6bf9d9da 更新文档 2023-05-28 22:42:49 +08:00
monitor1394
4c1432a535 Line支持Clip 2023-05-20 08:52:02 +08:00
monitor1394
bab788d4cb Line支持Clip 2023-05-11 08:34:04 +08:00
monitor1394
fab683f5e1 增加AxisMinMaxAuto范围类型 2023-05-10 23:29:31 +08:00
monitor1394
29c9f59762 Line支持Clip 2023-05-09 13:25:42 +08:00
monitor1394
c29a22c576 Line支持Clip 2023-05-09 07:17:27 +08:00
monitor1394
5568c2fd76 3.7.0 2023-05-08 23:31:03 +08:00
monitor1394
5c231514a5 Line支持Clip 2023-05-08 23:24:50 +08:00
monitor1394
93abffaaaa DataZoom的minShowNum默认设置为2 2023-05-08 23:23:11 +08:00
monitor1394
a9c801c077 优化AxisMinMax类型范围计算 2023-05-04 23:33:45 +08:00
monitor1394
2d35f77740 修复AxisLabel在数据都是小于1的浮点数时显示Label格式不对的问题 2023-05-04 13:25:29 +08:00
monitor1394
529c784ee2 修复Theme在修改默认主题的参数后运行被重置的问题 2023-05-04 08:14:41 +08:00
monitor1394
fdd686b038 增加Symbol选择Custom类型时的Warning提示 2023-05-04 07:57:04 +08:00
monitor1394
36d629b29a 修复DataZoom在多个图表时可能异常的问题 (#252) 2023-04-15 08:45:27 +08:00
monitor1394
59335786df 修复Tooltip在只有一个数据时可能异常的问题 2023-04-14 20:53:31 +08:00
monitor1394
0af76517e1 增加BaseChartTriggerTooltip()接口尝试触发ToolTip 2023-04-14 13:35:45 +08:00
monitor1394
674d937104 优化RadarCood设置startAngle时文本也跟随调整位置 2023-04-12 22:57:12 +08:00
monitor1394
a038317c6e 增加Radar对通配符{b}的支持 2023-04-12 22:50:05 +08:00
monitor1394
5fe12dcde7 修复动态添加组件时Inspector可能异常的问题 2023-04-11 23:05:10 +08:00
monitor1394
f00eb2147d 修复动态添加组件时Inspector可能异常的问题 2023-04-11 08:00:06 +08:00
monitor1394
76238d7d7e 3.6.0 2023-04-02 09:23:25 +08:00
monitor1394
c53be4b5f9 3.6.0 2023-04-01 23:05:47 +08:00
monitor1394
8b320e9bc9 调整Serie的smoothLimit默认为false 2023-03-31 07:12:42 +08:00
monitor1394
5757049e74 完善Pyramid的Tooltip检测 2023-03-21 08:12:20 +08:00
monitor1394
d196551756 3.6.0 2023-03-20 22:00:02 +08:00
monitor1394
d7223f6790 3.6.0 2023-03-20 21:59:12 +08:00
monitor1394
a50b58d48e 增加UI组件支持 2023-03-20 21:56:56 +08:00
monitor1394
a0db57bdf2 支持数据的循环变更动画 2023-03-20 21:38:58 +08:00
monitor1394
3dfa5487ee 修复TooltiptitleFormater设置{b}可能不生效的问题 2023-03-15 13:04:48 +08:00
monitor1394
bddbe600ce Merge pull request #250 from Ambitroc/master
修复BarChart在数据为0时,Bar背景不绘制问题
2023-03-14 21:37:01 +08:00
Ambitroc
3073926d73 修复BarChart在数据为0时,Bar背景不绘制问题 2023-03-14 13:31:40 +08:00
monitor1394
49e9066334 增加LabelStyleautoRotate可设置有角度的竖版文本的自动旋转 2023-03-13 07:21:00 +08:00
monitor1394
372ed1de58 增加LabelStyleautoRotate可设置有角度的竖版文本的自动旋转 2023-03-12 22:57:37 +08:00
monitor1394
dbb867e0ab 增加LabelStyleautoRotate可设置有角度的竖版文本的自动旋转 2023-03-12 22:56:36 +08:00
monitor1394
adbd88c411 Merge pull request #248 from Ambitroc/master
支持除鼠标以外其他输入方式的Point位置获取,比如VR项目
2023-03-10 11:46:13 +08:00
Ambitroc
99b3d24366 支持除鼠标以外其他输入方式的Point位置获取,比如VR项目 2023-03-10 10:43:47 +08:00
monitor1394
6f69af3945 增加API文档的since 2023-03-09 22:51:09 +08:00
monitor1394
c6e38f2003 增加API文档的since 2023-03-09 22:49:07 +08:00
monitor1394
e0f4ed946d 增加回调API文档 2023-03-09 22:39:05 +08:00
monitor1394
465af108aa 增加ChartonSerieClickonSerieDownonSerieEnteronSerieExit回调 2023-03-09 21:31:26 +08:00
monitor1394
bf152a3a71 增加LegendPositions可自定义图例的位置 2023-03-04 21:09:50 +08:00
monitor1394
64c9b97eb9 修复Animation变更动画可能无效的问题 2023-03-03 22:41:00 +08:00
monitor1394
c42ca0f097 修复Legend点击时SerieLabel不刷新的问题 2023-02-28 13:11:18 +08:00
monitor1394
8c6d013341 增加DataZoomstartEndFunction委托 2023-02-26 22:49:19 +08:00
monitor1394
398fee2d97 修复TMP下报错 2023-02-22 22:08:40 +08:00
monitor1394
33246c2a1f update doc 2023-02-15 21:47:08 +08:00
monitor1394
b102fed9fe update doc 2023-02-14 13:18:39 +08:00
monitor1394
9c069296ed update doc 2023-02-13 07:22:07 +08:00
monitor1394
9f94541b9e 转移inputsystem文档到主站仓库 2023-02-13 07:21:48 +08:00
monitor1394
7a367d24ab 重构ChartHelper.GetOrAddComponent接口 2023-02-13 07:20:50 +08:00
monitor1394
4964bca341 重构Component相关代码,调整API接口 2023-02-12 21:22:53 +08:00
monitor1394
22b167981b update doc 2023-02-10 13:41:37 +08:00
monitor1394
80d9087084 优化Axis的数值Label的默认显示格式 2023-02-10 13:23:38 +08:00
monitor1394
d6630ef5bf update doc 2023-02-08 08:28:21 +08:00
monitor1394
5e3bc3ff15 增加DataZoomstartLockendLock参数支持锁定 2023-02-08 08:22:39 +08:00
monitor1394
3d09d82abd 修复DataZoom开启时X轴Label可能会显示在图表外的问题 2023-02-02 08:31:15 +08:00
monitor1394
22715dab95 优化SerieDataignore设置时的忽略数据判断 2023-02-02 07:58:50 +08:00
monitor1394
ace8537650 修复XChartsMgr.ContainsChart()接口异常 2023-02-01 21:00:37 +08:00
monitor1394
d7c6bf59ef Merge pull request #242 from Bian-Sh/master
增加`InputSystem`支持
2023-01-31 08:12:50 +08:00
边上海
c9cd4ee38a 同步更新部分示例代码对按键的读取逻辑
简化了部分协同程序的使用逻辑
2023-01-30 21:31:40 +08:00
边上海
633456ada0 将 inputsystem 支持功能添加到 xchart 菜单
顺便简化了 tmp 支持相关逻辑
2023-01-30 21:31:40 +08:00
边上海
7fbaf7af70 新增对 InputSystem 的支持
Update BaseGraph.cs

Update XCharts.Runtime.asmdef
2023-01-30 19:15:14 +08:00
monitor1394
e90d7d61d9 修复Inspector上移除Component后图表没有及时刷新的问题 (#241) 2023-01-11 08:12:42 +08:00
monitor1394
bda6fc7978 修复Pie在最后的几个数据都为0时Label显示不正常的问题 (#240) 2023-01-06 22:51:02 +08:00
monitor1394
8288e75445 优化gameObject被Destory后的判断 2023-01-06 08:35:16 +08:00
monitor1394
6ace71f8db 删除SerieMarkColor,增加ItemStyleMarkColor 2023-01-03 21:07:28 +08:00
monitor1394
a4aabb5bbe 3.6.0 2022-12-30 22:30:42 +08:00
monitor1394
d90a0d69b2 增加EditorList+添加编辑功能 2022-12-30 22:13:03 +08:00
monitor1394
c17d83ae6d 修复UpdateXYData()接口影响数据精度的问题 (#238) 2022-12-29 20:57:56 +08:00
monitor1394
317ffc4d99 修复Pie只有一个数据时设置border后显示异常的问题 (#237) 2022-12-28 18:17:56 +08:00
monitor1394
bc6c387db3 调整Covert重命名为Convert 2022-12-22 22:26:10 +08:00
monitor1394
d9053db2e3 修复Covert XY Axis后Y轴的Label显示异常的问题 2022-12-22 22:15:58 +08:00
monitor1394
d7cfda2521 代码优化 2022-12-22 21:51:08 +08:00
monitor1394
a5aa630b74 修复AxisValue轴在某些情况下计算数值范围不准确的问题 2022-12-12 13:41:04 +08:00
monitor1394
ce1691e1ce 优化Legendformatter支持{h}通配符 2022-12-12 13:15:29 +08:00
monitor1394
a3a25fe7c6 修复Legendformatter设置为固定值时显示不正常的问题 2022-12-12 07:29:30 +08:00
monitor1394
d4a3886530 增加AreaStyletoTop参数可设置折线图渐变色是到顶部还是到实际位置 2022-12-08 07:32:33 +08:00
monitor1394
927644fb10 增加Formatter的文本通配符{h}支持设置当前颜色值 2022-12-07 13:19:06 +08:00
monitor1394
d67a922a74 整理和重构代码 2022-12-07 13:16:06 +08:00
monitor1394
84a8e6ca19 v3.5.0 2022-12-01 21:43:46 +08:00
monitor1394
858ad55a35 v3.5.0 2022-12-01 21:29:38 +08:00
monitor1394
bfc4ff39fb v3.5.0 2022-12-01 21:05:56 +08:00
monitor1394
7603d60ea0 publish v3.5.0 2022-12-01 08:35:14 +08:00
monitor1394
8078e1c54f 更新文档 2022-11-30 20:42:12 +08:00
monitor1394
59c9d758e1 增加SeriebarMaxWidth可设置Bar的最大宽度 2022-11-30 09:39:41 +08:00
monitor1394
7ea0fbd66d 优化TooltipShadow绘制不超出图表范围 2022-11-30 09:31:39 +08:00
monitor1394
5f11f7d6e3 修复Tooltip指示的Serie数据项索引异常的问题 2022-11-29 22:38:08 +08:00
monitor1394
5879c99995 优化AxisAxisName的偏移设置 2022-11-28 09:26:52 +08:00
monitor1394
4356111e0c 优化AxisAxisName的偏移设置 2022-11-27 17:40:56 +08:00
monitor1394
f2001fbc82 优化Comment的位置,用Location代替Position 2022-11-27 17:28:37 +08:00
monitor1394
906b6ed4c7 update doc 2022-11-27 16:54:32 +08:00
monitor1394
32f98b6d5a 优化TooltipLineStyle支持设置Shadow时的颜色 2022-11-27 16:54:09 +08:00
monitor1394
b6702be558 优化LabelLinesymbol默认不显示 2022-11-26 12:10:59 +08:00
monitor1394
69db61c7b6 修复LineChartXY都为数值轴时添加无序数据显示异常的问题 2022-11-26 12:02:56 +08:00
monitor1394
da10188c6b 修复DataZoom从右往左框选时异常的问题 2022-11-26 10:40:12 +08:00
monitor1394
5593210cc6 [doc] update doc 2022-11-20 22:25:19 +08:00
monitor1394
8abd486fcd 调整UdpateXAxisIcon()接口重命名为UpdateXAxisIcon() (#235) 2022-11-20 20:24:22 +08:00
monitor1394
051dbb50b1 [doc] update doc 2022-11-20 20:18:20 +08:00
monitor1394
30e6e6908c [doc] update doc 2022-11-19 21:33:46 +08:00
monitor1394
be2e8f14cf [doc] update doc 2022-11-19 21:29:47 +08:00
monitor1394
56f0ff64b9 [doc] update doc 2022-11-19 21:24:08 +08:00
monitor1394
8a7f0c6533 增加PieLabelLine支持Symbol 2022-11-14 21:49:53 +08:00
monitor1394
8c0eb970d3 [feature][datazoom] 增加DataZoomMarqueeStyle支持框选区域 2022-11-12 21:32:08 +08:00
monitor1394
5e234dc408 [feature][datazoom] 增加DataZoomMarqueeStyle支持框选区域 2022-11-12 21:27:52 +08:00
monitor1394
26ef85ce6f [fix][comment] fix null error for comment 2022-11-12 08:19:51 +08:00
monitor1394
6d287f6678 优化Radar在类型为Single时的区域颜色填充效果 2022-11-10 07:12:22 +08:00
monitor1394
15eddd21d5 [doc] update doc 2022-11-06 10:23:28 +08:00
monitor1394
29722998e4 修复TooltipitemFormatter设置通配符{d}后异常的问题 2022-11-04 19:02:55 +08:00
monitor1394
faa5bc7cd8 check null 2022-11-02 07:20:00 +08:00
monitor1394
eb2c3d8560 v3.4.0 2022-11-01 07:21:06 +08:00
monitor1394
0c91f46aeb v3.4.0 2022-11-01 07:03:14 +08:00
monitor1394
7d16cb2017 更新教程 2022-10-30 20:56:18 +08:00
monitor1394
bdb171c4e6 增加API:AddData(),ClearSerieData(),ClearComponentData() 2022-10-30 20:56:05 +08:00
monitor1394
d7ebfb1f41 [feature] 增加AxisindicatorLabel,移除TooltipindicatorLabelStyle (#226) 2022-10-30 10:37:10 +08:00
monitor1394
c9d554d184 [feature] 增加AxisindicatorLabel,移除TooltipindicatorLabelStyle (#226) 2022-10-30 10:28:17 +08:00
monitor1394
e0974fffbe [feature] 增加SeriemarkColor可设置标识颜色用于LegendTooltip的展示 (#229) 2022-10-29 18:25:20 +08:00
monitor1394
cc63764eef v3.4.0 2022-10-28 07:20:20 +08:00
monitor1394
687fc0d495 update README.md 2022-10-27 07:27:07 +08:00
monitor1394
ce4e88c51c 增加RadarCoordstartAngle可设置Radar起始角度 2022-10-26 08:04:44 +08:00
monitor1394
42a77a9439 [fix] 修复ChartLayout布局下时Label显示不正常的问题 (#231) 2022-10-21 22:56:16 +08:00
monitor1394
bbab8d9b75 修复Unity2019.2上的兼容问题 2022-10-21 12:37:00 +08:00
monitor1394
b1eae7045b [improve][axis] improve max value and division of y axis 2022-10-18 08:33:12 +08:00
monitor1394
a78eed9c5c [fix] fix axis label error when datazoom enable (#227) 2022-10-15 23:00:20 +08:00
monitor1394
a9fefae642 [feature][datazoom] datazoom support value axis 2022-10-14 07:10:04 +08:00
monitor1394
f6ad852a44 [fix][pie] fix pie draw error when set border (#225) 2022-10-13 13:26:25 +08:00
monitor1394
53610b53ca [fix] Fixed Download interface caused the iOS platform to fail to build 2022-10-13 07:52:47 +08:00
monitor1394
e1f20e0796 [feature][animation] add UnscaledTime for animation #223 2022-10-12 08:35:23 +08:00
monitor1394
ab8ced4aed update doc 2022-10-11 07:00:35 +08:00
monitor1394
0662f62cd1 [feature] Add smoothLimit for Line 2022-10-10 07:07:57 +08:00
monitor1394
5ed6ee1d2a [fix] fix tooltip display error when serie is hide 2022-10-05 16:27:40 +08:00
monitor1394
99769da035 [fix] fix divide by zero exception 2022-09-30 16:35:53 +08:00
monitor1394
75bf6e0e6c v3.3.0 2022-09-28 08:20:10 +08:00
monitor1394
aec3e59aca [improve][Axis] improve default split number 2022-09-26 22:15:49 +08:00
monitor1394
1141208407 v3.3.0 2022-09-26 08:38:33 +08:00
monitor1394
a9fe1f53b1 [doc] update doc 2022-09-25 22:41:13 +08:00
monitor1394
7f27325ce1 [refactor]remove warning 2022-09-25 22:40:30 +08:00
monitor1394
4c89bda4b9 [improve][Parallel] improve ParallelChart 2022-09-23 08:38:56 +08:00
monitor1394
bd9a0df52b [feature][API] add SaveAsImage() 2022-09-22 08:37:56 +08:00
monitor1394
eba8986f18 [fix] fix InsertSerie() 2022-09-21 07:18:54 +08:00
monitor1394
95c0bcdb75 [fix] fix InsertSerie() 2022-09-21 07:12:59 +08:00
monitor1394
4b8ca2e5e1 [improve][line] improve line in polar 2022-09-21 06:59:57 +08:00
monitor1394
f0d6316c20 [improve][axis] support showStartLine and showEndLine in AngleAxis and RadiusAxis 2022-09-21 06:59:34 +08:00
monitor1394
ae35a4d7e6 [feature][polar] support heatmap in polar 2022-09-20 13:16:22 +08:00
monitor1394
4e05759c3c [feature][polar] support multiple bar and stack bar in polar 2022-09-19 13:20:34 +08:00
monitor1394
ba9faa8bc6 [feature][polar] support bar and ring polar 2022-09-16 08:03:14 +08:00
monitor1394
afbfa20fd9 [feature][polar] support circular polar 2022-09-14 07:13:45 +08:00
monitor1394
ac7628ce68 [bug] fix editor auto refresh bug 2022-09-09 13:19:22 +08:00
monitor1394
dd6833d322 [feature][ring] support LabelLine 2022-09-08 08:00:13 +08:00
monitor1394
a5e13794e8 [feature][symbol] add minSize and maxSize for SerieSymbol 2022-09-07 07:14:22 +08:00
monitor1394
16d055abc0 [feature][axis] add showStartLine and showEndLine for AxisSplitLine 2022-09-06 22:54:40 +08:00
monitor1394
83744777c5 [feature][heatmap] support symbol 2022-09-06 13:12:50 +08:00
monitor1394
ccc5110e8e [feature][heatmap] support heatmapType 2022-09-06 07:22:04 +08:00
monitor1394
ce702fd1e3 [improve][tooltip] improve tooltip for heatmap 2022-09-05 13:18:00 +08:00
monitor1394
a44eca0f91 [feature][pie] support onPointerEnterPie 2022-09-02 08:33:34 +08:00
monitor1394
8bd0c23e19 [improve][heatmap] improve heatmap chart 2022-09-02 08:12:57 +08:00
monitor1394
061ac49670 [improve][radar]improve radar chart 2022-08-31 22:03:51 +08:00
monitor1394
027f5f260c [bug][datazoom] fix datazoom range error (#221) 2022-08-30 08:04:18 +08:00
monitor1394
5f16685b64 [improve][serie] improve min-max data range 2022-08-29 23:02:03 +08:00
monitor1394
6710a52950 [feature][barchart] bar width 2022-08-29 23:00:54 +08:00
monitor1394
de16bfad01 [bug][candlestick] fix tooltip error 2022-08-29 23:00:11 +08:00
monitor1394
b01c2e4338 [improve][CandlestickChart] improve large data rendering 2022-08-29 21:09:27 +08:00
monitor1394
6ae4468aa2 [bug][line] fix linechart error when stack and custom y range. 2022-08-28 17:34:22 +08:00
monitor1394
48686e865c [feature][legend] add new icon type:candlestick 2022-08-26 23:18:35 +08:00
monitor1394
a885be625e [improve][Candlestick] improve CandlestickChart 2022-08-26 23:17:54 +08:00
monitor1394
a1d8f34720 v3.3.0 2022-08-26 07:52:40 +08:00
monitor1394
b2f1fd00b1 [feature][Tooltip] support position 2022-08-26 07:50:48 +08:00
monitor1394
442a51abc1 [improve][label] improve emphasis label 2022-08-25 21:38:25 +08:00
monitor1394
9552e877ce [feature][formatter] support {d3} 2022-08-25 13:37:36 +08:00
monitor1394
34dd3d1c4e [improve][MarkLine] improve label 2022-08-25 08:37:17 +08:00
monitor1394
9e07fa1db3 v3.2.0 2022-08-16 07:43:22 +08:00
monitor1394
990c6dad90 [API][chart] RemoveAllSerie() 2022-08-15 08:21:28 +08:00
monitor1394
99dc2af42a [optimize] optimize smooth curve 2022-08-15 07:30:56 +08:00
monitor1394
f32808a36d [bug][datazoom] fix chart display error when datazoom enable. 2022-08-13 13:38:02 +08:00
monitor1394
ca5470a351 [feature][tooltip] support ignoreDataDefaultContent 2022-08-11 08:11:43 +08:00
monitor1394
34b132735d [bug] fix chart.RemoveSerie (#219) 2022-08-10 13:19:26 +08:00
monitor1394
0f31f057df [bug] fix rotation 2022-08-10 13:18:44 +08:00
monitor1394
65d32f7aec [improve][editor] improve editor edit 2022-08-10 08:16:19 +08:00
monitor1394
fcc1314f17 [optimize][axis] set chart default layer to UI 2022-08-10 07:22:41 +08:00
monitor1394
9981ce2d23 [optimize][axis] optimize minor split line of time axis 2022-08-09 13:38:23 +08:00
monitor1394
f1f2ea78be [feature][AreaStyle] support innerFill 2022-08-09 08:29:06 +08:00
monitor1394
d1f9c77571 [bug] fix serieData.index error 2022-08-09 08:01:19 +08:00
monitor1394
19914586ae [optimize][serie] optimize index of serieData 2022-08-08 07:43:19 +08:00
monitor1394
e7f19e72a5 update serie label 2022-08-02 13:03:33 +08:00
monitor1394
35220a1026 scheduled release date for v3.2.0 2022-08-02 08:01:22 +08:00
monitor1394
b9812a4f98 [feature][bug] fix import packge error 2022-07-29 13:25:05 +08:00
monitor1394
74b078c926 [feature][axis] support minorTick and minorSplitLine of time axis 2022-07-29 07:49:15 +08:00
monitor1394
44dc1f7b16 [feature][UGL] add UGL.DrawPolyon API 2022-07-28 13:33:38 +08:00
monitor1394
cdf0bc81e1 [feature][serie] support the colorBy of serie 2022-07-28 07:21:46 +08:00
monitor1394
5b2b2d4059 [feature][symbol] support symbol settings for StateStyle 2022-07-27 08:00:57 +08:00
monitor1394
b3b0c0b3aa v3.2.0 2022-07-27 08:00:11 +08:00
monitor1394
4f93628667 [feature][serie] support EmphasisStle,BlurStyle and SelectStyle 2022-07-25 07:46:03 +08:00
monitor1394
8dde322c04 [doc] class doc support since version 2022-07-20 08:15:27 +08:00
monitor1394
47ee421913 [bug][axis] fix showStartLabel and showEndLabel not work 2022-07-20 07:38:18 +08:00
monitor1394
0355e3ed46 [feature][axis] support minor tick and minor split line 2022-07-19 08:22:42 +08:00
monitor1394
eedafa7011 [feature][radar] support smooth line 2022-07-17 20:57:38 +08:00
monitor1394
aee49322b7 [feature][datazoom] support time axis 2022-07-15 08:37:14 +08:00
monitor1394
96a49f2b11 v3.1.0 2022-07-12 07:38:42 +08:00
monitor1394
131aabc76a [bug][line] fix ignoreLineBreak of line serie not work 2022-07-12 07:26:07 +08:00
monitor1394
e42afe8d47 [optimize][axis] support auto float min-max range 2022-07-11 07:04:34 +08:00
monitor1394
69243b7cd0 [optimize][axis] support float when Axis MinMaxType set to MinMax 2022-07-11 07:02:02 +08:00
monitor1394
12757eb4db [doc] update doc 2022-07-07 07:42:53 +08:00
monitor1394
945a69ba70 [doc] update doc 2022-07-07 07:08:02 +08:00
monitor1394
9aa8431432 [bug] fix multipe grid error (#210) 2022-07-05 21:43:09 +08:00
monitor1394
a499002426 [code] add example of test dynamic chart 2022-07-05 08:07:52 +08:00
monitor1394
4d5e2481b0 [feature][axis] support Settings.axisMaxSplitNumber 2022-07-04 13:37:16 +08:00
monitor1394
2248b61d03 [bug][axis] fix axis tick error (#209) 2022-07-04 13:14:23 +08:00
monitor1394
419715bb2a [doc] update doc 2022-07-04 08:32:01 +08:00
monitor1394
f5c2e73098 [code] add comment 2022-07-04 08:30:43 +08:00
monitor1394
197402dcb7 [code] refactor the code 2022-07-03 21:09:49 +08:00
monitor1394
33fd4aa9f3 [feature][axis] support AxisName.onZero (#207) 2022-07-03 10:02:22 +08:00
monitor1394
9b263c883b [bug][pie] fix piechart create error with code (#206) 2022-07-02 23:10:11 +08:00
monitor1394
06574a201a [bug] fix AxisLabel.onZero not work in YAxis 2022-07-02 16:51:45 +08:00
monitor1394
fbdb51d847 [bug] fix axislabel distance error 2022-07-02 16:43:52 +08:00
monitor1394
47c9b99931 [bug] fix chart not being created correctly at runtime 2022-06-30 08:31:09 +08:00
monitor1394
bb9f28dd5c [feature][tooltip] support {c0} for itemFormatter (#205) 2022-06-29 13:33:38 +08:00
monitor1394
0f2f55e436 [optimize][pie] avoid label overlap (#56) 2022-06-28 13:23:32 +08:00
monitor1394
6c9528cf19 [optimize][line]smooth line (#169) 2022-06-26 08:35:59 +08:00
monitor1394
91b9055039 [doc] doc link 2022-06-25 19:41:35 +08:00
monitor1394
564ff2e178 [bug] fix tooltip show data error when datazoom enable (#203) 2022-06-25 19:32:50 +08:00
monitor1394
2a03e71312 [bug] fix tooltip draw error when axis data is empty (#204) 2022-06-25 17:07:26 +08:00
monitor1394
0dbcc4ab2b [optimize][tooltip] serie placeHolder 2022-06-25 16:33:50 +08:00
monitor1394
f19b61f1f2 [doc] add since version 2022-06-25 11:45:22 +08:00
monitor1394
9a1c76c236 [optimize][painter] add upper and top painter layer 2022-06-24 22:17:01 +08:00
monitor1394
7c07499e44 [optimize][legend] support background and padding 2022-06-24 22:15:49 +08:00
monitor1394
8a6253621b [optimize][textstyle] support sprite asset of TextMeshPro (#201) 2022-06-21 08:15:48 +08:00
monitor1394
5bc14dd37a [optimaze][tooltip] content rect limit (#202) 2022-06-20 13:41:28 +08:00
monitor1394
b11e8fcb3a [bug]fix TextMeshPro compile error 2022-06-20 13:05:44 +08:00
monitor1394
df0a87c935 [bug] fix fadeout animation 2022-06-20 08:24:00 +08:00
monitor1394
431cf7de74 v3.0.1 2022-06-16 08:14:02 +08:00
monitor1394
87049b5170 [doc] update comment and doc 2022-06-15 07:36:05 +08:00
monitor1394
c24d89c8ab [optimaze][label] icon and emphasis label 2022-06-14 07:28:24 +08:00
monitor1394
e8c46b676f [optimaze][background] rename hideThemeBackgroundColor to autoColor 2022-06-14 07:01:46 +08:00
monitor1394
0880b2f3f9 [optimize][legend]support textstyle autoColor 2022-06-10 21:00:58 +08:00
monitor1394
1d1ad6fa57 [bug] fix axis label active 2022-06-08 08:32:29 +08:00
monitor1394
6e87f82131 3.0 2022-06-01 07:59:00 +08:00
monitor1394
9549159a58 3.0 2022-05-31 08:33:54 +08:00
monitor1394
e370bedc09 3.0 2022-05-31 08:17:54 +08:00
monitor1394
5740882d1c 3.0 2022-05-29 17:25:45 +08:00
monitor1394
63166e5cd1 3.0 2022-05-26 21:33:05 +08:00
monitor1394
6ba6a7929d 3.0 2022-05-24 13:43:15 +08:00
monitor1394
e0a596d02a 3.0 2022-05-24 13:39:19 +08:00
monitor1394
9b7ebea827 3.0 2022-05-24 13:36:23 +08:00
monitor1394
0ad4a47c36 3.0 2022-05-23 08:23:58 +08:00
monitor1394
1ac59dff86 3.0 2022-05-22 22:27:20 +08:00
monitor1394
bafe032bb9 3.0 2022-05-22 22:17:38 +08:00
monitor1394
003f4da9de [bug] fix create chart error 2022-05-06 13:07:50 +08:00
monitor1394
d77e1c3d91 v3.0.0-preivew9 2022-05-06 08:14:49 +08:00
monitor1394
d4b3f5eaa8 3.0.0-preview9 2022-05-06 08:12:15 +08:00
monitor1394
8a78867961 [doc] update doc 2022-05-05 13:23:33 +08:00
monitor1394
d9266b3c9c [refactor][optimize] item color 2022-05-05 13:10:04 +08:00
monitor1394
0801069f72 [add][line] line support dash (#197) 2022-05-04 20:47:02 +08:00
monitor1394
e92afac0de [add][legend] add the delegate callback for legend 2022-05-04 09:19:45 +08:00
monitor1394
d1fd4dcf44 [refactor] refactor symbol and label 2022-05-04 08:45:19 +08:00
monitor1394
43c31405b8 [bug][ring] fix ring label formatter (#195) 2022-05-01 10:54:14 +08:00
monitor1394
4e4d0bc85d [optimize][bar] bar support clip and min-max (#196) 2022-05-01 10:30:58 +08:00
monitor1394
96b0ec45d2 [optimize][tooltip] support background image 2022-04-29 15:54:47 +08:00
monitor1394
8c02ce14ac [bug] fix change color in runtime did not refresh 2022-04-27 08:26:05 +08:00
monitor1394
419c704b23 v3.0.0-preivew8 2022-04-26 08:26:37 +08:00
monitor1394
9dedc1db68 v3.0.0-preivew8 2022-04-26 08:24:45 +08:00
monitor1394
f11ee84517 [optimize][label] support label rotate 2022-04-19 13:30:24 +08:00
monitor1394
dfa978afe0 [optimize][visualmap] support horizontal gradient 2022-04-19 07:22:47 +08:00
monitor1394
4e6658ad70 [optimize][bar] optimize border and capsule 2022-04-18 08:20:16 +08:00
monitor1394
ef5988a851 [enhancement][liquid] support round rect vessel 2022-04-15 13:12:19 +08:00
monitor1394
5d6c5b5f79 [doc] update api doc 2022-04-14 21:42:40 +08:00
monitor1394
80e4475f65 [enhancement][line] line support end label 2022-04-14 21:32:44 +08:00
monitor1394
84cf39df4d [doc] update doc 2022-04-13 22:04:45 +08:00
monitor1394
d44bf55a87 [add][VisualMap] add workOnLine and workOnArea (#191) 2022-04-13 22:03:23 +08:00
monitor1394
ad273cf1b1 [optimize] optimize interact and performance 2022-04-13 13:33:09 +08:00
monitor1394
a3d2d3f1d5 [optimize] optimize interact and performance 2022-04-13 13:26:46 +08:00
monitor1394
7ca4ddcb88 [optimize] radar support area tooltip 2022-04-12 08:09:18 +08:00
monitor1394
9a3461084c [doc] update readme 2022-04-11 21:54:09 +08:00
monitor1394
09df6fa73d [doc] update doc 2022-04-11 21:49:18 +08:00
monitor1394
be4ed41ca6 [optimize] visualmap 2022-04-09 21:30:28 +08:00
monitor1394
e2b0c935e0 [optimize] tooltip 2022-04-09 11:03:41 +08:00
monitor1394
e4fac71987 v3.0.0-preivew7 2022-04-07 08:38:17 +08:00
monitor1394
20825c148f [doc] update api and configuration 2022-04-07 08:36:14 +08:00
monitor1394
5476fa8d09 [setting] update setting 2022-04-07 08:35:20 +08:00
monitor1394
80c77fc69a [optimize] Pie support startAngle 2022-04-07 08:35:03 +08:00
monitor1394
621bc3dcfd [bug] Fix pie color 2022-04-07 08:16:50 +08:00
monitor1394
1ed0ff377a fix add main component error 2022-03-31 21:54:34 +08:00
monitor1394
426d437e6d fixed axis label custom color 2022-03-30 13:15:24 +08:00
monitor1394
6c0dcbbcbb 3.0 2022-03-30 08:25:48 +08:00
monitor1394
4ade064266 3.0 2022-03-30 08:24:47 +08:00
monitor1394
1ad87920d0 3.0 2022-03-29 22:06:10 +08:00
monitor1394
b784900fda 3.0 2022-03-28 19:28:39 +08:00
monitor1394
acba2f5c1e 3.0 2022-03-27 12:49:20 +08:00
monitor1394
3bccbd0ab2 3.0 2022-03-26 22:28:23 +08:00
monitor1394
327661bfdd Create FUNDING.yml 2022-03-26 22:05:59 +08:00
monitor1394
ed393ea560 3.0 2022-03-26 21:34:38 +08:00
monitor1394
3fbf5bc906 3.0 2022-03-26 18:30:55 +08:00
monitor1394
b7efcf87cf 3.0 2022-03-26 18:26:34 +08:00
monitor1394
1aea9f3cfe 3.0 2022-03-26 17:20:52 +08:00
monitor1394
edd6d940b6 3.0 2022-03-26 17:11:12 +08:00
monitor1394
09f7557e1f 3.0 2022-03-25 13:36:10 +08:00
monitor1394
2e954490ec 3.0 2022-03-24 21:48:53 +08:00
monitor1394
f597a3f116 3.0 2022-03-24 08:37:06 +08:00
monitor1394
6cb3709655 3.0 2022-03-21 08:21:16 +08:00
monitor1394
ab21d97029 3.0 2022-03-21 08:06:31 +08:00
monitor1394
2dfda6c0ca 3.0 2022-03-21 07:42:32 +08:00
monitor1394
59896d2323 3.0 2022-03-20 21:37:17 +08:00
monitor1394
da611012da 3.0 2022-03-20 20:58:17 +08:00
monitor1394
1ba362ad11 3.0 2022-03-20 19:08:08 +08:00
monitor1394
c510831f59 3.0 2022-03-20 18:52:50 +08:00
monitor1394
4e24ba7922 3.0 2022-03-18 08:23:17 +08:00
monitor1394
407b3625d7 3.0 2022-03-16 13:41:26 +08:00
monitor1394
d6c45aaf6b 3.0 2022-03-09 08:23:15 +08:00
monitor1394
115a47a5df 3.0 2022-03-09 08:18:59 +08:00
monitor1394
7582a76d1f 3.0 2022-03-09 07:26:15 +08:00
monitor1394
5745fea9a1 3.0 - optimize code 2022-03-04 22:17:32 +08:00
monitor1394
1ee0df09eb 3.0 - inspector 2022-02-25 08:10:09 +08:00
monitor1394
e72349a69f 3.0 - namespace 2022-02-19 22:37:57 +08:00
monitor1394
ce5aeb2d98 3.0 - guage chart 2022-02-19 17:35:22 +08:00
monitor1394
a19b796a02 3.0 - tooltip 2022-02-12 20:10:29 +08:00
monitor1394
cc4ee3735c 3.0 - polar chart 2022-01-26 20:47:14 +08:00
monitor1394
a32f5f5bcf 3.0 - liquid chart and ring chart 2022-01-22 22:58:55 +08:00
monitor1394
d9840bef52 3.0 - radar chart 2022-01-22 21:08:26 +08:00
monitor1394
a8b2068029 3.0 - scatter chart and candlestick chart 2022-01-16 22:16:33 +08:00
monitor1394
c9addaf02c 3.0 - bar chart 2022-01-13 21:45:59 +08:00
monitor1394
0282dae582 compatibility 2022-01-07 09:48:59 +08:00
monitor1394
228a4b2840 3.0 - unitypackage 2022-01-05 21:40:48 +08:00
monitor1394
c160867765 3.0 - optimize vert 2022-01-05 07:46:30 +08:00
monitor1394
d20f27b610 3.0 - simplified serie 2021-12-31 13:00:17 +08:00
monitor1394
3a41f1e00e 3.0 - serie extra component 2021-12-28 08:18:24 +08:00
monitor1394
90cb25b74f 3.0 - cleanup code 2021-12-24 13:33:09 +08:00
monitor1394
fa3137eb55 3.0 - remove gauge chart to extension 2021-12-24 07:38:10 +08:00
monitor1394
18ed060c67 3.0 - interaction 2021-12-23 13:23:18 +08:00
monitor1394
761ae595c2 3.0 - tooltip 2021-12-19 20:53:55 +08:00
monitor1394
0aa476e757 3.0 - animation 2021-12-12 18:05:26 +08:00
monitor1394
9c69774d35 3.0 - bar chart 2021-12-11 18:26:28 +08:00
monitor1394
081cd4b503 3.0 - serie clone and covert 2021-12-09 21:35:23 +08:00
monitor1394
cd1a36cc18 3.0 - serie data context 2021-12-09 07:12:15 +08:00
monitor1394
6109b62eb7 3.0 - serie context 2021-12-08 13:36:02 +08:00
monitor1394
a5469c0996 3.0 - LineChart 2021-12-08 08:31:32 +08:00
monitor1394
f39cddaa5e 3.0 - ParallelChart 2021-11-28 20:31:41 +08:00
monitor1394
1b3fa7fb43 3.0 commit 2021-11-23 13:20:07 +08:00
monitor1394
d87e0f8267 Fixed the problem of displaying exceptions after adding data again when DataZoom is enable (#163) 2021-08-16 14:47:02 +08:00
monitor1394
3590d1ebbc Improved Axis's AxisLabel text rotate setting to avoid inconsistency offset in DataZoom (#163) 2021-08-15 22:35:27 +08:00
monitor1394
6fae151c8e Added Legend's textAutoColor to set the text color match with Serie color (#163) 2021-08-14 15:05:37 +08:00
monitor1394
92ee57baf8 优化BarChart设置Corner时正负柱条圆角对称 2021-08-12 22:16:00 +08:00
monitor1394
b5098d5682 优化Serie的数据全为0时Y轴不显示的问题 2021-08-03 08:23:23 +08:00
monitor1394
a4963435d7 修复Serie开启ignore时被忽略的数据还会参与计算的问题 (#161) 2021-07-29 08:28:07 +08:00
monitor1394
25972f0382 完善BarChartZebra斑马柱图渐变支持 2021-07-29 08:27:59 +08:00
monitor1394
708b08e701 修复TextMeshPro Enable时找不到XCharts路径的问题 (#160) 2021-07-26 21:29: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
1148 changed files with 96310 additions and 1840519 deletions

13
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: ['https://github.com/XCharts-Team/XCharts/blob/master/Documentation~/zh/img/support_alipay.png','https://github.com/XCharts-Team/XCharts/blob/master/Documentation~/zh/img/support_wechat.png']

34
.gitignore vendored
View File

@@ -1,40 +1,6 @@
/.vs
/.vscode
.vs
/XCharts-ios
/Library
/Temp
/Logs
/UnityPackageManager
/Packages
/ProjectSettings/XRSettings.asset
/Assets/Res
/Assets/Res.meta
/Assets/Package
/Assets/Package.meta
/Doc/*.meta
/Assets/XCharts/*.meta
/Assets/XCharts/Runtime/Internal/*.meta
/Assets/XCharts/Runtime/Internal/Helper/*.meta
/Assets/XCharts/Runtime/Internal/Interface/*.meta
/Assets/XCharts/Runtime/Internal/Object/*.meta
/Assets/XCharts/Runtime/Internal/Pools/*.meta
/Assets/XCharts/Runtime/Internal/Utility/*.meta
/Assets/XCharts/Runtime/Helper/*.meta
/Assets/XCharts/Runtime/Component/*.meta
/Assets/XCharts/Runtime/Component/Sub/*.meta
/Assets/XCharts/Runtime/Component/Main/*.meta
/Assets/XCharts/Editor/PropertyDrawers/*.meta
/Assets/XCharts/Editor/Utility/*.meta
/Assets/XCharts/Editor/*.meta
/Assets/XCharts/Documentation/*.meta
/Assets/XCharts/Documentation/*.meta
/Assets/XChartsDemo/demo_test.unity
/Assets/XChartsDemo/demo_test.unity.meta
/Assets/XChartsDemo/empty.unity
/Assets/XChartsDemo/empty.unity.meta
*.sln
*.csproj

View File

@@ -1,10 +0,0 @@
fileFormatVersion: 2
guid: 3e77b3cfd5a4d2646964841d2b14dcb2
folderAsset: yes
timeCreated: 1536101212
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,275 +0,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/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md) to upgrade)
* (2020.08.15) Optimize `PieChart` drawing performance effect #85
* (2020.08.11) Added `LiquidChart` data change animation#83
* (2020.08.11) Optimize `PieChart` text stack and lead line effects#85
* (2020.08.08) Optimize `LineChart` the rendering performance of dense data
* (2020.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) Optimize `Chart` under `ScrollView` without affecting the scrolling and dragging of `ScrollView`.
* (2020.07.16) Fixed a problem with `Tooltip` that would also show up if it was blocked on top. #74
* (2020.07.08) 优化`Scatter`类型`Serie`支持`Log`#70
* (2020.07.07) 修复`SerieLabel`位置错乱的问题
* (2020.07.07) 增加`Tooltip``offset`参数配置偏移
* (2020.07.06) 增加`LiquidChart`水位图
* (2020.07.01) 增加`PolarChart`极坐标图表
* (2020.06.25) 发布`v1.5.2`版本
* (2020.06.25) 修复`BarChart`在数值为`0`时还会绘制一小部分柱条的问题
* (2020.06.24) 修复`PieChart`在设置`clockwise`后绘制异常的问题#65
* (2020.06.23) 优化`LineChart`在峰谷差异过大时的绘制效果#64
* (2020.06.18) 修复`SerieLabel`在重新添加数据时可能不显示的问题
* (2020.06.17) 增加`SerieData`可单独设置`SerieSymbol`#66
* (2020.06.17) 修复`Check For Update``Unity 2018`部分版本报错的问题#63
* (2020.06.16) 增加`Serie``avoidLabelOverlap`参数避免饼图标签堆叠的情况#56
* (2020.06.15) 修复`SerieLabel`单独控制显示时可能错乱的问题
* (2020.06.11) 修复`Check warning`不生效的问题
* (2020.06.11) 修复`PieChart``RingChart`在数据占比很小时不显示的问题
* (2020.06.11) 增加`Tooltip``titleFormatter`支持配置占位符`{i}`表示忽略不显示标题
* (2020.06.07) 增加`Animation``customFadeInDelay`等自定义数据项延时和时长回调函数#58
* (2020.06.07) 优化`PieChart`在数据全为`0`时的显示为等份的效果#59
* (2020.06.04) 增加`SerieLabel``autoOffset`参数设置是否自动判断上下偏移
* (2020.06.04) 增加`Tooltip``alwayShow`参数设置触发后一直显示
* (2020.06.04) 优化`Tooltip``formatter`支持`{.1}`通配符
* (2020.06.04) 优化`Legend`数量过多时自动换行显示#53
* (2020.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.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`参数后动画绘制异常的问题
* (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`
* (2020.03.14) 发布`v1.3.1`版本
* (2020.03.14) 修复`LineChart`开启`ingore`时部分数据可能绘制异常的问题
* (2020.03.13) 修复`LineChart``label`偏移显示异常的问题
* (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`的支持
* (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接口
* (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`等参数不生效的问题
* (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`两部分
* (2019.11.05) 发布`v1.0.4`版本
* (2019.11.05) 增加`Radar`雷达组件文本样式参数配置支持
* (2019.11.04) 修复`Unity2018.3`以下版本代码不兼容的问题
* (2019.11.04) 优化`SerieLabel`过多时引起的性能问题
* (2019.11.03) 发布`v1.0.3`版本
* (2019.11.03) 增加`Editor`快捷添加图表:`Hierarchy`试图下右键`XCharts->LineChart`
* (2019.11.02) 优化非配置参数变量命名和访问权限,简化`API`
* (2019.10.31) 发布`v1.0.2`版本
* (2019.10.31) 修复`prefab`预设制作报错的问题
* (2019.10.31) 增加访问主题组件API`BaseChart.themeInfo`
* (2019.10.26) 发布`v1.0.1`版本
* (2019.10.26) 修复版本检查功能在非运行时异常的问题
* (2019.10.26) 增加科学计数法显示数值的支持(查阅`forceENotation`参数)
* (2019.10.26) 增加`Axis`类目轴数据为空时的默认显示支持
* (2019.10.26) 增加`Axis`数值轴的最大最小值可设置为小数的支持,优化极小数图表的表现效果
* (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`中配置
* (2019.08.15) 发布`v0.8.3`版本
* (2019.08.14) 修复`PieChart``Label`无法自动更新的问题
* (2019.08.13) 修复`UpdateData`接口无法更新数据的问题
* (2019.08.07) 增加`SerieSymbol``Color``Opacity`配置
* (2019.08.07) 发布`v0.8.2`版本
* (2019.08.07) 修复区域平滑折线图显示异常的问题
* (2019.08.06) 修复`serie`系列数超过调色盘颜色数时获取的颜色异常的问题
* (2019.08.06) 修复当`Axis``minMaxType``Custom``max`设置为`100`不生效的问题
* (2019.08.04) 发布`v0.8.1`版本
* (2019.08.04) 修复从Inspector中修改数据不生效的问题
* (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) 增加`双坐标轴`支持,代码改动较大
* (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`三种默认主题
* (2018.09.05) 发布`v0.1.0`版本

View File

@@ -1,275 +0,0 @@
# 更新日志
* (2020.08.24) 发布`v1.6.0`版本
* (2020.08.23) 重构代码,将与绘制相关的`Color`改为`Color32`,减少隐式转换(更新后会导致自定义的颜色丢失,可参考[问答29](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)进行升级)
* (2020.08.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`极坐标图表
* (2020.06.25) 发布`v1.5.2`版本
* (2020.06.25) 修复`BarChart`在数值为`0`时还会绘制一小部分柱条的问题
* (2020.06.24) 修复`PieChart`在设置`clockwise`后绘制异常的问题#65
* (2020.06.23) 优化`LineChart`在峰谷差异过大时的绘制效果#64
* (2020.06.18) 修复`SerieLabel`在重新添加数据时可能不显示的问题
* (2020.06.17) 增加`SerieData`可单独设置`SerieSymbol`#66
* (2020.06.17) 修复`Check For Update``Unity 2018`部分版本报错的问题#63
* (2020.06.16) 增加`Serie``avoidLabelOverlap`参数避免饼图标签堆叠的情况#56
* (2020.06.15) 修复`SerieLabel`单独控制显示时可能错乱的问题
* (2020.06.11) 修复`Check warning`不生效的问题
* (2020.06.11) 修复`PieChart``RingChart`在数据占比很小时不显示的问题
* (2020.06.11) 增加`Tooltip``titleFormatter`支持配置占位符`{i}`表示忽略不显示标题
* (2020.06.07) 增加`Animation``customFadeInDelay`等自定义数据项延时和时长回调函数#58
* (2020.06.07) 优化`PieChart`在数据全为`0`时的显示为等份的效果#59
* (2020.06.04) 增加`SerieLabel``autoOffset`参数设置是否自动判断上下偏移
* (2020.06.04) 增加`Tooltip``alwayShow`参数设置触发后一直显示
* (2020.06.04) 优化`Tooltip``formatter`支持`{.1}`通配符
* (2020.06.04) 优化`Legend`数量过多时自动换行显示#53
* (2020.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.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`参数后动画绘制异常的问题
* (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`
* (2020.03.14) 发布`v1.3.1`版本
* (2020.03.14) 修复`LineChart`开启`ingore`时部分数据可能绘制异常的问题
* (2020.03.13) 修复`LineChart``label`偏移显示异常的问题
* (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`的支持
* (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接口
* (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`等参数不生效的问题
* (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`两部分
* (2019.11.05) 发布`v1.0.4`版本
* (2019.11.05) 增加`Radar`雷达组件文本样式参数配置支持
* (2019.11.04) 修复`Unity2018.3`以下版本代码不兼容的问题
* (2019.11.04) 优化`SerieLabel`过多时引起的性能问题
* (2019.11.03) 发布`v1.0.3`版本
* (2019.11.03) 增加`Editor`快捷添加图表:`Hierarchy`试图下右键`XCharts->LineChart`
* (2019.11.02) 优化非配置参数变量命名和访问权限,简化`API`
* (2019.10.31) 发布`v1.0.2`版本
* (2019.10.31) 修复`prefab`预设制作报错的问题
* (2019.10.31) 增加访问主题组件API`BaseChart.themeInfo`
* (2019.10.26) 发布`v1.0.1`版本
* (2019.10.26) 修复版本检查功能在非运行时异常的问题
* (2019.10.26) 增加科学计数法显示数值的支持(查阅`forceENotation`参数)
* (2019.10.26) 增加`Axis`类目轴数据为空时的默认显示支持
* (2019.10.26) 增加`Axis`数值轴的最大最小值可设置为小数的支持,优化极小数图表的表现效果
* (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`中配置
* (2019.08.15) 发布`v0.8.3`版本
* (2019.08.14) 修复`PieChart``Label`无法自动更新的问题
* (2019.08.13) 修复`UpdateData`接口无法更新数据的问题
* (2019.08.07) 增加`SerieSymbol``Color``Opacity`配置
* (2019.08.07) 发布`v0.8.2`版本
* (2019.08.07) 修复区域平滑折线图显示异常的问题
* (2019.08.06) 修复`serie`系列数超过调色盘颜色数时获取的颜色异常的问题
* (2019.08.06) 修复当`Axis``minMaxType``Custom``max`设置为`100`不生效的问题
* (2019.08.04) 发布`v0.8.1`版本
* (2019.08.04) 修复`Inspector`中修改数据不生效的问题
* (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) 增加`双坐标轴`支持,代码改动较大
* (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`三种默认主题
* (2018.09.05) 发布`v0.1.0`版本

View File

@@ -1,142 +0,0 @@
# XCharts API
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)
## `BaseChart`
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
* `BaseChart.series`:系列列表`Series`
* `BaseChart.chartName`:图表的别称。
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测。
* `BaseChart.onCustomDraw`:自定义绘制回调。
* `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`受上层布局控制时无法开启。
## `CoordinateChart`
* `CoordinateChart.grid`:网格组件 `Grid`
* `CoordinateChart.xAxises`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxises`:左右两个 `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.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.ClampInCoordinate(Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
## `LineChart`
* 继承 `BaseChart`
* 继承自 `CoordinateChart`
## `BarChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `PieChart`
* 继承自 `BaseChart`
## `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,972 +0,0 @@
# 配置项手册
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts问答](XCharts问答.md)
主组件:
* [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)
* [Settings 设置](#Settings)
* [Theme 主题](#Theme)
* [Tooltip 提示框](#Tooltip)
* [Vessel 容器](#Vessel)
* [Title 标题](#Title)
* [VisualMap 视觉映射](#VisualMap)
子组件:
* [AreaStyle 区域填充样式](#AreaStyle)
* [AxisLabel 坐标轴刻度标签](#AxisLabel)
* [AxisLine 坐标轴轴线](#AxisLine)
* [AxisName 坐标轴名称](#AxisName)
* [AxisSplitLine 坐标轴分割线条](#AxisSplitLine)
* [AxisSplitArea 坐标轴分割区域](#AxisSplitArea)
* [AxisTick 坐标轴刻度](#AxisTick)
* [Emphasis 高亮样式](#Emphasis)
* [ItemStyle 数据项样式](#ItemStyle)
* [LineArrow 折线图箭头](#LineArrow)
* [LineStyle 折线图样式](#LineStyle)
* [Location 位置](#Location)
* [SerieAnimation 动画](#SerieAnimation)
* [SerieData 数据项](#SerieData)
* [SerieLabel 图形上的文本标签](#SerieLabel)
* [SerieSymbol 图形标记](#SerieSymbol)
* [TextLimit 文本自适应](#TextLimit)
* [TextStyle 文本样式](#TextStyle)
## `Theme`
主题组件。主题用来配置图表的全局配色等其他参数。
相关参数:
* `theme`:内置主题类型。有`Default``Light``Dark`三种可选内置主题。
* `font`:所有文字的通用字体。
* `backgroundColor`:图表背景颜色。
* `titleTextColor`:主题的主标题文字颜色。
* `titleSubTextColor`:主题的副标题文字颜色。
* `legendTextColor`:图例的激活时文字颜色。
* `legendUnableColor`:图例的非激活时文字颜色。
* `axisTextColor`:坐标轴的文字颜色。
* `axisLineColor`:坐标轴的轴线颜色。
* `axisSplitLineColor`:坐标轴的分割线颜色,默认和轴线颜色一致。
* `tooltipBackgroundColor`:提示框的背景颜色。
* `tooltipFlagAreaColor`:提示框的阴影指示器的颜色。
* `tooltipTextColor`:提示框的文字颜色。
* `tooltipLabelColor`:提示框的十字指示器坐标轴标签的背景颜色。
* `tooltipLineColor`:提示框的指示线的颜色。
* `dataZoomTextColor`:区域缩放的文字颜色。
* `dataZoomLineColor`:区域缩放的线条颜色。
* `dataZoomSelectedColor`:区域缩放的选中区域颜色。
* `colorPalette`:调色盘颜色列表。如果系列没有设置颜色,则会依次循环从该列表中取颜色作为系列颜色。
相关接口:
* `GetColor(int index)`:获得调色盘对应系列索引的颜色值。
* `GetColorStr(int index)`:获得指定系列索引的十六进制颜色值字符串。
* `GetColor(string hexColorStr)`将字符串颜色值转成Color。
## `Title`
标题组件,包含主标题和副标题。
相关参数:
* `show`:是否显示标题组件。
* `text`:主标题文本,支持使用 `\n` 换行。
* `textStyle`:主标题文本样式 [TextStyle](#TextStyle)。
* `subText`:副标题文本,支持使用 `\n` 换行。
* `subTextStyle`:副标题文本样式 [TextStyle](#TextStyle)。
* `itemGap`:主副标题之间的间距。
* `location`:标题显示位置 [Location](#Location)。
## `TitleStyle`
标题样式。
* `show`:是否显示标题组件。
* `rotate`:旋转。
* `offset`:偏移。
* `color`:颜色。
* `fontSize`:字体大小。
* `fontStyle`:字体风格。
## `Legend`
图例组件。图例组件展现了不同系列的标记,颜色和名字。可以通过点击图例控制哪些系列不显示。
相关参数:
* `show`:是否显示图例组件。
* `selectedMode`:选择模式。控制是否可以通过点击图例改变系列的显示状态。默认开启图例选择,可以设成 `None` 关闭。有以下三种选择方式:
* `Multiple`:多选。
* `Single`:单选。
* `None`:无法选择。
* `orient`:布局方式是横还是竖。
* `Horizonal`:水平。
* `Vertical`:垂直。
* `location`:图例的显示位置 [Location](#Location)。
* `itemWidth`:图例标记的图形宽度。
* `itemHeight`:图例标记的图形高度。
* `itemGap`:图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。
* `itemAutoColor`:图例标记的图形是否自动匹配颜色。
* `formatter`:图例内容字符串模版格式器。支持用 `\n` 换行。模板变量为图例名称 `{name}`
* `data`:图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 `name`(如果是饼图,也可以是饼图单个数据的 `name`)。如果 `data` 没有被指定,会自动从当前系列中获取。指定 `data` 时里面的数据项和 `serie` 匹配时才会生效。
* `icons`:自定义的图例标记图形。
* `textStyle`:图例的内容文本样式 [TextStyle](#TextStyle)。
相关接口:
* `ClearData()`:清空数据。
* `ContainsData(string name)`:是否包括指定名字的图例。
* `RemoveData(string name)`:移除指定名字的图例。
* `AddData(string name)`:添加图例项。
* `GetData(int index)`:获得指定索引的图例。
* `GetIndex(string legendName)`:获得指定图例的索引。
## `Polar`
极坐标系组件。极坐标系,可以用于散点图和折线图。每个极坐标系拥有一个角度轴和一个半径轴。
相关参数:
* `show`:是否显示直角坐标系网格。
* `center`极坐标的中心点。数组的第一项是横坐标第二项是纵坐标。当值为0-1之间时表示百分比设置成百分比时第一项是相对于容器宽度第二项是相对于容器高度。
* `radius`:极坐标的半径。
* `backgroundColor`:极坐标的背景色,默认透明。
## `Radar`
* `shape`:雷达图绘制类型。
* `Polygon`:多边形。
* `Circle`:圆形。
* `positionType`:显示位置类型。
* `Vertice`:显示在顶点处。
* `Between`:显示在顶点之间。
* `radius`:雷达图的半径。
* `center`雷达图的中心点。数组的第一项是横坐标第二项是纵坐标。当值为0-1之间时表示百分比设置成百分比时第一项是相对于容器宽度第二项是相对于容器高度。
* `ceilRate`最大最小值向上取整的倍率。默认为0时自动计算。
* `splitNumber`:分割段数。默认为 `5`
* `isAxisTooltip`是否Tooltip显示轴线上的所有数据。只对Mutiple类型的Radar有效。
* `splitLine`:分割线条 [AxisSplitLine](#AxisSplitLine)。
* `splitArea`:分割区域 [AxisSplitArea](#AxisSplitArea)。
* `indicator`:是否显示指示器。
* `indicatorGap`:指示器和雷达的间距。
* `indicatorList`指示器列表 [Radar.Indicator](#Radar.Indicator)。
## `Radar.Indicator`
* `name`:指示器名称。
* `max`:指示器的最大值,默认为 0 无限制。
* `min`:指示器的最小值,默认为 0 无限制。
* `textStyle`:文本样式 [TextStyle](#TextStyle)。
## `TextLimit`
* `enable`:是否启用文本自适应。默认为`true`
* `maxWidth`:设定最大宽度。默认为`0`表示自动获取,否则表示自定义。当文本的宽度大于该值进行裁剪。
* `gap`:两边留白像素距离。默认为`10`
* `suffix` 长度超出被裁剪后附加的后缀。默认为`...`
## `TextStyle`
* `rotate`:旋转。
* `offset`:偏移。
* `color`:颜色。
* `backgroundColor`:背景颜色。
* `font`:字体。
* `fontSize`:字体大小。
* `fontStyle`:字体风格。
* `lineSpacing`:行间距。
## `Tooltip`
提示框组件。
相关参数:
* `show`:是否显示提示框组件。
* `type`:提示框指示器类型。指示器类型有:
* `Line`:线性指示器。
* `Shadow`:阴影指示器。
* `None`:无指示器。
* `Corss`:十字准星指示器。坐标轴显示`Label`和交叉线。
* `formatter`:提示框内容字符串模版格式器。支持用 `\n` 换行。当`formatter`不为空时,优先使用`formatter`,否则使用`itemFormatter`
* 模板变量有`{.}``{a}``{b}``{c}``{d}`
* `{.}`为当前所指示或`index``0``serie`的对应颜色的圆点。
* `{a}`为当前所指示或`index``0``serie`的系列名`name`
* `{b}`为当前所指示或`index``0``serie`的数据项`serieData``name`,或者类目值(如折线图的`X`轴)。
* `{c}`为当前所指示或`index``0``serie``y`维(`dimesion``1`)的数值。
* `{d}`为当前所指示或`index``0``serie``y`维(`dimesion``1`)百分比值,注意不带`%`号。
* `{.1}`表示指定`index``1``serie`对应颜色的圆点。
* `{a1}``{b1}``{c1}`中的`1`表示指定`index``1``serie`
* `{c1:2}`表示索引为`1``serie`的当前指示数据项的第`3`个数据一个数据项有多个数据index为`2`表示第`3`个数据)。
* `{c1:2-2}`表示索引为`1``serie`的第`3`个数据项的第`3`个数据(也就是要指定第几个数据项时必须要指定第几个数据)。
* `{d1:2:f2}`表示单独指定了数值的格式化字符串为`f2`(不指定时用`numericFormatter`)。
* 示例:`"{a}:{c}"``"{a1}:{c1:f1}"``"{a1}:{c1:1f1}"`
* `titleFormatter`:提示框标题内容的字符串模版格式器。支持用 `\n` 换行。仅当`itemFormatter`生效时才有效。可以单独设置占位符`{i}`表示忽略不显示标题内容。
* `itemFormatter`:提示框单个`serie`或数据项内容的字符串模版格式器。支持用 `\n` 换行。当`formatter`不为空时,优先使用`formatter`,否则使用`itemFormatter`
* `numericFormatter`:标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式:`A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `fixedWidth`:固定宽度。当同时设置 `fixedWidth``minWidth` 时,`fixedWidth``minWidth` 优先级高。
* `fixedHeight`:固定高度。当同时设置 `fixedHeight``minHeight` 时,`fixedHeight``minHeight` 优先级高。
* `minWidth`:最小宽度。当同时设置 `fixedWidth``minWidth` 时,`fixedWidth``minWidth` 优先级高。
* `minHeight`:最小高度。当同时设置 f`ixedHeight``minHeight` 时,`fixedHeight``minHeight` 优先级高。
* `paddingLeftRight`:文字和边框的左右边距。
* `paddingTopBottom`:文字和边框的上下边距。
* `backgroundImage`:提示框的背景图。
* `ignoreDataDefaultContent`:被忽略数据的默认显示字符信息。
* `alwayShow`:是否触发后一直显示。
* `offset``(since v1.5.3)`提示框相对于鼠标位置的偏移。
* `lineStyle`:指示器线条样式 [LineStyle](#LineStyle)。
* `textStyle`:显示内容文本样式 [TextStyle](#TextStyle)。
## `Vessel`
容器组件。一般用于LiquidChart。
相关参数:
* `show`:是否显示容器组件。
* `shape`:容器形状。
* `shapeWidth`:容器的厚度。
* `gap`:间隙。容器和液体的间隙。
* `center`中心点。数组的第一项是横坐标第二项是纵坐标。当值为0-1之间时表示百分比设置成百分比时表示图表宽高最小值的百分比。
* `radius`:半径。
* `smoothness`:开启或关闭缩放区域功能。
* `backgroundColor`:背景色,默认透明。
* `color`:容器颜色。当`autoColor``false`时生效。
* `autoColor`:是否自动颜色。默认`true`。为`true`时颜色会和`serie`一致。
## `DataZoom`
区域缩放组件。用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。
目前只支持控制 `X` 轴。
相关参数:
* `enable`:开启或关闭缩放区域功能。
* `supportInside`:是否支持内置缩放。内置于坐标系中,可在坐标系上通过鼠标拖拽、鼠标滚轮、手指滑动(触屏上)来缩放或漫游坐标系。
* `supportSlider`:是否支持滑动条缩放。有单独的滑动条,可在滑动条上进行缩放或漫游。
* ~~`filterMode`:数据过滤,暂未启用。支持以下几种类型:~~
* ~~`Filter`:当前数据窗口外的数据,被 过滤掉。即 会 影响其他轴的数据范围。每个数据项,只要有一个维度在数据窗口外,整个数据项就会被过滤掉。~~
* ~~`WeakFilter`:当前数据窗口外的数据,被 过滤掉。即 会 影响其他轴的数据范围。每个数据项,只有当全部维度都在数据窗口同侧外部,整个数据项才会被过滤掉。~~
* ~~`Empty`:当前数据窗口外的数据,被 设置为空。即 不会 影响其他轴的数据范围。~~
* ~~`None`:不过滤数据,只改变数轴范围。~~
* ~~`xAxisIndex`:控制哪一个 `x` 轴。~~
* ~~`yAxisIndex`:控制哪一个 `y` 轴。~~
* `showDataShadow`:是否显示数据阴影。数据阴影可以简单地反应数据走势。
* `showDetail`:是否显示 `detail`,即拖拽时候显示详细数值信息。
* `zoomLock`:是否锁定选择区域(或叫做数据窗口)的大小。如果设置为 `true` 则锁定选择区域的大小,也就是说,只能平移,不能缩放。
* ~~`realtime`:拖动时,是否实时更新系列的视图。如果设置为 `false`,则只在拖拽结束的时候更新。~~
* ~~`backgroundColor`:组件的背景颜色。~~
* `bottom`:组件离容器下侧的距离。
* `height`:组件高度。
* `rangeMode`:取值类型是取绝对值还是百分比。
* `Percent`:百分比。
* `start`数据窗口范围的起始百分比。范围是0 ~ 100。
* `end`数据窗口范围的结束百分比。范围是0 ~ 100。
* `scrollSensitivity`:缩放区域组件的敏感度。值越高每次缩放所代表的数据越多。
* `fontSize`:字体大小。
* `fontStyle`:字体样式。
* `minShowNum`最小显示数据个数。当DataZoom放大到最大时最小显示的数据个数。
## `VisualMap`
视觉映射组件。用于进行『视觉编码』,也就是将数据映射到视觉元素(视觉通道)。
* `enable`:开启或关闭视觉映射功能。
* `show`:是否显示组件。如果设置为 `false`,不会显示,但是数据映射的功能还存在。
* `type`:组件类型。支持以下类型:
* `Continuous`:连续型。
* ~~`Piecewise`:分段型。~~
* ~~`selectedMode`:分段型的选择模式,支持以下模式:~~
* ~~`Multiple`:多选。~~
* ~~`Single`:单选。~~
* `autoMinMax`:自动设置`min``max`的值。
* `min`:允许的最小值。`autoMinMax``false`时必须指定。`[min, max]` 形成了视觉映射的『定义域』。
* `max`:允许的最大值。`autoMinMax``false`时必须指定。`[min, max]` 形成了视觉映射的『定义域』。
* `range`指定手柄对应数值的位置。range 应在 min max 范围内。
* ~~`text`:两端的文本,如 ['High', 'Low']。~~
* ~~`textGap`两端文字主体之间的距离单位为px。~~
* `splitNumber`对于连续型数据自动平均切分成几段默认为0时自动匹配inRange颜色列表大小。
* `calculable`:是否显示拖拽用的手柄(手柄能拖拽调整选中范围)。
* ~~`realtime`:拖拽时,是否实时更新。~~
* `itemWidth`:图形的宽度,即颜色条的宽度。
* `itemHeight`:图形的高度,即颜色条的高度。
* `borderWidth`边框线宽单位px。
* `dimension`:指定用数据的『哪个维度』,映射到视觉元素上。『数据』即 series.data。从1开始默认为0取 data 中最后一个维度。
* `hoverLink`:打开 hoverLink 功能时,鼠标悬浮到 visualMap 组件上时,鼠标位置对应的数值 在 图表中对应的图形元素,会高亮。
* `orient`:布局方式是横还是竖。
* `location`:组件显示在图表中的位置。
* `inRange`:定义 在选中范围中 的视觉颜色。
* ~~`outOfRange`:定义 在选中范围外 的视觉颜色。~~
## `Grid`
网格组件。直角坐标系内绘图网格,单个 `grid` 内最多可以放置上下两个 `X` 轴,左右两个 `Y` 轴。可以在网格上绘制折线图,柱状图,散点图。目前最多只能存在一个 `grid` 组件。
相关参数:
* `show`:是否显示直角坐标系网格组件。
* `left`:组件离容器左侧的距离。
* `right`:组件离容器右侧的距离。
* `top`:组件离容器顶部的距离。
* `bottom`:组件离容器底部的距离。
* `backgroundColor`:背景颜色。
## `GaugeAxis`
仪表盘坐标轴。
* `axisLine`:坐标轴轴线样式。
* `splitLine`:坐标轴分割线样式。
* `axisTick`:坐标轴刻度样式。
* `axisLabel`:坐标轴刻度标签样式。
* `axisLabelText`:坐标轴刻度标签自定义内容。当内容为空时,`axisLabel`根据刻度自动显示内容,否则取自该列表定义的内容。
## `GaugePointer`
仪表盘指针。
* `width`:指针宽度。
* `length`:指针长度。当为`0-1`的浮点数时表示相对仪表盘半径的百分比。
## `XAxis`
直角坐标系 `grid` 中的 `X` 轴。单个 `grid` 组件最多只能放上下两个 `X` 轴。两个 `X` 轴存储在 `xAxises` 中。
相关参数:
* `show`:是否显示 `X` 轴。默认 `xAxises[0]``true``xAxises[1]``false`
* `type`:坐标轴类型。默认为 `Category`。支持以下类型:
* `Value`:数值轴,用于连续数据。
* `Category`:类目轴,适用于离散的类目数据,为该类型时必须通过 `data` 设置类目数据。
* `Log`:对数轴,适用于对数数据。
* `logBaseE`:对数轴是否以自然数 `e` 为底数,为 `true``logBase` 失效,只在对数轴(`type:'Log'`)中有效。
* `logBase`:对数轴的底数,只在对数轴(`type:'Log'`)中有效。
* `minMaxType`:坐标轴刻度最大最小值显示类型。默认为 `Default`。有以下三种类型:
* `Default`0-最大值。
* `MinMax`:最小值-最大值。
* `Custom`:自定义的最小值-最大值。
* `min`:设定的坐标轴刻度最小值,当 `minMaxType``Custom` 时有效。
* `max`:设定的坐标轴刻度最大值,当 `minMaxType``Custom` 时有效。
* `ceilRate`最大最小值向上取整的倍率。默认为0时自动计算。
* `splitNumber`:坐标轴的分割段数。默认为 `5`。当 `splitNumber` 设为 `0` 时,表示绘制所有的类目数据。
* `interval`:强制设置坐标轴分割间隔。无法在类目轴中使用。设置该值时 `splitNumber` 无效。
* `boundaryGap`:坐标轴两边是否留白。默认为 `true`
* `maxCache`:类目数据中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `inverse`:是否反向坐标轴。只在数值轴`Value`中有效。
* `data`:类目数据,在类目轴(`type: 'Category'`)中有效。
* `axisLine`:坐标轴轴线相关配置 [AxisLine](#AxisLine)。
* `axisName`:坐标轴名称相关配置 [AxisName](#AxisName)。
* `axisTick`:坐标轴刻度相关配置 [AxisTick](#AxisTick)。
* `axisLabel`:坐标轴刻度标签 [AxisLabel](#AxisLabel)。
* `splitLine`:坐标轴轴线坐标轴分割线 [AxisSplitLine](#SplitLine)。
* `splitArea`:坐标轴轴线坐标轴分割区域 [AxisSplitArea](#AxisSplitArea)。
相关接口:
* `ClearData()`:清空类目数据。
* `IsCategory()`:是否为类目轴。
* `IsValue()`:是否为数值轴。
* `AddData(string category, int maxDataNumber)`:添加一个类目到类目数据列表。
## `Background`
背景组件。
由于框架的局限性,背景组件使用有以下两个限制:
1`chart`的父节点不能有布局控制类组件。
2`chart`的父节点只能有当前`chart`一个子节点。
背景组件的开启需要通过接口来开启:`BaseChart.EnableBackground(bool flag)`
相关参数:
* `show`:是否显示启用背景组件。但能否激活背景组件还要受其他条件限制。
* `image`:背景图。
* `imageType`:背景图填充类型。
* `imageColor`背景图颜色。默认`white`
* `hideThemeBackgroundColor`:当背景组件启用时,是否隐藏主题中设置的背景色。
## `YAxis`
直角坐标系 `grid` 中的 `Y` 轴。单个 `grid` 组件最多只能放左右两个 `Y` 轴。两个 `Y` 轴存储在 `yAxises` 中。
相关参数:
* `show`:是否显示 `Y` 轴。默认 `yAxises[0]``true``yAxises[1]``false`
* `type`:坐标轴类型。默认为 `Value`。有以下两种类型:
* `Value`:数值轴,用于连续数据。
* `Category`:类目轴,适用于离散的类目数据,为该类型时必须通过 `data` 设置类目数据。
* `minMaxType`:坐标轴刻度最大最小值显示类型。默认为 `Default`。有以下三种类型:
* `Default`0-最大值。
* `MinMax`:最小值-最大值。
* `Custom`:自定义的最小值-最大值。
* `min`:设定的坐标轴刻度最小值,当 `minMaxType``Custom` 时有效。
* `max`:设定的坐标轴刻度最大值,当 `minMaxType``Custom` 时有效。
* `splitNumber`:坐标轴的分割段数。默认为 `5`
* `interval`:强制设置坐标轴分割间隔。无法在类目轴中使用。设置改值时 `splitNumber` 无效。
* `splitLineType`:分割线类型。默认为 `Dashed`。支持以下五种类型:
* `None`:不显示分割线。
* `Solid`:实线。
* `Dashed`:虚线。
* `Dotted`:点线。
* `DashDot`:点划线。
* `DashDotDot`:双点划线。
* `boundaryGap`:坐标轴两边是否留白。默认为 `false`
* `data`:类目数据,在类目轴(`type: 'Category'`)中有效。
* `axisLine`:坐标轴轴线相关配置 [AxisLine](#AxisLine)。
* `axisName`:坐标轴名称相关配置 [AxisName](#AxisName)。
* `axisTick`:坐标轴刻度相关配置 [AxisTick](#AxisTick)。
* `axisLabel`:坐标轴刻度标签 [AxisLabel](#AxisLabel)。
* `splitArea`:坐标轴轴线坐标轴分割区域 [SplitArea](#SplitArea)。
相关接口:
* `ClearData()`:清空类目数据。
* `IsCategory()`:是否为类目轴。
* `IsValue()`:是否为数值轴。
* `AddData(string category, int maxDataNumber)`:添加一个类目到类目数据列表。
## `Series`
系列列表。每个系列通过 type 决定自己的图表类型。
相关参数:
* `show`:系列是否显示在图表上。
* `type`:系列的图表类型。有以下几种类型:
* `Line`:折线图。
* `Bar`:柱状图。
* `Pie`:饼图。
* `Radar`:雷达图。
* `Scatter`:散点图。
* `EffectScatter`:带有涟漪特效动画的散点图。
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`:数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`:使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴轴的时候有用。
* `radarIndex`:雷达图所使用的 `radar` 组件的 `index`
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `sampleDist`采样的最小水平像素距离,默认为`0`时不采样。当两个数据点间的水平像素距离小于该值时,开启采样,保证两点间的水平像素距离不小于该值。
* `sampleType`:采样类型。当`sampleDist`大于`0`时有效。支持以下五种采样类型:
* `Peak`:取峰值。当过滤点的平均值大于等于`sampleAverage`时,取最大值;反之取最小值。
* `Average`:取过滤点的平均值。
* `Max`:取过滤点的最大值。
* `Min`:取过滤点的最小值。
* `Sum`:取过滤点之和。
* `sampleAverage`:设定的采样平均值。当 `sampleType``Peak` 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为`0`时会实时计算所有数据的平均值。
* `areaStyle`:区域填充样式 [AreaStyle](#AreaStyle)。
* `symbol`:标记的图形 [SerieSymbol](#SerieSymbol)。
* `lineType`:折线图样式类型。支持以下十种类型:
* `Normal`:普通折线图。
* `Smooth`:平滑曲线。
* `SmoothDash`:平滑虚线。
* `StepStart`:阶梯线图:当前点。
* `StepMiddle`:阶梯线图:当前点和下一个点的中间。
* `StepEnd`:阶梯线图:下一个拐点。
* `Dash`:虚线。
* `Dot`:点线。
* `DashDot`:点划线。
* `DashDotDot`:双点划线。
* `lineStyle`:线条样式 [LineStyle](#LineStyle)。
* `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` 时有效。
* `pieClickOffset`鼠标点击时是否开启偏移一般用在PieChart图表中。
* `pieRoseType`:是否展示成南丁格尔图,通过半径区分数据大小。
* `pieSpace`:饼图项间的空隙留白。
* `pieCenter`:饼图的中心点。
* `pieRadius`:饼图的半径。`radius[0]` 表示内径,`radius[1]` 表示外径。
* `roundCap`:启用圆弧效果。
* `label`:图形上的文本标签 [SerieLabel](#SerieLabel),可用于说明图形的一些数据信息,比如值,名称等。
* `emphasis`:高亮样式 [Emphasis](#Emphasis)。
* `animation`:起始动画 [SerieAnimation](#SerieAnimation)。
* `lineArrow`:折线图的箭头 [LineArrow](#LineArrow)。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Line`
折线图系列。
* `show`:系列是否显示在图表上。
* `type``Line`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`:数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`:使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴轴的时候有用。
* `minShow`:系列显示数据的最小索引。
* `maxShow`:系列显示数据的最大索引。
* `maxCache`:系列中可缓存的最大数据量。默认为`0`没有限制大于0时超过指定值会移除旧数据再插入新数据。
* `sampleDist`采样的最小水平像素距离,默认为`0`时不采样。当两个数据点间的水平像素距离小于该值时,开启采样,保证两点间的水平像素距离不小于该值。
* `sampleType`:采样类型。当`sampleDist`大于`0`时有效。支持以下五种采样类型:
* `Peak`:取峰值。当过滤点的平均值大于等于`sampleAverage`时,取最大值;反之取最小值。
* `Average`:取过滤点的平均值。
* `Max`:取过滤点的最大值。
* `Min`:取过滤点的最小值。
* `Sum`:取过滤点之和。
* `sampleAverage`:设定的采样平均值。当 `sampleType``Peak` 时,用于和过滤数据的平均值做对比是取最大值还是最小值。默认为`0`时会实时计算所有数据的平均值。
* `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)。
* `data`:系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Bar`
折线图系列。
* `show`:系列是否显示在图表上。
* `type``Bar`
* `name`:系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`:数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`:使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴轴的时候有用。
* `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时即为圆环图。
* `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`设置最大水位值。
## `Settings`
全局参数设置组件。一般情况下可使用默认值,当有需要时可进行调整。
* `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`:刻度标签是否朝内,默认朝外。
* `rotate`:刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。
* `margin`:刻度标签与轴线之间的距离。
* `color`:刻度标签文字的颜色,默认取主题`Theme``axisTextColor`
* `fontSize`:文字的字体大小。
* `fontStyle`:文字字体的风格。
* `formatter`:图例内容字符串模版格式器。支持用 `\n` 换行。模板变量为图例名称 `{value}`,数值格式化通过`numericFormatter`
* `numericFormatter`:标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式:`A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `showAsPositiveNumber`:将负数数值显示为正数。一般和`Serie``showAsPositiveNumber`配合使用。
* `onZero`:刻度标签显示在`0`刻度上。
* `textLimit`:文本自适应 [TextLimit](#TextLimit)。只在类目轴中有效。
## `AxisLine`
* `show`:是否显示坐标轴轴线。
* `onZero` `X` 轴或者 `Y` 轴的轴线是否在另一个轴的 `0` 刻度上,只有在另一个轴为数值轴且包含 `0` 刻度时有效。
* `width`:坐标轴线线宽。
* `symbol`:是否显示箭头。
* `symbolWidth`:箭头宽。
* `symbolHeight`:箭头高。
* `symbolOffset`:箭头偏移。
* `symbolDent`:箭头的凹陷程度。
## `AxisName`
* `show`:是否显示坐标名称。
* `name`:坐标轴名称。
* `location`:坐标轴名称的位置。支持以下类型:
* `Start`:坐标轴起始处。
* `Middle`:坐标轴中间。
* `End`:坐标轴末端。
* `offset`:坐标轴名称与轴线之间的偏移。
* `rotate`:坐标轴名字旋转,角度值。
* `color`:坐标轴名称的文字颜色。
* `fontSize`:坐标轴名称的文字大小。
* `fontStyle`:坐标轴名称的文字风格。
## `AxisSplitLine`
* `show`:是否显示坐标分割线。
* `interval`:分割线的显示间隔。`0` 表示显示所有分割线,`1` 表示隔一个隔显示一个分割线,以此类推。
* `lineStyle`:线条样式 [LineStyle](#LineStyle)。
## `AxisSplitArea`
* `show`:是否显示坐标分割区域。
* `color`:分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
## `AxisTick`
* `show`:是否显示坐标轴刻度。
* `alignWithLabel`:类目轴中在 `boundaryGap``true` 的时候有效,可以保证刻度线和标签对齐。
* `inside`:坐标轴刻度是否朝内,默认朝外。
* `length`:坐标轴刻度的长度。
* `width`坐标轴刻度的宽度。默认为0时宽度和坐标轴一致。
## `Emphasis`
* `show`:是否启用高亮样式。
* `label`:图形文本标签样式 [SerieLabel](#SerieLabel)。
* `itemStyle`:图形样式 [ItemStyle](#ItemStyle)。
## `ItemStyle`
* `show`:是否启用。
* `color`:颜色。
* `toColor`渐变颜色1。
* `toColor2`渐变颜色2。只在折线图中有效。
* `backgroundColor`:背景颜色。
* `backgroundWidth`:背景的宽。
* `centerColor`:中心区域的颜色。如环形图的中心区域。
* `centerGap`:中心区域的间隙。如环形图的中心区域于最内环的间隙。
* `borderType`:边框的类型。
* `borderColor`:边框的颜色。
* `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` 一致。
* `width`:线条宽。
* `opacity`:线条的透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
## `Location`
* `align`:对齐方式。有以下对齐方式。
* `TopLeft`:左上角对齐。
* `TopRight`:右上角对齐。
* `TopCenter`:置顶居中对齐。
* `BottomLeft`:左下对齐。
* `BottomRight`:右下对齐。
* `BottomCenter`:底部居中对齐。
* `Center`:居中对齐。
* `CenterLeft`:中部靠左对齐。
* `CenterRight`:中部靠右对齐。
* `left`:离容器左侧的距离。
* `right`:离容器右侧的距离。
* `top`:离容器上侧的距离。
* `bottom`:离容器下侧的距离。
## `SerieData`
* `name`:数据项名称。
* `selected`:该数据项是否被选中。
* `radius`:自定义半径。可用在饼图中自定义某个数据项的半径。
* `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的偏移会自动判断曲线的开口来决定向上还是向下偏移。
* `color`:自定义文字颜色,默认和系列的颜色一致。
* `backgroundColor`:标签的背景色,默认无颜色。
* `backgroundWidth`:标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
* `backgroundHeight`:标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
* `rotate`:标签的旋转。
* `paddingLeftRight`:标签文字和边框的左右边距。
* `paddingTopBottom`:标签文字和边框的上下边距。
* `fontSize`:标签文字的字体大小。
* `fontStyle`:标签文字的字体风格。
* `line`:是否显示视觉引导线。在 `label` 位置 设置为 `'Outside'` 的时候会显示视觉引导线。
* `lineType`:视觉引导线类型。支持以下几种类型:
* `BrokenLine`:折线。
* `Curves`:曲线。
* `HorizontalLine`:水平线。
* `lineColor`:视觉引导线自定义颜色。
* `lineWidth`:视觉引导线的宽度。
* `lineLength1`:视觉引导线第一段的长度。
* `lineLength2`:视觉引导线第二段的长度。
* `border`:是否显示边框。
* `borderWidth`:边框宽度。
* `borderColor`:边框颜色。
## `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`
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts问答](XCharts问答.md)

View File

@@ -1,167 +0,0 @@
# XCharts问答
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts配置项手册](XCharts配置项手册.md)
[QA 1如何调整坐标轴与背景的边距](#如何调整坐标轴与背景的边距)
[QA 2如何让初始动画重新播放](#如何让初始动画重新播放)
[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轴的值范围)
[QA 13如何自定义数值轴刻度大小](#如何自定义数值轴刻度大小)
[QA 14如何在数据项顶上显示文本](#如何在数据项顶上显示文本)
[QA 15如何给数据项自定义图标](#如何给数据项自定义图标)
[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版本后很多自定义颜色丢失了_应该如何升级)
## 如何调整坐标轴与背景的边距
答:`Grid`组件,可调整上下左右边距。
## 如何让初始动画重新播放
答:调用`AnimationReset()`接口。
## 如何自定义折线图_饼图等数据项的颜色
答:通过`Theme``colorPalette`调整,或者部分`Serie`下的`LineStyle``ItemStyle`
## 如何格式化文字_如我想给坐标轴标签加上单位
答:通过`formatter``numericFormatter`参数,在`Legend``Axis``AxisLabel``Tooltop``Serie``Label`都提供该参数的配置。
## 如何让柱形图的柱子堆叠显示
答:设置`Serie`下的`stack``stack`相同的`serie`会堆叠显示在一个柱子上。
## 如何让柱形图的柱子同柱但不重叠
答:设置`Serie`下的`barGap``-1``stack`为空。
## 如何调整柱形图的柱子宽度和间距
答:调整`Serie`下的`barWidth``barGap`,多个`serie`时最后一个`serie``barWidth``barGap`有效。
## 如何调整柱形图单个柱子的颜色
答:可通过调整单个`Data`下的`ItemStyle`调整,也可以通过两个`serie`同柱不堆叠来实现,通过设置数据项为`0`来达到类似效果。
## 如何调整图表的对齐方式
默认为左下角对齐暂不支持调整。可以通过包一层parent来辅助控制。最新版本`1.5.0`及以上已支持任意锚点可和做UI一样任意调整对其方式
## 可以显示超过1000以上的大数据吗
答:可以。但`UGUI`对单个`Graphic`限制`65000`个顶点,所以太多的数据不一定能显示完全。可通过设置采样距离`sampleDist`开启采样简化过密曲线。也可以通过设置一些参数来减少图表的顶点数有助于显示更多数据。如缩小图表的尺寸,关闭或减少坐标轴的客户端绘制,关闭`Serie``symbol``label`显示等。折线图的普通线图`Normal`比平滑线图`Smooth`占用顶点数更少。`1.5.0`以上版本可以设置`large``largeThreshold`参数来开启性能模式。
## 折线图可以画虚线_点线_点划线吗
答:可以。通过`Serie`下的`lineType`选择线条样式。当要显示的数据过多(成千以上)数据间过密时建议使用`Normal`或者`Step`样式。
## 如何限定Y轴的值范围
答:设置`Axis`下的`minMaxType``Custom`,自定义`min``max`
## 如何自定义数值轴刻度大小
答:默认时通过`Axis`下的`splitNumer`进行自动划分。也可以设置`interval`自定义刻度大小。
## 如何在数据项顶上显示文本
答:通过设置`Serie`下的`Label`
## 如何给数据项自定义图标
答:通过设置`Serie``data`下的数据项可单独设置`icon`相关参数。
## 锯齿太严重_如何让图表更顺滑
答:开启抗锯齿设置(在`Unity`里设置。调整UI渲染模式为`Camera`模式,开启`MSAA`,设置`4`倍或更高抗锯齿。锯齿只能减少难以避免,像素越高锯齿越不明显。
## 为什么鼠标移上图表Tooltip不显示
答:确认`Tooltip`是否开启。确认父节点是否关闭了鼠标事件。
## 如何取消Tooltip的竖线
答:设置`Tooltip``type``None`。或者调整`lineStyle`的参数。
## 如何自定义Tooltip的显示内容
答:自定义总的内容可以通过`Tooltip``formatter`。如果只是想调整所有的`serie`的显示格式可以用`itemFormatter``titleFormatter`结合。如果想每个`serie`的显示格式不一样,可以定制`serie``itemStyle`里的`tooltipFormatter`。具体的用法请查阅[XCharts配置项手册](XCharts配置项手册.md)。
## 如何让Y轴显示多位小数
答:设置`Axis`下的`AxisLabel`中的`formatter``{value:f1}``{value:f2}``1.5.0`及以上版本通过`numericFormatter`设置。
## 如何用代码动态更新数据
答:请查阅`Example`下的代码,`Example13_LineSimple.cs`就是一个简单添加数据构建折线图的例子,其他`Demo`也都是通过代码控制不同的组件实现不同的功能相关API请查看文档[XChartsAPI接口](XChartsAPI.md) 。
## 如何显示图例_为什么有时候图例无法显示
答:首先,你的`serie`里的`name`需有值不为空。然后开启`Legend`显示,里面的`data`可以默认为空,表示显示所有的图例。如果你只想显示部分`serie`的图例,在`data`中填入要显示的图例的`name`即可。如果`data`中的值都不是系列的`name`,那图例就不会显示。
## 如何做成预设
请删除chart下所有的子组件再拖成预设。
## 如何在图表上画点画线等自定义内容
答:`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/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)进行升级。
升级步骤如下:
1. 备份好你的项目。
2. 先不升级`XCharts`,只下载或拷贝脚本[UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs)放到旧项目的`Editor`由于旧版本可能不存在某些新版本才有的图表或者属性配置可能会编译错误需要处理按34步骤处理一下。
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)
[XCharts配置项手册](XCharts配置项手册.md)

View File

@@ -1,142 +0,0 @@
# XCharts API
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts配置项手册](XCharts配置项手册.md)
[XCharts问答](XCharts问答.md)
## `BaseChart`
* `BaseChart.themeInfo`:主题组件`ThemeInfo`
* `BaseChart.title`:标题组件`Title`
* `BaseChart.legend`:图例组件`Legend`
* `BaseChart.tooltip`:提示框组件`Tooltip`
* `BaseChart.series`:系列列表`Series`
* `BaseChart.chartName`:图表的别称。
* `BaseChart.chartWidth`:图表的宽。
* `BaseChart.chartHeight`:图表的高。
* `BaseChart.forceOpenRaycastTarget`:强制开启鼠标事件检测。一般不用手动设置,内部会自动判断是否需要检测。
* `BaseChart.onCustomDraw`:自定义绘制回调。
* `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`受上层布局控制时无法开启。
## `CoordinateChart`
* `CoordinateChart.grid`:网格组件 `Grid`
* `CoordinateChart.xAxises`:左右两个 `X` 轴组件 `XAxis`
* `CoordinateChart.yAxises`:左右两个 `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.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.ClampInCoordinate(Vector3 pos)`:将坐标限制在坐标系内。
* `CoordinateChart.CovertXYAxis(int index)`转换X轴和Y轴的配置。
* `CoordinateChart.UpdateCoordinate()`:更新坐标系原点和宽高。一般内部会自动更新,也可强制更新。
* `CoordinateChart.SetMaxCache(int maxCache)`:设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
## `LineChart`
* 继承 `BaseChart`
* 继承自 `CoordinateChart`
## `BarChart`
* 继承自 `BaseChart`
* 继承自 `CoordinateChart`
## `PieChart`
* 继承自 `BaseChart`
## `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,865 +0,0 @@
# 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)
* [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)
* [SerieAnimation](#SerieAnimation)
* [SerieData](#SerieData)
* [SerieLabel](#SerieLabel)
* [SerieSymbol](#SerieSymbol)
* [TextLimit](#TextLimit)
* [TextStyle](#TextStyle)
## `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.
* `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 text style of legend content [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].
* `splitNumber`: Tooltip displays all the data on the axis.[default:false].
* `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.
* `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`].
## `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.
* `{.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.
* `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`]
## `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.~~
* `bottom`: Distance between dataZoom component and the bottom side of the container. bottom value is a instant pixel value like 10. [default: `10f`]
* `height`: The height of dataZoom component. height value is a instant pixel value like 10. [default: `50f`]
* `rangeMode`: Use absolute value or percent value in `DataZoom.start` and `DataZoom.end`. [default: `RangeMode.Percent`].
* `Percent`: percent.
* `start`: The start percentage of the window out of the data extent, in the range of `0 ~ 100`. [default: `30f`]
* `end`: The end percentage of the window out of the data extent, in the range of 0 ~ 100. [default: `70f`]
* `scrollSensitivity`: The sensitivity of dataZoom scroll. The larger the number, the more sensitive it is. [default: `10f`]
* `fontSize`: font size of datazoom label.
* `fontStyle`: font style of datazoom label.
* `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 `xAxises[0]` is `true` and `xAxises[1]` is `false`.
* `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.
* `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.
* `data`: Category data, valid in the `Category` axis.
* `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).
## `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.
* `axisIndex`: Index of axis to combine with, which is useful for multiple x 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)。
* `data`: 系列中的数据项 [SerieData](#SerieData) 数组,可以设置`1``n`维数据。
## `Serie-Bar`
折线图系列。
* `show`: 系列是否显示在图表上。
* `type`: `Bar`
* `name`: 系列名称。用于 `tooltip` 的显示,`legend` 的图例筛选。
* `stack`: 数据堆叠。同个类目轴上系列配置相同的 `stack` 值后,后一个系列的值会在前一个系列的值上相加。
* `axisIndex`: 使用的坐标轴轴的 `index`,在单个图表实例中存在多个坐标轴轴的时候有用。
* `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时即为圆环图。
* `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`设置最大水位值。
## `Settings`
全局参数设置组件。一般情况下可使用默认值,当有需要时可进行调整。
* `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`: 刻度标签是否朝内,默认朝外。
* `rotate`: 刻度标签旋转的角度,在类目轴的类目标签显示不下的时候可以通过旋转防止标签之间重叠。
* `margin`: 刻度标签与轴线之间的距离。
* `color`: 刻度标签文字的颜色,默认取主题`Theme``axisTextColor`
* `fontSize`: 文字的字体大小。
* `fontStyle`: 文字字体的风格。
* `formatter`: 图例内容字符串模版格式器。支持用 `\n` 换行。模板变量为图例名称 `{value}`,数值格式化通过`numericFormatter`
* `numericFormatter`: 标准数字格式字符串。用于将数值格式化显示为字符串。使用`Axx`的形式: `A`是格式说明符的单字符,支持`C`货币、`D`十进制、`E`指数、`F`顶点数、`G`常规、`N`数字、`P`百分比、`R`往返过程、`X`十六进制等九种。`xx`是精度说明,从`0`-`99`
* `showAsPositiveNumber`: 将负数数值显示为正数。一般和`Serie``showAsPositiveNumber`配合使用。
* `onZero`: 刻度标签显示在`0`刻度上。
* `textLimit`: 文本自适应 [TextLimit](#TextLimit)。只在类目轴中有效。
## `AxisLine`
* `show`: 是否显示坐标轴轴线。
* `onZero`: `X` 轴或者 `Y` 轴的轴线是否在另一个轴的 `0` 刻度上,只有在另一个轴为数值轴且包含 `0` 刻度时有效。
* `width`: 坐标轴线线宽。
* `symbol`: 是否显示箭头。
* `symbolWidth`: 箭头宽。
* `symbolHeight`: 箭头高。
* `symbolOffset`: 箭头偏移。
* `symbolDent`: 箭头的凹陷程度。
## `AxisName`
* `show`: 是否显示坐标名称。
* `name`: 坐标轴名称。
* `location`: 坐标轴名称的位置。支持以下类型:
* `Start`: 坐标轴起始处。
* `Middle`: 坐标轴中间。
* `End`: 坐标轴末端。
* `offset`: 坐标轴名称与轴线之间的偏移。
* `rotate`: 坐标轴名字旋转,角度值。
* `color`: 坐标轴名称的文字颜色。
* `fontSize`: 坐标轴名称的文字大小。
* `fontStyle`: 坐标轴名称的文字风格。
## `AxisSplitLine`
* `show`: 是否显示坐标分割线。
* `interval`: 分割线的显示间隔。`0` 表示显示所有分割线,`1` 表示隔一个隔显示一个分割线,以此类推。
* `lineStyle`: 线条样式 [LineStyle](#LineStyle)。
## `AxisSplitArea`
* `show`: 是否显示坐标分割区域。
* `color`: 分隔区域颜色。分隔区域会按数组中颜色的顺序依次循环设置颜色。默认是一个深浅的间隔色。
## `AxisTick`
* `show`: 是否显示坐标轴刻度。
* `alignWithLabel`: 类目轴中在 `boundaryGap``true` 的时候有效,可以保证刻度线和标签对齐。
* `inside`: 坐标轴刻度是否朝内,默认朝外。
* `length`: 坐标轴刻度的长度。
* `width`: 坐标轴刻度的宽度。默认为0时宽度和坐标轴一致。
## `Emphasis`
* `show`: 是否启用高亮样式。
* `label`: 图形文本标签样式 [SerieLabel](#SerieLabel)。
* `itemStyle`: 图形样式 [ItemStyle](#ItemStyle)。
## `ItemStyle`
* `show`: 是否启用。
* `color`: 颜色。
* `toColor`gradient color1.
* `toColor2`gradient color2.
* `backgroundColor`: 背景颜色。
* `backgroundWidth`: 背景的宽。
* `centerColor`: 中心区域的颜色。如环形图的中心区域。
* `centerGap`: 中心区域的间隙。如环形图的中心区域于最内环的间隙。
* `borderType`: 边框的类型。
* `borderColor`: 边框的颜色。
* `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` 一致。
* `width`: 线条宽。
* `opacity`: 线条的透明度。支持从 `0``1` 的数字,为 `0` 时不绘制该图形。
## `Location`
* `align`: 对齐方式。有以下对齐方式。
* `TopLeft`: 左上角对齐。
* `TopRight`: 右上角对齐。
* `TopCenter`: 置顶居中对齐。
* `BottomLeft`: 左下对齐。
* `BottomRight`: 右下对齐。
* `BottomCenter`: 底部居中对齐。
* `Center`: 居中对齐。
* `CenterLeft`: 中部靠左对齐。
* `CenterRight`: 中部靠右对齐。
* `left`: 离容器左侧的距离。
* `right`: 离容器右侧的距离。
* `top`: 离容器上侧的距离。
* `bottom`: 离容器下侧的距离。
## `SerieData`
* `name`: 数据项名称。
* `selected`: 该数据项是否被选中。
* `radius`: 自定义半径。可用在饼图中自定义某个数据项的半径。
* `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的偏移会自动判断曲线的开口来决定向上还是向下偏移。
* `color`: 自定义文字颜色,默认和系列的颜色一致。
* `backgroundColor`: 标签的背景色,默认无颜色。
* `backgroundWidth`: 标签的背景宽度。一般不用指定,不指定时则自动是文字的宽度。
* `backgroundHeight`: 标签的背景高度。一般不用指定,不指定时则自动是文字的高度。
* `rotate`: 标签的旋转。
* `paddingLeftRight`: 标签文字和边框的左右边距。
* `paddingTopBottom`: 标签文字和边框的上下边距。
* `fontSize`: 标签文字的字体大小。
* `fontStyle`: 标签文字的字体风格。
* `line`: 是否显示视觉引导线。在 `label` 位置 设置为 `'Outside'` 的时候会显示视觉引导线。
* `lineType`: 视觉引导线类型。支持以下几种类型:
* `BrokenLine`: 折线。
* `Curves`: 曲线。
* `HorizontalLine`: 水平线。
* `lineColor`: 视觉引导线自定义颜色。
* `lineWidth`: 视觉引导线的宽度。
* `lineLength1`: 视觉引导线第一段的长度。
* `lineLength2`: 视觉引导线第二段的长度。
* `border`: 是否显示边框。
* `borderWidth`: 边框宽度。
* `borderColor`: 边框颜色。
## `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`
[返回首页](https://github.com/monitor1394/unity-ugui-XCharts)
[XChartsAPI接口](XChartsAPI.md)
[XCharts问答](XCharts问答.md)

View File

@@ -1,161 +0,0 @@
# 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 does not necessarily activate the background component. Due to the limitations of the XCharts's framework, there are two prerequisites for the background component: first, the parent node of the chart cannot be controlled by layout, because the node relationship between the background component and the chart is parallel, and the location of the background component cannot be controlled by layout. Second, the parent node of the chart can only have one child node of the chart itself, which is convenient to manage the background component node needs, otherwise the reason of parallel relationship, easy to confuse. In addition, it is best to hide the `background` component when adjusting the chart hierarchy, which automatically removes the associated background component nodes.
## 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/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) to upgrade.
The upgrade steps are as follows:
1. Back up the project.
2. Download or copy the script [UpgradeChartColor.cs](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Editor/Tools/UpgradeChartColor.cs) in the old project `Editor`, Change the `color` field inside to `color.clear` (because some fields may not exist in the old version).
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,34 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI BarChart.
/// </summary>
[CustomEditor(typeof(BarChart), false)]
public class BarChartEditor : CoordinateChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
m_Target = (BarChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
if (m_Target == null && target == null)
{
return;
}
}
}
}

View File

@@ -1,162 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
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;
protected SerializedProperty m_Script;
protected SerializedProperty m_ChartWidth;
protected SerializedProperty m_ChartHeight;
protected SerializedProperty m_Theme;
protected SerializedProperty m_ThemeInfo;
protected SerializedProperty m_Background;
protected SerializedProperty m_Title;
protected SerializedProperty m_Legend;
protected SerializedProperty m_Tooltip;
protected SerializedProperty m_Series;
protected SerializedProperty m_Settings;
protected SerializedProperty m_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();
protected virtual void OnEnable()
{
m_Target = (BaseChart)target;
m_Script = serializedObject.FindProperty("m_Script");
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_Background = serializedObject.FindProperty("m_Background");
m_Title = serializedObject.FindProperty("m_Title");
m_Legend = serializedObject.FindProperty("m_Legend");
m_Tooltip = serializedObject.FindProperty("m_Tooltip");
m_Series = serializedObject.FindProperty("m_Series");
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)
{
base.OnInspectorGUI();
return;
}
serializedObject.Update();
m_DefaultLabelWidth = EditorGUIUtility.labelWidth;
m_DefaultFieldWidth = EditorGUIUtility.fieldWidth;
OnStartInspectorGUI();
OnMiddleInspectorGUI();
OnEndInspectorGUI();
CheckWarning();
serializedObject.ApplyModifiedProperties();
}
protected virtual void OnStartInspectorGUI()
{
EditorGUILayout.PropertyField(m_Script);
EditorGUILayout.PropertyField(m_ChartName);
EditorGUILayout.PropertyField(m_ThemeInfo, true);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_Background, true);
var m_Show = m_Background.FindPropertyRelative("m_Show");
if (m_Show.boolValue && !m_Target.CanShowBackgroundComponent())
{
var msg = "The background component cannot be activated because chart is controlled by LayoutGroup,"
+ " or its parent have more than one child.";
EditorGUILayout.HelpBox(msg, MessageType.Error);
}
EditorGUILayout.PropertyField(m_Title, true);
EditorGUILayout.PropertyField(m_Legend, true);
EditorGUILayout.PropertyField(m_Tooltip, true);
}
protected virtual void OnMiddleInspectorGUI()
{
EditorGUILayout.PropertyField(m_Series, true);
EditorGUILayout.PropertyField(m_Settings, true);
}
protected virtual void OnEndInspectorGUI()
{
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_DebugMode);
}
private void CheckWarning()
{
if (GUILayout.Button("Check XCharts Update "))
{
CheckVersionEditor.ShowWindow();
}
if (m_CheckWarning)
{
EditorGUILayout.BeginHorizontal();
if (GUILayout.Button("Check Warning"))
{
m_CheckWarning = true;
m_Target.CheckWarning();
}
if (GUILayout.Button("Hide Warning"))
{
m_CheckWarning = false;
}
EditorGUILayout.EndHorizontal();
sb.Length = 0;
sb.AppendFormat("version:{0}", XChartsMgr.Instance.nowVersion);
if (!string.IsNullOrEmpty(m_Target.warningInfo))
{
sb.AppendLine();
sb.Append(m_Target.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_Target.CheckWarning();
}
}
EditorGUILayout.Space();
EditorGUILayout.Space();
}
}
}

View File

@@ -1,108 +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("XCharts/Check For Update")]
public 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();
}
void OnInspectorUpdate()
{
Repaint();
}
private void OnGUI()
{
var mgr = XChartsMgr.Instance;
GUILayout.Label("");
GUILayout.Label("当前版本:" + mgr.nowVersion);
if (mgr.needUpdate && !mgr.isCheck)
{
GUILayout.Label("最新版本:" + mgr.newVersion);
GUILayout.Label("");
if (mgr.isCheck) GUILayout.Label("检测中...");
else if (mgr.isNetworkError) GUILayout.Label("检测失败:" + mgr.networkError);
else
{
GUILayout.Label("有更新!");
}
GUILayout.Label("");
if (!string.IsNullOrEmpty(mgr.desc))
{
GUILayout.Label(mgr.desc);
}
if (GUILayout.Button("去Github主页"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts");
}
if (GUILayout.Button("点Star支持"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/stargazers");
}
if (GUILayout.Button("问题反馈"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/issues");
}
if (!string.IsNullOrEmpty(mgr.changeLog))
{
scrollPos = GUILayout.BeginScrollView(scrollPos);
GUILayout.TextArea(mgr.changeLog);
GUILayout.EndScrollView();
}
}
else
{
if (mgr.isCheck) GUILayout.Label("最新版本:检测中...");
else if (mgr.isNetworkError) GUILayout.Label("检测失败:" + mgr.networkError);
else GUILayout.Label("最新版本:" + mgr.newVersion);
GUILayout.Label("");
if (!mgr.isNetworkError && !mgr.needUpdate && !mgr.isCheck)
{
GUILayout.Label("已是最新版本!");
}
GUILayout.Label("");
if (!string.IsNullOrEmpty(mgr.desc))
{
GUILayout.Label(mgr.desc);
}
if (GUILayout.Button("去Github主页"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts");
}
if (GUILayout.Button("点Star支持"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/stargazers");
}
if (GUILayout.Button("问题反馈"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/issues");
}
if (mgr.isNetworkError && GUILayout.Button("重新检测"))
{
XChartsMgr.Instance.CheckVersion();
}
}
}
}
}

View File

@@ -1,77 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 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_MultipleXAxis;
protected SerializedProperty m_XAxises;
protected SerializedProperty m_MultipleYAxis;
protected SerializedProperty m_YAxises;
protected SerializedProperty m_DataZoom;
protected SerializedProperty m_VisualMap;
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");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
if (m_Target is LineChart || m_Target is BarChart)
{
EditorGUILayout.PropertyField(m_DataZoom);
}
if (m_Target is HeatmapChart || m_Target is LineChart)
{
EditorGUILayout.PropertyField(m_VisualMap);
}
EditorGUILayout.PropertyField(m_Grid);
for (int i = 0; i < m_XAxises.arraySize; i++)
{
SerializedProperty axis = m_XAxises.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(axis);
}
for (int i = 0; i < m_YAxises.arraySize; i++)
{
SerializedProperty axis = m_YAxises.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(axis);
}
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
CovertXYAxis();
}
private void CovertXYAxis()
{
if (GUILayout.Button("Covert XY Axis"))
{
(m_Target as CoordinateChart).CovertXYAxis(0);
}
}
}
}

View File

@@ -1,33 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 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 SerializedProperty m_Radar;
protected SerializedProperty m_Radars;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (GaugeChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
}
}
}

View File

@@ -1,30 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
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();
}
}
}

View File

@@ -1,25 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
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;
}
}
}

View File

@@ -1,34 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI LiquidChart.
/// </summary>
[CustomEditor(typeof(LiquidChart), false)]
public class LiquidChartEditor : BaseChartEditor
{
protected SerializedProperty m_Vessels;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (LiquidChart)target;
m_Vessels = serializedObject.FindProperty("m_Vessels");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
EditorGUILayout.PropertyField(m_Vessels, true);
}
}
}

View File

@@ -1,32 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
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();
}
}
}

View File

@@ -1,40 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 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_Polar;
protected SerializedProperty m_RadiusAxis;
protected SerializedProperty m_AngleAxis;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (PolarChart)target;
m_Polar = serializedObject.FindProperty("m_Polar");
m_RadiusAxis = serializedObject.FindProperty("m_RadiusAxis");
m_AngleAxis = serializedObject.FindProperty("m_AngleAxis");
}
protected override void OnStartInspectorGUI()
{
base.OnStartInspectorGUI();
EditorGUILayout.PropertyField(m_Polar, true);
EditorGUILayout.PropertyField(m_RadiusAxis, true);
EditorGUILayout.PropertyField(m_AngleAxis, true);
}
}
}

View File

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

View File

@@ -1,83 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(SerieAnimation), true)]
public class AnimationDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AnimationModuleToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Enable = prop.FindPropertyRelative("m_Enable");
//SerializedProperty m_Easting = prop.FindPropertyRelative("m_Easting");
SerializedProperty m_FadeInDuration = prop.FindPropertyRelative("m_FadeInDuration");
SerializedProperty m_FadeOutDuration = prop.FindPropertyRelative("m_FadeOutDuration");
SerializedProperty m_DataChangeEnable = prop.FindPropertyRelative("m_DataChangeEnable");
SerializedProperty m_DataChangeDuration = prop.FindPropertyRelative("m_DataChangeDuration");
SerializedProperty m_FadeInDelay = prop.FindPropertyRelative("m_FadeInDelay");
//SerializedProperty m_Threshold = prop.FindPropertyRelative("m_Threshold");
SerializedProperty m_ActualDuration = prop.FindPropertyRelative("m_ActualDuration");
SerializedProperty m_FadeOutDelay = prop.FindPropertyRelative("m_FadeOutDelay");
// SerializedProperty m_CurrDetailProgress = prop.FindPropertyRelative("m_CurrDetailProgress");
// SerializedProperty m_DestDetailProgress = prop.FindPropertyRelative("m_DestDetailProgress");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AnimationModuleToggle, prop, null, m_Enable, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AnimationModuleToggle, prop))
{
++EditorGUI.indentLevel;
//EditorGUI.PropertyField(drawRect, m_Easting);
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, m_Threshold);
// if (m_Threshold.intValue < 0) m_Threshold.intValue = 0;
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeInDelay);
if (m_FadeInDelay.floatValue < 0) m_FadeInDelay.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeInDuration);
if (m_FadeInDuration.floatValue < 0) m_FadeInDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeOutDelay);
if (m_FadeOutDelay.floatValue < 0) m_FadeOutDelay.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FadeOutDuration);
if (m_FadeOutDuration.floatValue < 0) m_FadeOutDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_DataChangeEnable);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_DataChangeDuration);
if (m_DataChangeDuration.floatValue < 0) m_DataChangeDuration.floatValue = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.LabelField(drawRect, "CurrDetailProgress:" + m_CurrDetailProgress.floatValue);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.LabelField(drawRect, "DestDetailProgress:" + m_DestDetailProgress.floatValue);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.LabelField(drawRect, "Actual duration:" + m_ActualDuration.floatValue + " ms");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--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 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(AreaStyle), true)]
public class AreaStyleDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_AreaStyleToggle = 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_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))
{
++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;
--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,229 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Axis), true)]
public class AxisDrawer : PropertyDrawer
{
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 void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_LogBaseE = prop.FindPropertyRelative("m_LogBaseE");
SerializedProperty m_LogBase = prop.FindPropertyRelative("m_LogBase");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Interval = prop.FindPropertyRelative("m_Interval");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_BoundaryGap = prop.FindPropertyRelative("m_BoundaryGap");
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
SerializedProperty m_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_AxisName = prop.FindPropertyRelative("m_AxisName");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_CeilRate = prop.FindPropertyRelative("m_CeilRate");
SerializedProperty m_Inverse = prop.FindPropertyRelative("m_Inverse");
int index = InitToggle(prop);
bool toggle = m_AxisModuleToggle[index];
m_AxisModuleToggle[index] = ChartEditorHelper.MakeFoldout(ref drawRect, ref toggle,
GetDisplayName(prop.displayName), m_Show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_AxisModuleToggle[index])
{
Axis.AxisType type = (Axis.AxisType)m_Type.enumValueIndex;
EditorGUI.indentLevel++;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (type == Axis.AxisType.Log)
{
EditorGUI.PropertyField(drawRect, m_LogBaseE);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LogBase);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
if (type == Axis.AxisType.Value)
{
EditorGUI.PropertyField(drawRect, m_MinMaxType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
Axis.AxisMinMaxType minMaxType = (Axis.AxisMinMaxType)m_MinMaxType.enumValueIndex;
switch (minMaxType)
{
case Axis.AxisMinMaxType.Default:
break;
case Axis.AxisMinMaxType.MinMax:
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;
EditorGUI.indentLevel--;
break;
}
EditorGUI.PropertyField(drawRect, m_CeilRate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Inverse);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Interval);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BoundaryGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
DrawExtended(ref drawRect, prop);
EditorGUI.PropertyField(drawRect, m_AxisLine);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLine);
EditorGUI.PropertyField(drawRect, m_AxisName);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisName);
EditorGUI.PropertyField(drawRect, m_AxisTick);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisTick);
EditorGUI.PropertyField(drawRect, m_AxisLabel);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLabel);
EditorGUI.PropertyField(drawRect, m_SplitLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
EditorGUI.PropertyField(drawRect, m_SplitArea);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitArea);
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);
}
}
EditorGUI.indentLevel--;
}
}
protected virtual void DrawExtended(ref Rect drawRect, SerializedProperty prop)
{
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
int index = InitToggle(prop);
if (!m_AxisModuleToggle[index])
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
SerializedProperty m_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_AxisName = prop.FindPropertyRelative("m_AxisName");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_SplitArea = prop.FindPropertyRelative("m_SplitArea");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
float height = 0;
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
Axis.AxisType type = (Axis.AxisType)m_Type.enumValueIndex;
if (type == Axis.AxisType.Category)
{
if (m_DataFoldout[index])
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
int num = m_Data.arraySize + 2;
if (num > 30) num = 14;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing;
}
}
else if (type == Axis.AxisType.Value)
{
height += 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
if (m_MinMaxType.enumValueIndex == (int)Axis.AxisMinMaxType.Custom)
{
height += EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing;
}
}
else if (type == Axis.AxisType.Log)
{
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
SerializedProperty m_MinMaxType = prop.FindPropertyRelative("m_MinMaxType");
if (m_MinMaxType.enumValueIndex == (int)Axis.AxisMinMaxType.Custom)
{
height += EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing;
}
}
height += EditorGUI.GetPropertyHeight(m_AxisName);
height += EditorGUI.GetPropertyHeight(m_AxisLine);
height += EditorGUI.GetPropertyHeight(m_AxisTick);
height += EditorGUI.GetPropertyHeight(m_AxisLabel);
height += EditorGUI.GetPropertyHeight(m_SplitArea);
height += EditorGUI.GetPropertyHeight(m_SplitLine);
height += GetExtendedHeight();
return height;
}
}
protected virtual float GetExtendedHeight()
{
return 0;
}
private int InitToggle(SerializedProperty prop)
{
int index = 0;
int.TryParse(prop.displayName.Split(' ')[1], out index);
if (index >= m_DataFoldout.Count)
{
m_DataFoldout.Add(false);
}
if (index >= m_AxisModuleToggle.Count)
{
m_AxisModuleToggle.Add(false);
}
return index;
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,106 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(DataZoom), true)]
public class DataZoomDrawer : PropertyDrawer
{
private bool m_DataZoomModuleToggle = false;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Enable");
//SerializedProperty m_FilterMode = prop.FindPropertyRelative("m_FilterMode");
//SerializedProperty m_Orient = prop.FindPropertyRelative("m_Orient");
SerializedProperty m_SupportInside = prop.FindPropertyRelative("m_SupportInside");
SerializedProperty m_SupportSlider = prop.FindPropertyRelative("m_SupportSlider");
//SerializedProperty m_SupportSelect = prop.FindPropertyRelative("m_SupportSelect");
SerializedProperty m_ShowDataShadow = prop.FindPropertyRelative("m_ShowDataShadow");
SerializedProperty m_ShowDetail = prop.FindPropertyRelative("m_ShowDetail");
SerializedProperty m_ZoomLock = prop.FindPropertyRelative("m_ZoomLock");
// SerializedProperty m_Realtime = prop.FindPropertyRelative("m_Realtime");
// SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_Height = prop.FindPropertyRelative("m_Height");
SerializedProperty m_Bottom = prop.FindPropertyRelative("m_Bottom");
SerializedProperty m_RangeMode = prop.FindPropertyRelative("m_RangeMode");
SerializedProperty m_Start = prop.FindPropertyRelative("m_Start");
SerializedProperty m_End = prop.FindPropertyRelative("m_End");
SerializedProperty m_MinShowNum = prop.FindPropertyRelative("m_MinShowNum");
SerializedProperty m_ScrollSensitivity = prop.FindPropertyRelative("m_ScrollSensitivity");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_DataZoomModuleToggle, "DataZoom", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_DataZoomModuleToggle)
{
++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)
{
++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;
}
//EditorGUI.PropertyField(drawRect, m_SupportSelect);
//drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ZoomLock);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ScrollSensitivity);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RangeMode);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Start);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_End);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShowNum);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
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;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int num = 1;
if (m_DataZoomModuleToggle)
{
num += 8;
if (prop.FindPropertyRelative("m_SupportSlider").boolValue) num += 6;
}
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

@@ -1,55 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Emphasis), true)]
public class EmphasisDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_EmphasisToggle = 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_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))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(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

@@ -1,82 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(GaugeAxis), true)]
public class GaugeAxisDrawer : PropertyDrawer
{
private bool m_DataFoldout = false;
private int m_DataSize = 0;
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_AxisLine = prop.FindPropertyRelative("m_AxisLine");
SerializedProperty m_SplitLine = prop.FindPropertyRelative("m_SplitLine");
SerializedProperty m_AxisTick = prop.FindPropertyRelative("m_AxisTick");
SerializedProperty m_AxisLabel = prop.FindPropertyRelative("m_AxisLabel");
SerializedProperty m_AxisLabelText = prop.FindPropertyRelative("m_AxisLabelText");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_AxisLineToggle, prop, "Gauge Axis", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_AxisLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLine);
EditorGUI.PropertyField(drawRect, m_SplitLine);
drawRect.y += EditorGUI.GetPropertyHeight(m_SplitLine);
EditorGUI.PropertyField(drawRect, m_AxisTick);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisTick);
EditorGUI.PropertyField(drawRect, m_AxisLabel);
drawRect.y += EditorGUI.GetPropertyHeight(m_AxisLabel);
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout = EditorGUI.Foldout(drawRect, m_DataFoldout, "Axis Label Text");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.width = pos.width;
if (m_DataFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_AxisLabelText);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_AxisLineToggle, prop))
{
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisLine"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SplitLine"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisTick"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AxisLabel"));
if (m_DataFoldout)
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_AxisLabelText");
int num = m_Data.arraySize + 1;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
else
{
return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,58 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Grid), true)]
public class GridDrawer : PropertyDrawer
{
private bool m_GridModuleToggle = false;
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)
{
++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;
--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

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

View File

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

View File

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

View File

@@ -1,62 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(LineArrow), true)]
public class LineArrowStyleDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_LineArrowToggle = 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_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))
{
++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;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_LineArrowToggle, prop))
{
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,59 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(LineStyle), true)]
public class LineStyleDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_LineStyleToggle = 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_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))
{
++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;
--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,102 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Location), true)]
public class LocationDrawer : PropertyDrawer
{
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty align = prop.FindPropertyRelative("m_Align");
SerializedProperty left = prop.FindPropertyRelative("m_Left");
SerializedProperty right = prop.FindPropertyRelative("m_Right");
SerializedProperty top = prop.FindPropertyRelative("m_Top");
SerializedProperty bottom = prop.FindPropertyRelative("m_Bottom");
EditorGUI.PropertyField(drawRect, align, new GUIContent("Location"));
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, top);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, bottom);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, left);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, right);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// switch ((Location.Align)align.enumValueIndex)
// {
// case Location.Align.TopCenter:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.TopLeft:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.TopRight:
// EditorGUI.PropertyField(drawRect, top);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomCenter:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomLeft:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.BottomRight:
// EditorGUI.PropertyField(drawRect, bottom);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.Center:
// break;
// case Location.Align.CenterLeft:
// EditorGUI.PropertyField(drawRect, left);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// case Location.Align.CenterRight:
// EditorGUI.PropertyField(drawRect, right);
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
// break;
// }
--EditorGUI.indentLevel;
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
return 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
// SerializedProperty align = prop.FindPropertyRelative("m_Align");
// switch ((Location.Align)align.enumValueIndex)
// {
// case Location.Align.Center:
// return 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
// case Location.Align.TopCenter:
// case Location.Align.BottomCenter:
// case Location.Align.CenterLeft:
// case Location.Align.CenterRight:
// return 2 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
// default:
// return 3 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
// }
}
}
}

View File

@@ -1,49 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Polar), true)]
public class PolarDrawer : PropertyDrawer
{
private bool m_PolarModuleToggle = 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_Center = prop.FindPropertyRelative("m_Center");
SerializedProperty m_Radius = prop.FindPropertyRelative("m_Radius");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_PolarModuleToggle, "Polar", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_PolarModuleToggle)
{
EditorGUI.indentLevel++;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
EditorGUI.PropertyField(drawRect, m_Radius);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_PolarModuleToggle)
return 4 * EditorGUIUtility.singleLineHeight + 3 * EditorGUIUtility.standardVerticalSpacing;
else
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

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

View File

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

View File

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

View File

@@ -1,677 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Serie), true)]
public class SerieDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_SerieModuleToggle = new Dictionary<string, bool>();
private List<bool> m_DataFoldout = new List<bool>();
private bool m_ShowJsonDataArea = false;
private string m_JsonDataAreaText;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty show = prop.FindPropertyRelative("m_Show");
SerializedProperty type = prop.FindPropertyRelative("m_Type");
SerializedProperty name = prop.FindPropertyRelative("m_Name");
SerializedProperty stack = prop.FindPropertyRelative("m_Stack");
SerializedProperty m_AxisIndex = prop.FindPropertyRelative("m_AxisIndex");
SerializedProperty m_RadarType = prop.FindPropertyRelative("m_RadarType");
SerializedProperty m_RadarIndex = prop.FindPropertyRelative("m_RadarIndex");
SerializedProperty m_VesselIndex = prop.FindPropertyRelative("m_VesselIndex");
SerializedProperty m_MinShow = prop.FindPropertyRelative("m_MinShow");
SerializedProperty m_MaxShow = prop.FindPropertyRelative("m_MaxShow");
SerializedProperty m_MaxCache = prop.FindPropertyRelative("m_MaxCache");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
SerializedProperty m_ItemStyle = prop.FindPropertyRelative("m_ItemStyle");
SerializedProperty m_LineArrow = prop.FindPropertyRelative("m_LineArrow");
SerializedProperty m_LineType = prop.FindPropertyRelative("m_LineType");
SerializedProperty m_SampleDist = prop.FindPropertyRelative("m_SampleDist");
SerializedProperty m_SampleType = prop.FindPropertyRelative("m_SampleType");
SerializedProperty m_SampleAverage = prop.FindPropertyRelative("m_SampleAverage");
SerializedProperty m_BarType = prop.FindPropertyRelative("m_BarType");
SerializedProperty m_BarPercentStack = prop.FindPropertyRelative("m_BarPercentStack");
SerializedProperty m_BarWidth = prop.FindPropertyRelative("m_BarWidth");
SerializedProperty m_BarGap = prop.FindPropertyRelative("m_BarGap");
SerializedProperty m_BarZebraWidth = prop.FindPropertyRelative("m_BarZebraWidth");
SerializedProperty m_BarZebraGap = prop.FindPropertyRelative("m_BarZebraGap");
SerializedProperty m_AreaStyle = prop.FindPropertyRelative("m_AreaStyle");
SerializedProperty m_Symbol = prop.FindPropertyRelative("m_Symbol");
SerializedProperty m_RoseType = prop.FindPropertyRelative("m_RoseType");
SerializedProperty m_Space = prop.FindPropertyRelative("m_Space");
SerializedProperty m_Center = prop.FindPropertyRelative("m_Center");
SerializedProperty m_Radius = prop.FindPropertyRelative("m_Radius");
SerializedProperty m_Label = prop.FindPropertyRelative("m_Label");
SerializedProperty m_Emphasis = prop.FindPropertyRelative("m_Emphasis");
SerializedProperty m_Animation = prop.FindPropertyRelative("m_Animation");
SerializedProperty m_DataDimension = prop.FindPropertyRelative("m_ShowDataDimension");
SerializedProperty m_ShowDataName = prop.FindPropertyRelative("m_ShowDataName");
SerializedProperty m_ShowDataIcon = prop.FindPropertyRelative("m_ShowDataIcon");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_StartAngle = prop.FindPropertyRelative("m_StartAngle");
SerializedProperty m_EndAngle = prop.FindPropertyRelative("m_EndAngle");
SerializedProperty m_RingGap = prop.FindPropertyRelative("m_RingGap");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Clockwise = prop.FindPropertyRelative("m_Clockwise");
SerializedProperty m_RoundCap = prop.FindPropertyRelative("m_RoundCap");
SerializedProperty m_GaugeType = prop.FindPropertyRelative("m_GaugeType");
SerializedProperty m_GaugeAxis = prop.FindPropertyRelative("m_GaugeAxis");
SerializedProperty m_GaugePointer = prop.FindPropertyRelative("m_GaugePointer");
SerializedProperty m_TitleStyle = prop.FindPropertyRelative("m_TitleStyle");
SerializedProperty m_Clip = prop.FindPropertyRelative("m_Clip");
SerializedProperty m_Ignore = prop.FindPropertyRelative("m_Ignore");
SerializedProperty m_IgnoreValue = prop.FindPropertyRelative("m_IgnoreValue");
SerializedProperty m_ShowAsPositiveNumber = prop.FindPropertyRelative("m_ShowAsPositiveNumber");
SerializedProperty m_Large = prop.FindPropertyRelative("m_Large");
SerializedProperty m_LargeThreshold = prop.FindPropertyRelative("m_LargeThreshold");
SerializedProperty m_AvoidLabelOverlap = prop.FindPropertyRelative("m_AvoidLabelOverlap");
SerializedProperty m_WaveHeight = prop.FindPropertyRelative("m_WaveHeight");
SerializedProperty m_WaveLength = prop.FindPropertyRelative("m_WaveLength");
SerializedProperty m_WaveSpeed = prop.FindPropertyRelative("m_WaveSpeed");
SerializedProperty m_WaveOffset = prop.FindPropertyRelative("m_WaveOffset");
SerializedProperty m_Datas = prop.FindPropertyRelative("m_Data");
int index = InitToggle(prop);
string moduleName = "Serie " + index;
var toggle = ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SerieModuleToggle, prop, moduleName, show);
if (!toggle)
{
var orderButton = 46;
var gap = 4;
drawRect.x += EditorGUIUtility.labelWidth + gap;
drawRect.width = pos.width - drawRect.x + ChartEditorHelper.BOOL_WIDTH - orderButton;
EditorGUI.PropertyField(drawRect, type, GUIContent.none);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
var serieType = (SerieType)type.enumValueIndex;
++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;
switch (serieType)
{
case SerieType.Line:
EditorGUI.PropertyField(drawRect, stack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AxisIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxCache);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MaxCache.intValue < 0) m_MaxCache.intValue = 0;
EditorGUI.PropertyField(drawRect, m_LineType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleDist);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SampleAverage);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowAsPositiveNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Large);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LargeThreshold);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
EditorGUI.PropertyField(drawRect, m_LineArrow);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineArrow);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_AreaStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_AreaStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Bar:
EditorGUI.PropertyField(drawRect, stack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AxisIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxShow);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MaxCache);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MinShow.intValue < 0) m_MinShow.intValue = 0;
if (m_MaxCache.intValue < 0) m_MaxCache.intValue = 0;
EditorGUI.PropertyField(drawRect, m_BarType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarPercentStack);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarZebraWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BarZebraGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShowAsPositiveNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Large);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LargeThreshold);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Pie:
EditorGUI.PropertyField(drawRect, m_RoseType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Space);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AvoidLabelOverlap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Ring:
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_StartAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RingGap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Clockwise);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TitleStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TitleStyle);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Radar:
EditorGUI.PropertyField(drawRect, m_RadarType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_RadarIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_AreaStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_AreaStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Scatter:
case SerieType.EffectScatter:
EditorGUI.PropertyField(drawRect, m_Clip);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Symbol);
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Heatmap:
EditorGUI.PropertyField(drawRect, m_Ignore);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreValue);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Gauge:
EditorGUI.PropertyField(drawRect, m_GaugeType);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
//ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Radius, "Radius");
EditorGUI.PropertyField(drawRect, m_Radius.GetArrayElementAtIndex(0), new GUIContent("Radius"));
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_StartAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_EndAngle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_SplitNumber.intValue > 36)
{
m_SplitNumber.intValue = 36;
}
EditorGUI.PropertyField(drawRect, m_RoundCap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TitleStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TitleStyle);
EditorGUI.PropertyField(drawRect, m_GaugeAxis);
drawRect.y += EditorGUI.GetPropertyHeight(m_GaugeAxis);
EditorGUI.PropertyField(drawRect, m_GaugePointer);
drawRect.y += EditorGUI.GetPropertyHeight(m_GaugePointer);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_Emphasis);
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
break;
case SerieType.Liquid:
EditorGUI.PropertyField(drawRect, m_VesselIndex);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Min);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Max);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveLength);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveSpeed);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_WaveOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Label);
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
break;
}
EditorGUI.PropertyField(drawRect, m_Animation);
drawRect.y += EditorGUI.GetPropertyHeight(m_Animation);
drawRect.width = EditorGUIUtility.labelWidth + 10;
m_DataFoldout[index] = EditorGUI.Foldout(drawRect, m_DataFoldout[index], "Data");
ChartEditorHelper.MakeJsonData(ref drawRect, ref m_ShowJsonDataArea, ref m_JsonDataAreaText, prop, pos.width);
drawRect.width = pos.width;
if (m_DataFoldout[index])
{
EditorGUI.indentLevel++;
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 (GUI.Button(nameRect, new GUIContent("Name")))
{
m_ShowDataName.boolValue = !m_ShowDataName.boolValue;
}
var iconRect = new Rect(pos.width - nameWid + 14, drawRect.y, nameWid + namegap, pos.height);
if (GUI.Button(iconRect, new GUIContent("More...")))
{
m_ShowDataIcon.boolValue = !m_ShowDataIcon.boolValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
var listSize = m_Datas.arraySize;
listSize = EditorGUI.IntField(drawRect, "Size", listSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (listSize < 0) listSize = 0;
if (m_DataDimension.intValue < 1) m_DataDimension.intValue = 1;
int dimension = m_DataDimension.intValue;
bool showName = m_ShowDataName.boolValue;
bool showIcon = m_ShowDataIcon.boolValue;
bool showSelected = (serieType == SerieType.Pie);
if (listSize != m_Datas.arraySize)
{
while (listSize > m_Datas.arraySize) m_Datas.arraySize++;
while (listSize < m_Datas.arraySize) m_Datas.arraySize--;
}
if (listSize > 30)
{
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
if (num >= 10)
{
EditorGUI.LabelField(drawRect, "...");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, listSize - 1, pos.width);
}
}
else
{
for (int i = 0; i < m_Datas.arraySize; i++)
{
DrawDataElement(ref drawRect, dimension, m_Datas, showName, showIcon, showSelected, i, pos.width);
}
}
drawRect.y += EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
}
--EditorGUI.indentLevel;
}
}
private void DrawDataElement(ref Rect drawRect, int dimension, SerializedProperty m_Datas, bool showName,
bool showDetail, bool showSelected, int index, float currentWidth)
{
var lastX = drawRect.x;
var lastWid = drawRect.width;
var lastFieldWid = EditorGUIUtility.fieldWidth;
var lastLabelWid = EditorGUIUtility.labelWidth;
var serieData = m_Datas.GetArrayElementAtIndex(index);
var sereName = serieData.FindPropertyRelative("m_Name");
var selected = serieData.FindPropertyRelative("m_Selected");
var data = serieData.FindPropertyRelative("m_Data");
var fieldCount = dimension + (showName ? 1 : 0);
if (fieldCount <= 1)
{
while (2 > 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, new GUIContent("Element " + index));
drawRect.x = currentWidth - 45;
EditorGUI.PropertyField(drawRect, selected, GUIContent.none);
drawRect.x = lastX;
drawRect.width = lastWid;
}
else
{
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + index));
}
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
}
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 + gap;
var dataWidTotal = (currentWidth - (startX + 20.5f + 1));
var dataWid = dataWidTotal / fieldCount;
var xWid = dataWid - 4;
for (int i = 0; i < dimension; i++)
{
var dataCount = i < 1 ? 2 : i + 1;
while (dataCount > data.arraySize)
{
var value = data.arraySize == 0 ? index : 0;
data.arraySize++;
data.GetArrayElementAtIndex(data.arraySize - 1).floatValue = value;
}
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + 40;
SerializedProperty element = data.GetArrayElementAtIndex(dimension <= 1 ? 1 : i);
EditorGUI.PropertyField(drawRect, element, GUIContent.none);
}
if (showName)
{
drawRect.x = startX + (fieldCount - 1) * xWid;
drawRect.width = dataWid + 40 + dimension * namegap;
EditorGUI.PropertyField(drawRect, sereName, GUIContent.none);
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.x = lastX;
drawRect.width = lastWid;
EditorGUIUtility.fieldWidth = lastFieldWid;
EditorGUIUtility.labelWidth = lastLabelWid;
}
if (showDetail)
{
EditorGUI.indentLevel += 2;
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_Icon);
drawRect.y += EditorGUI.GetPropertyHeight(m_Icon);
EditorGUI.PropertyField(drawRect, m_Symbol);
ChartEditorHelper.MakeBool(drawRect, m_EnableSymbol, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Symbol);
EditorGUI.PropertyField(drawRect, m_Label);
ChartEditorHelper.MakeBool(drawRect, m_EnableLabel, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Label);
EditorGUI.PropertyField(drawRect, m_ItemStyle);
ChartEditorHelper.MakeBool(drawRect, m_EnableItemStyle, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_ItemStyle);
EditorGUI.PropertyField(drawRect, m_Emphasis);
ChartEditorHelper.MakeBool(drawRect, m_EnableEmphasis, 1, "(enable)");
drawRect.y += EditorGUI.GetPropertyHeight(m_Emphasis);
EditorGUI.indentLevel -= 2;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int index = InitToggle(prop);
if (!m_SerieModuleToggle.ContainsKey(prop.propertyPath) || !m_SerieModuleToggle[prop.propertyPath])
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
SerializedProperty type = prop.FindPropertyRelative("m_Type");
var serieType = (SerieType)type.enumValueIndex;
switch (serieType)
{
case SerieType.Line:
height += 19 * EditorGUIUtility.singleLineHeight + 18 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineArrow"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Bar:
height += 21 * EditorGUIUtility.singleLineHeight + 20 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Pie:
height += 12 * EditorGUIUtility.singleLineHeight + 11 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Ring:
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TitleStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Radar:
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_AreaStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Scatter:
case SerieType.EffectScatter:
height += 5 * EditorGUIUtility.singleLineHeight + 4 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Heatmap:
height += 6 * EditorGUIUtility.singleLineHeight + 5 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Gauge:
height += 13 * EditorGUIUtility.singleLineHeight + 12 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TitleStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_GaugeAxis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_GaugePointer"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Emphasis"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
case SerieType.Liquid:
height += 11 * EditorGUIUtility.singleLineHeight + 10 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Animation"));
break;
}
if (m_DataFoldout[index])
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Data");
height += 2 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
int num = m_Data.arraySize;
if (num > 30)
{
num = 11;
height += (num + 1) * EditorGUIUtility.singleLineHeight + (num) * EditorGUIUtility.standardVerticalSpacing;
}
else
{
height += (num) * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
}
height += EditorGUIUtility.standardVerticalSpacing;
if (prop.FindPropertyRelative("m_ShowDataIcon").boolValue)
{
for (int i = 0; i < num; i++)
{
var item = m_Data.GetArrayElementAtIndex(i);
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_IconStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Symbol"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Label"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_ItemStyle"));
height += EditorGUI.GetPropertyHeight(item.FindPropertyRelative("m_Emphasis"));
}
}
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
private int InitToggle(SerializedProperty prop)
{
int index = 0;
var sindex = prop.propertyPath.LastIndexOf('[');
var eindex = prop.propertyPath.LastIndexOf(']');
if (sindex >= 0 && eindex >= 0)
{
var str = prop.propertyPath.Substring(sindex + 1, eindex - sindex - 1);
int.TryParse(str, out index);
}
if (index >= m_DataFoldout.Count)
{
m_DataFoldout.Add(false);
}
return index;
}
}
}

View File

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

View File

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

View File

@@ -1,57 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
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)
{
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;
drawRect.width = pos.width;
if (m_SeriesModuleToggle)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_DataSize, m_Series, true);
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (m_SeriesModuleToggle)
{
SerializedProperty m_Data = prop.FindPropertyRelative("m_Series");
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
for (int i = 0; i < m_Data.arraySize; i++)
{
height += EditorGUI.GetPropertyHeight(m_Data.GetArrayElementAtIndex(i));
}
}
if (m_ShowJsonDataArea)
{
height += EditorGUIUtility.singleLineHeight * 3 + EditorGUIUtility.standardVerticalSpacing;
}
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

@@ -1,64 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Settings), true)]
public class SettingsDrawer : PropertyDrawer
{
private bool m_SettingsModuleToggle = false;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_LineSmoothStyle = prop.FindPropertyRelative("m_LineSmoothStyle");
SerializedProperty m_LineSmoothness = prop.FindPropertyRelative("m_LineSmoothness");
SerializedProperty m_LineSegmentDistance = prop.FindPropertyRelative("m_LineSegmentDistance");
SerializedProperty m_CicleSmoothness = prop.FindPropertyRelative("m_CicleSmoothness");
SerializedProperty m_VisualMapTriangeLen = prop.FindPropertyRelative("m_VisualMapTriangeLen");
SerializedProperty m_PieTooltipExtraRadius = prop.FindPropertyRelative("m_PieTooltipExtraRadius");
SerializedProperty m_PieSelectedOffset = prop.FindPropertyRelative("m_PieSelectedOffset");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_SettingsModuleToggle, "Settings");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_SettingsModuleToggle)
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_LineSmoothStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineSmoothness);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineSegmentDistance);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_CicleSmoothness);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_VisualMapTriangeLen);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_PieTooltipExtraRadius);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_PieSelectedOffset);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
int num = 1;
if (m_SettingsModuleToggle)
{
num = 8;
}
return num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,53 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(TextLimit), true)]
public class TextLimitDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_TextLimitToggle = new Dictionary<string, bool>();
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_MaxWidth = prop.FindPropertyRelative("m_MaxWidth");
SerializedProperty m_Gap = prop.FindPropertyRelative("m_Gap");
SerializedProperty m_LimitSuffix = prop.FindPropertyRelative("m_Suffix");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TextLimitToggle, prop, "Text Limit", m_Enable, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_TextLimitToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_MaxWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Gap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LimitSuffix);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_TextLimitToggle, prop))
{
height += 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

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(TextStyle), true)]
public class TextStyleDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_TextStyleToggle = new Dictionary<string, bool>();
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Font = prop.FindPropertyRelative("m_Font");
SerializedProperty m_Rotate = prop.FindPropertyRelative("m_Rotate");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_FontSize = prop.FindPropertyRelative("m_FontSize");
SerializedProperty m_FontStyle = prop.FindPropertyRelative("m_FontStyle");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
SerializedProperty m_LineSpacing = prop.FindPropertyRelative("m_LineSpacing");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TextStyleToggle, prop, null,null,false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Font);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Rotate);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
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_FontSize);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FontStyle);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_LineSpacing);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_TextStyleToggle, prop))
{
height += 8 * EditorGUIUtility.singleLineHeight + 7 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset"));
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,369 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(ThemeInfo), true)]
public class ThemeInfoDrawer : PropertyDrawer
{
ReorderableList m_ColorPaletteList;
bool m_ColorPaletteFoldout;
bool m_ThemeModuleToggle = false;
public override void OnGUI(Rect pos, SerializedProperty prop, GUIContent label)
{
Rect drawRect = pos;
var defaultWidth = drawRect.width;
var defaultX = drawRect.x;
drawRect.height = EditorGUIUtility.singleLineHeight;
SerializedProperty m_Theme = prop.FindPropertyRelative("m_Theme");
SerializedProperty m_Font = prop.FindPropertyRelative("m_Font");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
SerializedProperty m_TextColor = prop.FindPropertyRelative("m_TitleTextColor");
SerializedProperty m_SubTextColor = prop.FindPropertyRelative("m_TitleSubTextColor");
SerializedProperty m_LegendTextColor = prop.FindPropertyRelative("m_LegendTextColor");
SerializedProperty m_LegendUnableColor = prop.FindPropertyRelative("m_LegendUnableColor");
SerializedProperty m_AxisTextColor = prop.FindPropertyRelative("m_AxisTextColor");
SerializedProperty m_AxisLineColor = prop.FindPropertyRelative("m_AxisLineColor");
SerializedProperty m_AxisSplitLineColor = prop.FindPropertyRelative("m_AxisSplitLineColor");
SerializedProperty m_TooltipBackgroundColor = prop.FindPropertyRelative("m_TooltipBackgroundColor");
SerializedProperty m_TooltipFlagAreaColor = prop.FindPropertyRelative("m_TooltipFlagAreaColor");
SerializedProperty m_TooltipTextColor = prop.FindPropertyRelative("m_TooltipTextColor");
SerializedProperty m_TooltipLabelColor = prop.FindPropertyRelative("m_TooltipLabelColor");
SerializedProperty m_TooltipLineColor = prop.FindPropertyRelative("m_TooltipLineColor");
SerializedProperty m_DataZoomLineColor = prop.FindPropertyRelative("m_DataZoomLineColor");
SerializedProperty m_DataZoomSelectedColor = prop.FindPropertyRelative("m_DataZoomSelectedColor");
SerializedProperty m_DataZoomTextColor = prop.FindPropertyRelative("m_DataZoomTextColor");
SerializedProperty m_VisualMapBackgroundColor = prop.FindPropertyRelative("m_VisualMapBackgroundColor");
SerializedProperty m_VisualMapBorderColor = prop.FindPropertyRelative("m_VisualMapBorderColor");
SerializedProperty m_ColorPalette = prop.FindPropertyRelative("m_ColorPalette");
SerializedProperty m_CustomFont = prop.FindPropertyRelative("m_CustomFont");
SerializedProperty m_CustomBackgroundColor = prop.FindPropertyRelative("m_CustomBackgroundColor");
SerializedProperty m_CustomTextColor = prop.FindPropertyRelative("m_CustomTitleTextColor");
SerializedProperty m_CustomSubTextColor = prop.FindPropertyRelative("m_CustomTitleSubTextColor");
SerializedProperty m_CustomLegendTextColor = prop.FindPropertyRelative("m_CustomLegendTextColor");
SerializedProperty m_CustomLegendUnableColor = prop.FindPropertyRelative("m_CustomLegendUnableColor");
SerializedProperty m_CustomAxisTextColor = prop.FindPropertyRelative("m_CustomAxisTextColor");
SerializedProperty m_CustomAxisLineColor = prop.FindPropertyRelative("m_CustomAxisLineColor");
SerializedProperty m_CustomAxisSplitLineColor = prop.FindPropertyRelative("m_CustomAxisSplitLineColor");
SerializedProperty m_CustomTooltipBackgroundColor = prop.FindPropertyRelative("m_CustomTooltipBackgroundColor");
SerializedProperty m_CustomTooltipFlagAreaColor = prop.FindPropertyRelative("m_CustomTooltipFlagAreaColor");
SerializedProperty m_CustomTooltipTextColor = prop.FindPropertyRelative("m_CustomTooltipTextColor");
SerializedProperty m_CustomTooltipLabelColor = prop.FindPropertyRelative("m_CustomTooltipLabelColor");
SerializedProperty m_CustomTooltipLineColor = prop.FindPropertyRelative("m_CustomTooltipLineColor");
SerializedProperty m_CustomDataZoomLineColor = prop.FindPropertyRelative("m_CustomDataZoomLineColor");
SerializedProperty m_CustomDataZoomSelectedColor = prop.FindPropertyRelative("m_CustomDataZoomSelectedColor");
SerializedProperty m_CustomDataZoomTextColor = prop.FindPropertyRelative("m_CustomDataZoomTextColor");
SerializedProperty m_CustomVisualMapBackgroundColor = prop.FindPropertyRelative("m_CustomVisualMapBackgroundColor");
SerializedProperty m_CustomVisualMapBorderColor = prop.FindPropertyRelative("m_CustomVisualMapBorderColor");
SerializedProperty m_CustomColorPalette = prop.FindPropertyRelative("m_CustomColorPalette");
var btnWidth = 45;
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_ThemeModuleToggle, "Theme");
drawRect.x += EditorGUIUtility.labelWidth + ChartEditorHelper.GAP_WIDTH;
drawRect.width = defaultWidth - EditorGUIUtility.labelWidth - ChartEditorHelper.GAP_WIDTH
- (m_ThemeModuleToggle ? btnWidth + 3 : 0);
EditorGUI.PropertyField(drawRect, m_Theme, GUIContent.none);
if (m_ThemeModuleToggle)
{
drawRect.x = defaultX + defaultWidth - btnWidth;
drawRect.width = btnWidth;
if (GUI.Button(drawRect, new GUIContent("Reset", "Reset to theme default color")))
{
m_CustomFont.objectReferenceValue = null;
m_CustomBackgroundColor.colorValue = Color.clear;
m_CustomTextColor.colorValue = Color.clear;
m_CustomSubTextColor.colorValue = Color.clear;
m_CustomLegendTextColor.colorValue = Color.clear;
m_CustomLegendUnableColor.colorValue = Color.clear;
m_CustomAxisTextColor.colorValue = Color.clear;
m_CustomAxisLineColor.colorValue = Color.clear;
m_CustomAxisSplitLineColor.colorValue = Color.clear;
m_CustomTooltipBackgroundColor.colorValue = Color.clear;
m_CustomTooltipFlagAreaColor.colorValue = Color.clear;
m_CustomTooltipTextColor.colorValue = Color.clear;
m_CustomTooltipLabelColor.colorValue = Color.clear;
m_CustomTooltipLineColor.colorValue = Color.clear;
m_CustomDataZoomLineColor.colorValue = Color.clear;
m_CustomDataZoomSelectedColor.colorValue = Color.clear;
m_CustomDataZoomTextColor.colorValue = Color.clear;
m_CustomVisualMapBackgroundColor.colorValue = Color.clear;
m_CustomVisualMapBorderColor.colorValue = Color.clear;
for (int i = 0; i < m_CustomColorPalette.arraySize; i++)
{
m_CustomColorPalette.GetArrayElementAtIndex(i).colorValue = Color.clear;
}
ThemeInfo defaultThemeInfo = ThemeInfo.Default;
switch (m_Theme.enumValueIndex)
{
case ((int)Theme.Default): defaultThemeInfo = ThemeInfo.Default; break;
case ((int)Theme.Light): defaultThemeInfo = ThemeInfo.Light; break;
case ((int)Theme.Dark): defaultThemeInfo = ThemeInfo.Dark; break;
}
m_Font.objectReferenceValue = defaultThemeInfo.font;
m_BackgroundColor.colorValue = defaultThemeInfo.backgroundColor;
m_TextColor.colorValue = defaultThemeInfo.titleTextColor;
m_SubTextColor.colorValue = defaultThemeInfo.titleSubTextColor;
m_LegendTextColor.colorValue = defaultThemeInfo.legendTextColor;
m_LegendUnableColor.colorValue = defaultThemeInfo.legendUnableColor;
m_AxisTextColor.colorValue = defaultThemeInfo.axisTextColor;
m_AxisLineColor.colorValue = defaultThemeInfo.axisLineColor;
m_AxisSplitLineColor.colorValue = defaultThemeInfo.axisSplitLineColor;
m_TooltipBackgroundColor.colorValue = defaultThemeInfo.tooltipBackgroundColor;
m_TooltipFlagAreaColor.colorValue = defaultThemeInfo.tooltipFlagAreaColor;
m_TooltipTextColor.colorValue = defaultThemeInfo.tooltipTextColor;
m_TooltipLabelColor.colorValue = defaultThemeInfo.tooltipLabelColor;
m_TooltipLineColor.colorValue = defaultThemeInfo.tooltipLineColor;
m_DataZoomLineColor.colorValue = defaultThemeInfo.dataZoomLineColor;
m_DataZoomSelectedColor.colorValue = defaultThemeInfo.dataZoomSelectedColor;
m_DataZoomTextColor.colorValue = defaultThemeInfo.dataZoomTextColor;
m_VisualMapBackgroundColor.colorValue = defaultThemeInfo.visualMapBackgroundColor;
m_VisualMapBorderColor.colorValue = defaultThemeInfo.visualMapBorderColor;
for (int i = 0; i < m_ColorPalette.arraySize; i++)
{
m_ColorPalette.GetArrayElementAtIndex(i).colorValue = defaultThemeInfo.GetColor(i);
}
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
drawRect.x = defaultX;
drawRect.width = defaultWidth;
++EditorGUI.indentLevel;
EditorGUI.BeginChangeCheck();
var font = m_CustomFont.objectReferenceValue != null ? m_CustomFont : m_Font;
EditorGUI.PropertyField(drawRect, font);
if (EditorGUI.EndChangeCheck())
{
m_CustomFont.objectReferenceValue = font.objectReferenceValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
var color = m_CustomBackgroundColor.colorValue != Color.clear ? m_CustomBackgroundColor : m_BackgroundColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Background Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomBackgroundColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTextColor.colorValue != Color.clear ? m_CustomTextColor : m_TextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Title Text Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomSubTextColor.colorValue != Color.clear ? m_CustomSubTextColor : m_SubTextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Title SubText Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomSubTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomLegendTextColor.colorValue != Color.clear ? m_CustomLegendTextColor : m_LegendTextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("LegendText Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomLegendTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomLegendUnableColor.colorValue != Color.clear ? m_CustomLegendUnableColor : m_LegendUnableColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("LegendUnable Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomLegendUnableColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomAxisTextColor.colorValue != Color.clear ? m_CustomAxisTextColor : m_AxisTextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("AxisText Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomAxisTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomAxisLineColor.colorValue != Color.clear ? m_CustomAxisLineColor : m_AxisLineColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("AxisLine Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomAxisLineColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomAxisSplitLineColor.colorValue != Color.clear ? m_CustomAxisSplitLineColor : m_AxisSplitLineColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("AxisSplitLine Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomAxisSplitLineColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTooltipBackgroundColor.colorValue != Color.clear ? m_CustomTooltipBackgroundColor : m_TooltipBackgroundColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Tooltip Background Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTooltipBackgroundColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTooltipFlagAreaColor.colorValue != Color.clear ? m_CustomTooltipFlagAreaColor : m_TooltipFlagAreaColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Tooltip FlagArea Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTooltipFlagAreaColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTooltipTextColor.colorValue != Color.clear ? m_CustomTooltipTextColor : m_TooltipTextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Tooltip Text Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTooltipTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTooltipLabelColor.colorValue != Color.clear ? m_CustomTooltipLabelColor : m_TooltipLabelColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Tooltip Label Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTooltipLabelColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomTooltipLineColor.colorValue != Color.clear ? m_CustomTooltipLineColor : m_TooltipLineColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("Tooltip Line Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomTooltipLineColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomDataZoomLineColor.colorValue != Color.clear ? m_CustomDataZoomLineColor : m_DataZoomLineColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("DataZoom Line Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomDataZoomLineColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomDataZoomSelectedColor.colorValue != Color.clear ? m_CustomDataZoomSelectedColor : m_DataZoomSelectedColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("DataZoom Selected Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomDataZoomSelectedColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomDataZoomTextColor.colorValue != Color.clear ? m_CustomDataZoomTextColor : m_DataZoomTextColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("DataZoom Text Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomDataZoomTextColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomVisualMapBackgroundColor.colorValue != Color.clear ? m_CustomVisualMapBackgroundColor : m_VisualMapBackgroundColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("VisualMap Background Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomVisualMapBackgroundColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.BeginChangeCheck();
color = m_CustomVisualMapBorderColor.colorValue != Color.clear ? m_CustomVisualMapBorderColor : m_VisualMapBorderColor;
EditorGUI.PropertyField(drawRect, color, new GUIContent("VisualMap Border Color"));
if (EditorGUI.EndChangeCheck())
{
m_CustomVisualMapBorderColor.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
m_ColorPaletteFoldout = EditorGUI.Foldout(drawRect, m_ColorPaletteFoldout, "ColorPalette");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_ColorPaletteFoldout)
{
EditorGUI.indentLevel++;
for (int i = 0; i < m_ColorPalette.arraySize; i++)
{
while (i > m_CustomColorPalette.arraySize - 1)
{
m_CustomColorPalette.arraySize++;
}
var customElement = m_CustomColorPalette.GetArrayElementAtIndex(i);
color = !ChartHelper.IsClearColor(customElement.colorValue) ?
customElement :
m_ColorPalette.GetArrayElementAtIndex(i);
EditorGUI.BeginChangeCheck();
EditorGUI.PropertyField(drawRect, color);
if (EditorGUI.EndChangeCheck())
{
customElement.colorValue = color.colorValue;
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
EditorGUI.indentLevel--;
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (!m_ThemeModuleToggle)
{
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
else
{
float height = 0;
int propertyCount = 20;
if (m_ColorPaletteFoldout)
{
SerializedProperty m_ColorPalette = prop.FindPropertyRelative("m_ColorPalette");
propertyCount += m_ColorPalette.arraySize + 1;
}
else
{
propertyCount += 1;
}
height += propertyCount * EditorGUIUtility.singleLineHeight + (propertyCount - 1) * EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}
}

View File

@@ -1,65 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Title), true)]
public class TitleDrawer : PropertyDrawer
{
private bool m_TitleModuleToggle = 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 text = prop.FindPropertyRelative("m_Text");
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
SerializedProperty subText = prop.FindPropertyRelative("m_SubText");
SerializedProperty m_SubTextStyle = prop.FindPropertyRelative("m_SubTextStyle");
SerializedProperty m_ItemGap = prop.FindPropertyRelative("m_ItemGap");
SerializedProperty location = prop.FindPropertyRelative("m_Location");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TitleModuleToggle, "Title", show);
++EditorGUI.indentLevel;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_TitleModuleToggle)
{
EditorGUI.PropertyField(drawRect, text);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, subText);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemGap, new GUIContent("Item Gap"));
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, location);
drawRect.y += EditorGUI.GetPropertyHeight(location);
EditorGUI.PropertyField(drawRect, m_TextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
EditorGUI.PropertyField(drawRect, m_SubTextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_SubTextStyle);
}
--EditorGUI.indentLevel;
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (m_TitleModuleToggle)
{
height += 3 * EditorGUIUtility.singleLineHeight + 2 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_SubTextStyle"));
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Location"));
}
height += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
return height;
}
}
}

View File

@@ -1,51 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(TitleStyle), true)]
public class TitleStyleDrawer : PropertyDrawer
{
private Dictionary<string, bool> m_TitleStyleToggle = 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_TextStyle = prop.FindPropertyRelative("m_TextStyle");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TitleStyleToggle, prop, "Title Style", show, false);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (ChartEditorHelper.IsToggle(m_TitleStyleToggle, prop))
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_TextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
if (ChartEditorHelper.IsToggle(m_TitleStyleToggle, prop))
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
}
else
{
height += 1 * EditorGUIUtility.singleLineHeight + 1 * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

@@ -1,92 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Tooltip), true)]
public class TooltipDrawer : PropertyDrawer
{
private bool m_TooltipModuleToggle = 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 type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_Formatter = prop.FindPropertyRelative("m_Formatter");
SerializedProperty m_TitleFormatter = prop.FindPropertyRelative("m_TitleFormatter");
SerializedProperty m_ItemFormatter = prop.FindPropertyRelative("m_ItemFormatter");
SerializedProperty m_FixedWidth = prop.FindPropertyRelative("m_FixedWidth");
SerializedProperty m_FixedHeight = prop.FindPropertyRelative("m_FixedHeight");
SerializedProperty m_MinWidth = prop.FindPropertyRelative("m_MinWidth");
SerializedProperty m_MinHeight = prop.FindPropertyRelative("m_MinHeight");
SerializedProperty m_NumericFormatter = prop.FindPropertyRelative("m_NumericFormatter");
SerializedProperty m_PaddingLeftRight = prop.FindPropertyRelative("m_PaddingLeftRight");
SerializedProperty m_PaddingTopBottom = prop.FindPropertyRelative("m_PaddingTopBottom");
SerializedProperty m_BackgroundImage = prop.FindPropertyRelative("m_BackgroundImage");
SerializedProperty m_IgnoreDataDefaultContent = prop.FindPropertyRelative("m_IgnoreDataDefaultContent");
SerializedProperty m_LineStyle = prop.FindPropertyRelative("m_LineStyle");
SerializedProperty m_TextStyle = prop.FindPropertyRelative("m_TextStyle");
SerializedProperty m_Offset = prop.FindPropertyRelative("m_Offset");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_TooltipModuleToggle)
{
EditorGUI.indentLevel++;
EditorGUI.PropertyField(drawRect, type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Formatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_TitleFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_NumericFormatter);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FixedWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_FixedHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_MinHeight);
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_BackgroundImage);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_IgnoreDataDefaultContent);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Offset);
drawRect.y += EditorGUI.GetPropertyHeight(m_Offset);
EditorGUI.PropertyField(drawRect, m_LineStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_LineStyle);
EditorGUI.PropertyField(drawRect, m_TextStyle);
drawRect.y += EditorGUI.GetPropertyHeight(m_TextStyle);
EditorGUI.indentLevel--;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_TooltipModuleToggle)
return 14 * EditorGUIUtility.singleLineHeight + 13 * EditorGUIUtility.standardVerticalSpacing +
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Offset")) +
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_LineStyle")) +
EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_TextStyle"));
else
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,68 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(Vessel), true)]
public class VesselDrawer : PropertyDrawer
{
private bool m_VesselModuleToggle = 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_Shape = prop.FindPropertyRelative("m_Shape");
SerializedProperty m_Center = prop.FindPropertyRelative("m_Center");
SerializedProperty m_Radius = prop.FindPropertyRelative("m_Radius");
SerializedProperty m_ShapeWidth = prop.FindPropertyRelative("m_ShapeWidth");
SerializedProperty m_Gap = prop.FindPropertyRelative("m_Gap");
SerializedProperty m_Smoothness = prop.FindPropertyRelative("m_Smoothness");
SerializedProperty m_AutoColor = prop.FindPropertyRelative("m_AutoColor");
SerializedProperty m_Color = prop.FindPropertyRelative("m_Color");
SerializedProperty m_BackgroundColor = prop.FindPropertyRelative("m_BackgroundColor");
int index = ChartEditorHelper.GetIndexFromPath(prop);
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_VesselModuleToggle, "Vessel " + index, show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_VesselModuleToggle)
{
EditorGUI.indentLevel++;
EditorGUI.PropertyField(drawRect, m_Shape);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ShapeWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Gap);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Center, "Center");
EditorGUI.PropertyField(drawRect, m_Radius);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BackgroundColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Color);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AutoColor);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Smoothness);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.indentLevel--;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
if (m_VesselModuleToggle)
return 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
else
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
}
}

View File

@@ -1,150 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
[CustomPropertyDrawer(typeof(VisualMap), true)]
public class VisualMapDrawer : PropertyDrawer
{
private bool m_VisualMapModuleToggle = false;
private bool m_InRangeFoldout;
private bool m_OutOfRangeFoldout;
private int m_InRangeSize;
private int m_OutOfRangeSize;
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_Type = prop.FindPropertyRelative("m_Type");
SerializedProperty m_Show = prop.FindPropertyRelative("m_Show");
SerializedProperty m_SelectedMode = prop.FindPropertyRelative("m_SelectedMode");
SerializedProperty m_Min = prop.FindPropertyRelative("m_Min");
SerializedProperty m_Max = prop.FindPropertyRelative("m_Max");
SerializedProperty m_Range = prop.FindPropertyRelative("m_Range");
SerializedProperty m_Text = prop.FindPropertyRelative("m_Text");
// SerializedProperty m_TextGap = prop.FindPropertyRelative("m_TextGap");
SerializedProperty m_SplitNumber = prop.FindPropertyRelative("m_SplitNumber");
SerializedProperty m_Calculable = prop.FindPropertyRelative("m_Calculable");
SerializedProperty m_ItemWidth = prop.FindPropertyRelative("m_ItemWidth");
SerializedProperty m_ItemHeight = prop.FindPropertyRelative("m_ItemHeight");
SerializedProperty m_BorderWidth = prop.FindPropertyRelative("m_BorderWidth");
SerializedProperty m_Dimension = prop.FindPropertyRelative("m_Dimension");
SerializedProperty m_HoverLink = prop.FindPropertyRelative("m_HoverLink");
SerializedProperty m_Orient = prop.FindPropertyRelative("m_Orient");
SerializedProperty m_Location = prop.FindPropertyRelative("m_Location");
SerializedProperty m_InRange = prop.FindPropertyRelative("m_InRange");
SerializedProperty m_AutoMinMax = prop.FindPropertyRelative("m_AutoMinMax");
SerializedProperty m_Direction = prop.FindPropertyRelative("m_Direction");
SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_VisualMapModuleToggle, "Visual Map", m_Enable);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_VisualMapModuleToggle)
{
++EditorGUI.indentLevel;
EditorGUI.PropertyField(drawRect, m_Type);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Direction);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_AutoMinMax);
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_SplitNumber);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Dimension);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
m_InRangeFoldout = EditorGUI.Foldout(drawRect, m_InRangeFoldout, "InRange");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_InRangeFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_InRangeSize, m_InRange);
}
// drawRect.width = pos.width;
m_OutOfRangeFoldout = EditorGUI.Foldout(drawRect, m_OutOfRangeFoldout, "OutOfRange");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_OutOfRangeFoldout)
{
ChartEditorHelper.MakeList(ref drawRect, ref m_OutOfRangeSize, m_OutOfRange);
}
// drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Show);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (m_Show.boolValue)
{
EditorGUI.PropertyField(drawRect, m_SelectedMode);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Range, "Range");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Text, "Text");
ChartEditorHelper.MakeTwoField(ref drawRect, pos.width, m_Text, "TextGap");
EditorGUI.PropertyField(drawRect, m_HoverLink);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Calculable);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_ItemHeight);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_BorderWidth);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Orient);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(drawRect, m_Location);
drawRect.y += EditorGUI.GetPropertyHeight(m_Location);
}
--EditorGUI.indentLevel;
}
}
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
{
float height = 0;
int num = 1;
if (m_VisualMapModuleToggle)
{
num += 10;
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
if (m_InRangeFoldout)
{
SerializedProperty m_InRange = prop.FindPropertyRelative("m_InRange");
int size = m_InRange.arraySize + 1;
height += size * EditorGUIUtility.singleLineHeight + (size - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
if (m_OutOfRangeFoldout)
{
SerializedProperty m_OutOfRange = prop.FindPropertyRelative("m_OutOfRange");
int size = m_OutOfRange.arraySize + 1;
height += size * EditorGUIUtility.singleLineHeight + (size - 1) * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUIUtility.standardVerticalSpacing;
}
if (prop.FindPropertyRelative("m_Show").boolValue)
{
height += 10 * EditorGUIUtility.singleLineHeight + 9 * EditorGUIUtility.standardVerticalSpacing;
height += EditorGUI.GetPropertyHeight(prop.FindPropertyRelative("m_Location"));
}
}
else
{
height += num * EditorGUIUtility.singleLineHeight + (num - 1) * EditorGUIUtility.standardVerticalSpacing;
}
return height;
}
}
}

View File

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

View File

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

View File

@@ -1,35 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI RadarChart.
/// </summary>
[CustomEditor(typeof(RadarChart), false)]
public class RadarChartEditor : BaseChartEditor
{
protected SerializedProperty m_Radar;
protected SerializedProperty m_Radars;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (RadarChart)target;
m_Radars = serializedObject.FindProperty("m_Radars");
}
protected override void OnEndInspectorGUI()
{
EditorGUILayout.PropertyField(m_Radars, true);
base.OnEndInspectorGUI();
}
}
}

View File

@@ -1,28 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI RingChart.
/// </summary>
[CustomEditor(typeof(RingChart), false)]
public class RingChartEditor : BaseChartEditor
{
protected SerializedProperty m_Radar;
protected SerializedProperty m_Radars;
protected override void OnEnable()
{
base.OnEnable();
m_Target = (RingChart)target;
}
}
}

View File

@@ -1,30 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI ScatterChart.
/// </summary>
[CustomEditor(typeof(ScatterChart), false)]
public class ScatterChartEditor : CoordinateChartEditor
{
protected override void OnEnable()
{
base.OnEnable();
m_Target = (ScatterChart)target;
}
protected override void OnEndInspectorGUI()
{
base.OnEndInspectorGUI();
}
}
}

View File

@@ -1,377 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
namespace XCharts
{
/// <summary>
/// 升级旧版本的颜色配置到1.6.0以上版本,参考[问答29](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/XCharts问答.md)进行升级
/// 导出:菜单栏->XCharts->ExportColorConfig
/// 导入:菜单栏->XCharts->ImportColorConfig
/// </summary>
public static class UpgradeChartColor
{
private const string CONFIG_PATH = "/colors.config"; // /Assets/
[MenuItem("XCharts/ExportColorConfig")]
/// <summary>
/// Export all the color configuration associated with drawing.
/// 导出所有图表的和绘制相关的颜色配置。保存在Assets目录下的colors.config文件里。
/// </summary>
public static void ExportColorConfig()
{
Debug.Log("ExportColorConfig");
var charts = Resources.FindObjectsOfTypeAll(typeof(BaseChart));
var sb = new StringBuilder();
foreach (var chart in charts)
{
if (chart is CoordinateChart) ExportCoordinateChart(sb, chart as CoordinateChart);
else if (chart is LiquidChart) ExportLiquidChart(sb, chart as LiquidChart); //如果这里编译失败说明该版本不存在LiquidChart可以整行注释掉。
else if (chart is RadarChart) ExportRadarChart(sb, chart as RadarChart);
else ExportSeries(sb, chart as BaseChart);
sb.Append("\n");
}
Debug.LogFormat("ExportColorConfig DONE: {0} charts.", charts.Length);
File.WriteAllText(Application.dataPath + CONFIG_PATH, sb.ToString());
}
[MenuItem("XCharts/ImportColorConfig")]
/// <summary>
/// 导入旧版本的颜色配置。
/// </summary>
public static void ImportColorConfig()
{
Debug.Log("ImportColorConfig");
var configPath = Application.dataPath + CONFIG_PATH;
if (!File.Exists(configPath))
{
Debug.LogError("ImportColorConfig ERROR:can't found config:" + configPath);
return;
}
var charts = Resources.FindObjectsOfTypeAll(typeof(BaseChart));
var chartDic = new Dictionary<int, BaseChart>();
foreach (var chart in charts)
{
chartDic[chart.GetInstanceID()] = chart as BaseChart;
}
var allLines = File.ReadAllLines(configPath);
var chartSet = new HashSet<int>();
foreach (var line in allLines)
{
if (string.IsNullOrEmpty(line)) continue;
var temp = line.Split('=');
var instanceId = int.Parse(temp[0]);
if (!chartDic.ContainsKey(instanceId))
{
Debug.LogError("can't find chart:" + instanceId);
continue;
}
if (!chartSet.Contains(instanceId)) chartSet.Add(instanceId);
var chart = chartDic[instanceId];
var colorList = ConvertToColorList(temp[2]);
var temp2 = temp[1].Split('_');
var allType = temp[1];
var strType = temp2[0];
if (allType.Equals("visualMap")) ImportColorList((chart as CoordinateChart).visualMap.inRange, colorList);
else if (allType.Equals("xAxis0_splitArea")) ImportColorList((chart as CoordinateChart).xAxis0.splitArea.color, colorList);
else if (allType.Equals("xAxis1_splitArea")) ImportColorList((chart as CoordinateChart).xAxis1.splitArea.color, colorList);
else if (allType.Equals("yAxis0_splitArea")) ImportColorList((chart as CoordinateChart).yAxis0.splitArea.color, colorList);
else if (allType.Equals("yAxis1_splitArea")) ImportColorList((chart as CoordinateChart).yAxis1.splitArea.color, colorList);
else if (allType.Equals("xAxis0_splitLine")) (chart as CoordinateChart).xAxis0.splitLine.lineStyle.color = colorList[0];
else if (allType.Equals("xAxis1_splitLine")) (chart as CoordinateChart).xAxis1.splitLine.lineStyle.color = colorList[0];
else if (allType.Equals("yAxis0_splitLine")) (chart as CoordinateChart).yAxis0.splitLine.lineStyle.color = colorList[0];
else if (allType.Equals("yAxis1_splitLine")) (chart as CoordinateChart).yAxis1.splitLine.lineStyle.color = colorList[0];
else if (strType.Equals("vessel")) ImportVesselColor(chart, int.Parse(temp2[1]), colorList); //没有LiquidChart的版本该行可以注释掉。
else if (strType.Equals("radarSplitLine")) ImportRadarSplitLineColor(chart, int.Parse(temp2[1]), colorList);
else if (strType.Equals("radarSplitArea")) ImportRadarSplitAreaColor(chart, int.Parse(temp2[1]), colorList);
else if (strType.Equals("serie"))
{
var index = int.Parse(temp2[1]);
var strSubType = temp2[2];
var serie = chart.series.GetSerie(index);
if (strSubType.Equals("lineStyle")) serie.lineStyle.color = colorList[0];
else if (strSubType.Equals("areaStyle")) ImportSerieAreaColor(serie.areaStyle, colorList);
else if (strSubType.Equals("label")) ImportLabelColor(serie.label, colorList);
else if (strSubType.Equals("labelEmphasis")) ImportLabelColor(serie.emphasis.label, colorList);
else if (strSubType.Equals("itemStyle")) ImportItemStyleColor(serie.itemStyle, colorList);
else if (strSubType.Equals("itemStyleEmphasis")) ImportItemStyleColor(serie.emphasis.itemStyle, colorList);
else if (strSubType.Equals("gaugeAxisLine")) ImportGaugeAxisLineColor(serie.gaugeAxis, colorList);
else if (strSubType.Equals("gaugeSplitLine")) serie.gaugeAxis.splitLine.lineStyle.color = colorList[0];
else if (strSubType.Equals("gaugeAxisTick")) serie.gaugeAxis.axisTick.lineStyle.color = colorList[0];
}
else if (strType.Equals("serieData"))
{
var index = int.Parse(temp2[1]);
var dataIndex = int.Parse(temp2[2]);
var strSubType = temp2[3];
var serieData = chart.series.GetSerie(index).GetSerieData(dataIndex);
if (strSubType.Equals("label")) ImportLabelColor(serieData.label, colorList);
else if (strSubType.Equals("labelEmphasis")) ImportLabelColor(serieData.emphasis.label, colorList);
else if (strSubType.Equals("itemStyle")) ImportItemStyleColor(serieData.itemStyle, colorList);
else if (strSubType.Equals("itemStyleEmphasis")) ImportItemStyleColor(serieData.emphasis.itemStyle, colorList);
}
chart.RefreshChart();
}
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
Debug.LogFormat("ImportColorConfig DONE: {0} charts.", chartSet.Count);
}
private static void ExportCoordinateChart(StringBuilder sb, CoordinateChart chart)
{
var instanceId = chart.GetInstanceID();
if (chart.visualMap.show)
{
AppendColor(sb, instanceId, "visualMap", chart.visualMap.inRange);
}
if (chart.xAxis0.show)
{
if (chart.xAxis0.splitArea.show)
AppendColor(sb, instanceId, "xAxis0_splitArea", chart.xAxis0.splitArea.color);
if (chart.xAxis0.splitLine.show)
AppendColor(sb, instanceId, "xAxis0_splitLine", chart.xAxis0.splitLine.lineStyle.color);
}
if (chart.xAxis1.show)
{
if (chart.xAxis1.splitArea.show)
AppendColor(sb, instanceId, "xAxis1_splitArea", chart.xAxis1.splitArea.color);
if (chart.xAxis1.splitLine.show)
AppendColor(sb, instanceId, "xAxis1_splitLine", chart.xAxis1.splitLine.lineStyle.color);
}
if (chart.yAxis0.show)
{
if (chart.yAxis0.splitArea.show)
AppendColor(sb, instanceId, "yAxis0_splitArea", chart.yAxis0.splitArea.color);
if (chart.yAxis0.splitLine.show)
AppendColor(sb, instanceId, "yAxis0_splitLine", chart.yAxis0.splitLine.lineStyle.color);
}
if (chart.yAxis1.show)
{
if (chart.yAxis1.splitArea.show)
AppendColor(sb, instanceId, "yAxis1_splitArea", chart.yAxis1.splitArea.color);
if (chart.yAxis1.splitLine.show)
AppendColor(sb, instanceId, "yAxis1_splitLine", chart.yAxis1.splitLine.lineStyle.color);
}
ExportSeries(sb, chart);
}
/// <summary>
/// LiquidChart不在该版本时整个函数可以注释掉
/// </summary>
private static void ExportLiquidChart(StringBuilder sb, LiquidChart chart)
{
var instanceId = chart.GetInstanceID();
var key = "vessel_";
for (int i = 0; i < chart.vessels.Count; i++)
{
var vessel = chart.vessels[i];
AppendColor(sb, instanceId, key + i, vessel.color, vessel.backgroundColor);
}
ExportSeries(sb, chart);
}
private static void ExportRadarChart(StringBuilder sb, RadarChart chart)
{
var instanceId = chart.GetInstanceID();
for (int i = 0; i < chart.radars.Count; i++)
{
var radar = chart.radars[i];
AppendColor(sb, instanceId, "radarSplitLine_" + i, radar.splitLine.lineStyle.color);
AppendColor(sb, instanceId, "radarSplitArea_" + i, radar.splitArea.color);
}
ExportSeries(sb, chart);
}
private static void ExportSeries(StringBuilder sb, BaseChart chart)
{
var instanceId = chart.GetInstanceID();
for (int i = 0; i < chart.series.list.Count; i++)
{
var serie = chart.series.GetSerie(i);
var key = "serie_" + i;
AppendColor(sb, instanceId, key + "_itemStyle", serie.itemStyle.color, serie.itemStyle.toColor, serie.itemStyle.toColor2, serie.itemStyle.backgroundColor, serie.itemStyle.borderColor);
AppendColor(sb, instanceId, key + "_label", serie.label.backgroundColor, serie.label.borderColor);
AppendColor(sb, instanceId, key + "_itemStyleEmphasis", serie.emphasis.itemStyle.color, serie.emphasis.itemStyle.toColor, serie.emphasis.itemStyle.toColor2, serie.emphasis.itemStyle.backgroundColor, serie.emphasis.itemStyle.borderColor);
AppendColor(sb, instanceId, key + "_labelEmphasis", serie.emphasis.label.backgroundColor, serie.emphasis.label.borderColor);
if (serie.type == SerieType.Line)
{
AppendColor(sb, instanceId, key + "_lineStyle", serie.lineStyle.color);
AppendColor(sb, instanceId, key + "_areaStyle", serie.areaStyle.color, serie.areaStyle.toColor, serie.areaStyle.highlightColor, serie.areaStyle.highlightToColor);
}
if (serie.type == SerieType.Gauge)
{
var axisLineColors = new List<Color>();
axisLineColors.Add(serie.gaugeAxis.axisLine.barColor);
axisLineColors.Add(serie.gaugeAxis.axisLine.barBackgroundColor);
for (int n = 0; n < serie.gaugeAxis.axisLine.stageColor.Count; n++)
{
axisLineColors.Add(serie.gaugeAxis.axisLine.stageColor[n].color);
}
AppendColor(sb, instanceId, key + "_gaugeAxisLine", axisLineColors);
AppendColor(sb, instanceId, key + "_gaugeSplitLine", serie.gaugeAxis.splitLine.lineStyle.color);
AppendColor(sb, instanceId, key + "_gaugeAxisTick", serie.gaugeAxis.axisTick.lineStyle.color);
}
for (int j = 0; j < serie.dataCount; j++)
{
key = string.Format("serieData_{0}_{1}", i, j);
var serieData = serie.GetSerieData(j);
if (serieData.enableItemStyle)
AppendColor(sb, instanceId, key + "_itemStyle", serieData.itemStyle.color, serieData.itemStyle.toColor, serieData.itemStyle.toColor2, serieData.itemStyle.backgroundColor, serieData.itemStyle.borderColor);
if (serieData.enableLabel)
AppendColor(sb, instanceId, key + "_label", serieData.label.backgroundColor, serieData.label.borderColor);
if (serieData.enableEmphasis)
AppendColor(sb, instanceId, key + "_itemStyleEmphasis", serieData.emphasis.itemStyle.color, serieData.emphasis.itemStyle.toColor, serieData.emphasis.itemStyle.toColor2, serieData.emphasis.itemStyle.backgroundColor, serieData.emphasis.itemStyle.borderColor);
if (serieData.enableEmphasis)
AppendColor(sb, instanceId, key + "_labelEmphasis", serieData.emphasis.label.backgroundColor, serieData.emphasis.label.borderColor);
}
}
}
private static void ExportGague(GaugeAxis gauge, StringBuilder sb)
{
}
private static void AppendColor(StringBuilder sb, int instanceId, string key, List<Color> list)
{
if (list.Count <= 0) return;
sb.AppendFormat("{0}={1}=", instanceId, key);
for (int i = 0; i < list.Count; i++)
{
sb.AppendFormat("{0}|", GetColorRGBA(list[i]));
}
sb.Append("\n");
}
private static void AppendColor(StringBuilder sb, int instanceId, string key, params Color[] color)
{
sb.AppendFormat("{0}={1}=", instanceId, key);
for (int i = 0; i < color.Length; i++)
{
sb.AppendFormat("{0}|", GetColorRGBA(color[i]));
}
sb.Append("\n");
}
private static void AppendColor(StringBuilder sb, int instanceId, string key, List<Color32> list)
{
if (list.Count <= 0) return;
sb.AppendFormat("{0}={1}=", instanceId, key);
for (int i = 0; i < list.Count; i++)
{
sb.AppendFormat("{0}|", GetColorRGBA(list[i]));
}
sb.Append("\n");
}
private static string GetColorRGBA(Color color)
{
Color32 color32 = color;
return string.Format("{0},{1},{2},{3}", color32.r, color32.g, color32.b, color32.a);
}
private static List<Color32> ConvertToColorList(string strInfo)
{
var temp = strInfo.Split('|');
var list = new List<Color32>();
for (int i = 0; i < temp.Length; i++)
{
if (!string.IsNullOrEmpty(temp[i]))
{
var temp2 = temp[i].Split(',');
var r = byte.Parse(temp2[0]);
var g = byte.Parse(temp2[1]);
var b = byte.Parse(temp2[2]);
var a = byte.Parse(temp2[3]);
list.Add(new Color32(r, g, b, a));
}
}
return list;
}
private static void ImportColorList(List<Color32> target, List<Color32> colorList)
{
target.Clear();
for (int i = 0; i < colorList.Count; i++)
{
target.Add(colorList[i]);
}
}
private static void ImportColorList(List<Color> target, List<Color32> colorList)
{
target.Clear();
for (int i = 0; i < colorList.Count; i++)
{
target.Add(colorList[i]);
}
}
private static void ImportSerieAreaColor(AreaStyle areaStyle, List<Color32> colorList)
{
areaStyle.color = colorList[0];
areaStyle.toColor = colorList[1];
areaStyle.highlightColor = colorList[2];
areaStyle.highlightToColor = colorList[3];
}
private static void ImportLabelColor(SerieLabel label, List<Color32> colorList)
{
label.backgroundColor = colorList[0];
label.borderColor = colorList[1];
}
private static void ImportItemStyleColor(ItemStyle itemStyle, List<Color32> colorList)
{
itemStyle.color = colorList[0];
itemStyle.toColor = colorList[1];
itemStyle.toColor2 = colorList[2];//没有toColor2的版本可以注释掉改行
itemStyle.backgroundColor = colorList[3];
itemStyle.borderColor = colorList[4];
}
private static void ImportGaugeAxisLineColor(GaugeAxis gauge, List<Color32> colorList)
{
gauge.axisLine.barColor = colorList[0];
gauge.axisLine.barBackgroundColor = colorList[1];
for (int i = 2; i < colorList.Count; i++)
{
gauge.axisLine.stageColor[i - 2].color = colorList[i];
}
}
/// <summary>
/// 没有LiquidChart的版本这个函数可以注释掉
/// </summary>
/// <param name="chart"></param>
/// <param name="index"></param>
/// <param name="colorList"></param>
private static void ImportVesselColor(BaseChart chart, int index, List<Color32> colorList)
{
var vessel = (chart as LiquidChart).GetVessel(index);
vessel.color = colorList[0];
vessel.backgroundColor = colorList[1];
}
private static void ImportRadarSplitLineColor(BaseChart chart, int index, List<Color32> colorList)
{
var radar = (chart as RadarChart).GetRadar(index);
radar.splitLine.lineStyle.color = colorList[0];
}
private static void ImportRadarSplitAreaColor(BaseChart chart, int index, List<Color32> colorList)
{
var radar = (chart as RadarChart).GetRadar(index);
ImportColorList(radar.splitArea.color, colorList);
}
}
}

View File

@@ -1,326 +0,0 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
public class ChartEditorHelper
{
#if UNITY_2019_3_OR_NEWER
public const float INDENT_WIDTH = 15;
public const float BOOL_WIDTH = 15;
public const float ARROW_WIDTH = 20;
public const float GAP_WIDTH =2;
#else
public const float INDENT_WIDTH = 15;
public const float BOOL_WIDTH = 15;
public const float ARROW_WIDTH = 13;
public const float GAP_WIDTH = 0;
#endif
public static GUIStyle headerStyle = EditorStyles.boldLabel;
public static GUIStyle foldoutStyle = new GUIStyle(EditorStyles.foldout)
{
font = headerStyle.font,
fontStyle = headerStyle.fontStyle,
};
public static void SecondField(Rect drawRect, SerializedProperty prop)
{
RectOffset offset = new RectOffset(-(int)EditorGUIUtility.labelWidth, 0, 0, 0);
drawRect = offset.Add(drawRect);
EditorGUI.PropertyField(drawRect, prop, GUIContent.none);
drawRect = offset.Remove(drawRect);
}
public static void MakeTwoField(ref Rect drawRect, float rectWidth, SerializedProperty arrayProp, string name)
{
while (arrayProp.arraySize < 2) arrayProp.arraySize++;
MakeTwoField(ref drawRect, rectWidth, arrayProp.GetArrayElementAtIndex(0), arrayProp.GetArrayElementAtIndex(1), name);
}
public static void MakeDivideList(ref Rect drawRect, float rectWidth, SerializedProperty arrayProp, string name, int showNum)
{
while (arrayProp.arraySize < showNum) arrayProp.arraySize++;
EditorGUI.LabelField(drawRect, name);
#if UNITY_2019_3_OR_NEWER
var gap = 2;
#else
var gap = 0;
#endif
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + gap;
var dataWidTotal = (rectWidth - (startX + INDENT_WIDTH + 1));
EditorGUI.DrawRect(new Rect(startX, drawRect.y, dataWidTotal, drawRect.height), Color.grey);
var dataWid = dataWidTotal / showNum;
var xWid = dataWid - gap;
for (int i = 0; i < 1; i++)
{
drawRect.x = startX + i * xWid;
drawRect.width = dataWid + (EditorGUI.indentLevel - 2) * 40.5f;
EditorGUI.PropertyField(drawRect, arrayProp.GetArrayElementAtIndex(i), GUIContent.none);
}
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
public static void MakeTwoField(ref Rect drawRect, float rectWidth, SerializedProperty prop1, SerializedProperty prop2, string name)
{
EditorGUI.LabelField(drawRect, name);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + GAP_WIDTH;
var diff = 14 + EditorGUI.indentLevel * 14;
var offset = diff - INDENT_WIDTH;
var tempWidth = (rectWidth - startX + diff) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - offset, drawRect.y, tempWidth, drawRect.height);
EditorGUI.PropertyField(centerXRect, prop1, GUIContent.none);
EditorGUI.PropertyField(centerYRect, prop2, GUIContent.none);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
public static void MakeVector2(ref Rect drawRect, float rectWidth, SerializedProperty prop, string name)
{
EditorGUI.LabelField(drawRect, name);
var startX = drawRect.x + EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + GAP_WIDTH;
var diff = 14 + EditorGUI.indentLevel * 14;
var offset = diff - INDENT_WIDTH;
var tempWidth = (rectWidth - startX + diff) / 2;
var centerXRect = new Rect(startX, drawRect.y, tempWidth, drawRect.height);
var centerYRect = new Rect(centerXRect.x + tempWidth - offset, drawRect.y, tempWidth, drawRect.height);
var x = EditorGUI.FloatField(centerXRect, prop.vector3Value.x);
var y = EditorGUI.FloatField(centerYRect, prop.vector3Value.y);
prop.vector3Value = new Vector3(x, y);
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
}
public static void MakeJsonData(ref Rect drawRect, ref bool showTextArea, ref string inputString,
SerializedProperty prop, float currentWidth, float diff = 0)
{
SerializedProperty stringDataProp = prop.FindPropertyRelative("m_JsonData");
SerializedProperty needParseProp = prop.FindPropertyRelative("m_DataFromJson");
float defalutX = drawRect.x;
drawRect.x = EditorGUIUtility.labelWidth + ARROW_WIDTH + diff;
drawRect.width = currentWidth - EditorGUIUtility.labelWidth - GAP_WIDTH - diff;
if (GUI.Button(drawRect, new GUIContent("Parse JsonData", "Parse data from input json")))
{
showTextArea = !showTextArea;
bool needParse = !showTextArea;
if (needParse)
{
stringDataProp.stringValue = inputString;
needParseProp.boolValue = true;
}
}
drawRect.x = defalutX;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (showTextArea)
{
drawRect.width = currentWidth;
drawRect.height = EditorGUIUtility.singleLineHeight * 4;
inputString = EditorGUI.TextArea(drawRect, inputString);
drawRect.y += EditorGUIUtility.singleLineHeight * 4 + EditorGUIUtility.standardVerticalSpacing;
drawRect.height = EditorGUIUtility.singleLineHeight;
}
}
public static bool MakeFoldout(ref Rect drawRect, ref bool moduleToggle, string content,
SerializedProperty prop = null, bool bold = true)
{
float defaultWidth = drawRect.width;
float defaultX = drawRect.x;
drawRect.width = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH;
moduleToggle = EditorGUI.Foldout(drawRect, moduleToggle, content, bold ? foldoutStyle : EditorStyles.foldout);
MakeBool(drawRect, prop);
drawRect.width = defaultWidth;
drawRect.x = defaultX;
return moduleToggle;
}
public static void MakeBool(Rect drawRect, SerializedProperty boolProp, int index = 0, string name = null)
{
float defaultWidth = drawRect.width;
float defaultX = drawRect.x;
float boolWidth = index * (BOOL_WIDTH + GAP_WIDTH);
drawRect.x = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + ARROW_WIDTH + boolWidth;
drawRect.width = (EditorGUI.indentLevel + 1) * BOOL_WIDTH + index * 110;
if (boolProp != null)
{
EditorGUI.PropertyField(drawRect, boolProp, GUIContent.none);
if (!string.IsNullOrEmpty(name))
{
drawRect.x += BOOL_WIDTH;
drawRect.width = 200;
EditorGUI.LabelField(drawRect, name);
}
}
drawRect.width = defaultWidth;
drawRect.x = defaultX;
}
public static bool MakeFoldout(ref Rect drawRect, ref Dictionary<string, bool> moduleToggle, SerializedProperty prop,
string moduleName, SerializedProperty showProp = null, bool bold = true)
{
var key = prop.propertyPath;
if (!moduleToggle.ContainsKey(key))
{
moduleToggle.Add(key, false);
}
var toggle = moduleToggle[key];
float defaultWidth = drawRect.width;
float defaultX = drawRect.x;
#if UNITY_2019_3_OR_NEWER
drawRect.width = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH;
#else
drawRect.width = EditorGUIUtility.labelWidth;
#endif
var displayName = string.IsNullOrEmpty(moduleName) ? prop.displayName : moduleName;
toggle = EditorGUI.Foldout(drawRect, toggle, displayName, bold ? foldoutStyle : EditorStyles.foldout);
if (moduleToggle[key] != toggle)
{
moduleToggle[key] = toggle;
}
if (showProp != null)
{
drawRect.x = EditorGUIUtility.labelWidth - EditorGUI.indentLevel * INDENT_WIDTH + ARROW_WIDTH;
if (showProp.propertyType == SerializedPropertyType.Boolean)
{
drawRect.width = (EditorGUI.indentLevel + 1) * BOOL_WIDTH;
}
else
{
drawRect.width = defaultWidth - drawRect.x + ARROW_WIDTH - GAP_WIDTH;
}
EditorGUI.PropertyField(drawRect, showProp, GUIContent.none);
}
drawRect.width = defaultWidth;
drawRect.x = defaultX;
return toggle;
}
public static void MakeList(ref Rect drawRect, ref int listSize, SerializedProperty listProp, bool showOrder = false, bool showSize = true)
{
EditorGUI.indentLevel++;
listSize = listProp.arraySize;
if (showSize)
{
if (showOrder)
{
var nameWid = 15;
var temp = INDENT_WIDTH + GAP_WIDTH;
var elementRect = new Rect(drawRect.x, drawRect.y, drawRect.width - nameWid - 1, drawRect.height);
var iconRect = new Rect(drawRect.width - nameWid + temp, drawRect.y, nameWid, drawRect.height);
if (GUI.Button(iconRect, new GUIContent("+", "add")))
{
listProp.arraySize++;
}
listSize = listProp.arraySize;
listSize = EditorGUI.IntField(elementRect, "Size", listSize);
}
else
{
listSize = EditorGUI.IntField(drawRect, "Size", listSize);
}
if (listSize < 0) listSize = 0;
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
if (listSize != listProp.arraySize)
{
while (listSize > listProp.arraySize) listProp.arraySize++;
while (listSize < listProp.arraySize) listProp.arraySize--;
}
}
if (listSize > 30)
{
SerializedProperty element;
int num = listSize > 10 ? 10 : listSize;
for (int i = 0; i < num; i++)
{
element = listProp.GetArrayElementAtIndex(i);
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + i));
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
}
if (num >= 10)
{
EditorGUI.LabelField(drawRect, "...");
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
element = listProp.GetArrayElementAtIndex(listSize - 1);
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + (listSize - 1)));
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
}
}
else
{
for (int i = 0; i < listProp.arraySize; i++)
{
SerializedProperty element = listProp.GetArrayElementAtIndex(i);
if (showOrder)
{
var nameWid = 15;
var temp = INDENT_WIDTH + GAP_WIDTH;
var isSerie = "Serie".Equals(element.type);
var elementRect = isSerie ? drawRect : new Rect(drawRect.x, drawRect.y, drawRect.width - 2 * nameWid, drawRect.height);
EditorGUI.PropertyField(elementRect, element, new GUIContent("Element " + i));
var iconRect = new Rect(drawRect.width - 3 * nameWid + temp, drawRect.y, nameWid, drawRect.height);
if (GUI.Button(iconRect, new GUIContent("↑", "up")))
{
if (i > 0) listProp.MoveArrayElement(i, i - 1);
}
iconRect = new Rect(drawRect.width - 2 * nameWid + temp, drawRect.y, nameWid, drawRect.height);
if (GUI.Button(iconRect, new GUIContent("↓", "down")))
{
if (i < listProp.arraySize - 1) listProp.MoveArrayElement(i, i + 1);
}
iconRect = new Rect(drawRect.width - nameWid + temp, drawRect.y, nameWid, drawRect.height);
if (GUI.Button(iconRect, new GUIContent("-", "delete")))
{
if (i < listProp.arraySize && i >= 0) listProp.DeleteArrayElementAtIndex(i);
}
else
{
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
}
}
else
{
EditorGUI.PropertyField(drawRect, element, new GUIContent("Element " + i));
drawRect.y += EditorGUI.GetPropertyHeight(element) + EditorGUIUtility.standardVerticalSpacing;
}
}
}
EditorGUI.indentLevel--;
}
public static int InitModuleToggle(ref List<bool> moduleToggle, SerializedProperty prop)
{
int index = 0;
var temp = prop.displayName.Split(' ');
if (temp == null || temp.Length < 2)
{
index = 0;
}
else
{
int.TryParse(temp[1], out index);
}
if (index >= moduleToggle.Count)
{
moduleToggle.Add(false);
}
return index;
}
public static int GetIndexFromPath(SerializedProperty prop)
{
int index = 0;
var sindex = prop.propertyPath.LastIndexOf('[');
var eindex = prop.propertyPath.LastIndexOf(']');
if (sindex >= 0 && eindex >= 0)
{
var str = prop.propertyPath.Substring(sindex + 1, eindex - sindex - 1);
int.TryParse(str, out index);
}
return index;
}
public static bool IsToggle(Dictionary<string, bool> toggle, SerializedProperty prop)
{
return toggle.ContainsKey(prop.propertyPath) && toggle[prop.propertyPath] == true;
}
}

View File

@@ -1,145 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
namespace XCharts
{
public class XChartEditor : EditorWindow
{
private static Transform GetParent()
{
GameObject selectObj = Selection.activeGameObject;
if (selectObj == null)
{
var canvas = GameObject.FindObjectOfType<Canvas>();
if (canvas != null) return canvas.transform;
else
{
var canvasObject = new GameObject();
canvasObject.name = "Canvas";
canvas = canvasObject.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
canvasObject.AddComponent<CanvasScaler>();
canvasObject.AddComponent<GraphicRaycaster>();
var eventSystem = new GameObject();
eventSystem.name = "EventSystem";
eventSystem.AddComponent<EventSystem>();
eventSystem.AddComponent<StandaloneInputModule>();
return canvas.transform;
}
}
else
{
return selectObj.transform;
}
}
private static string GetName(Transform parent, string name)
{
if (parent.Find(name) == null) return name;
for (int i = 1; i <= 10; i++)
{
var newName = string.Format("{0} ({1})", name, i);
if (parent.Find(newName) == null)
{
return newName;
}
}
return name;
}
private static void AddChart<T>(string chartName) where T : BaseChart
{
var parent = GetParent();
if (parent == null) return;
var chart = new GameObject();
chart.name = GetName(parent, chartName);
chart.AddComponent<T>();
chart.transform.SetParent(parent);
chart.transform.localScale = Vector3.one;
chart.transform.localPosition = Vector3.zero;
var rect = chart.GetComponent<RectTransform>();
rect.anchorMin = new Vector2(0.5f, 0.5f);
rect.anchorMax = new Vector2(0.5f, 0.5f);
rect.pivot = new Vector2(0.5f, 0.5f);
}
[MenuItem("XCharts/LineChart", priority = 44)]
[MenuItem("GameObject/XCharts/LineChart", priority = 44)]
public static void AddLineChart()
{
AddChart<LineChart>("LineChart");
}
[MenuItem("XCharts/BarChart", priority = 45)]
[MenuItem("GameObject/XCharts/BarChart", priority = 45)]
public static void AddBarChart()
{
AddChart<BarChart>("BarChart");
}
[MenuItem("XCharts/PieChart", priority = 46)]
[MenuItem("GameObject/XCharts/PieChart", priority = 46)]
public static void AddPieChart()
{
AddChart<PieChart>("PieChart");
}
[MenuItem("XCharts/RadarChart", priority = 47)]
[MenuItem("GameObject/XCharts/RadarChart", priority = 47)]
public static void AddRadarChart()
{
AddChart<RadarChart>("RadarChart");
}
[MenuItem("XCharts/ScatterChart", priority = 48)]
[MenuItem("GameObject/XCharts/ScatterChart", priority = 48)]
public static void AddScatterChart()
{
AddChart<ScatterChart>("ScatterChart");
}
[MenuItem("XCharts/HeatmapChart", priority = 49)]
[MenuItem("GameObject/XCharts/HeatmapChart", priority = 49)]
public static void AddHeatmapChart()
{
AddChart<HeatmapChart>("HeatmapChart");
}
[MenuItem("XCharts/GaugeChart", priority = 50)]
[MenuItem("GameObject/XCharts/GaugeChart", priority = 50)]
public static void AddGaugeChart()
{
AddChart<GaugeChart>("GaugeChart");
}
[MenuItem("XCharts/RingChart", priority = 51)]
[MenuItem("GameObject/XCharts/RingChart", priority = 51)]
public static void AddRingChart()
{
AddChart<RingChart>("RingChart");
}
[MenuItem("XCharts/PolarChart", priority = 52)]
[MenuItem("GameObject/XCharts/PolarChart", priority = 52)]
public static void AddPolarChart()
{
AddChart<PolarChart>("PolarChart");
}
[MenuItem("XCharts/LiquidChart", priority = 53)]
[MenuItem("GameObject/XCharts/LiquidChart", priority = 53)]
public static void AddLiquidChart()
{
AddChart<LiquidChart>("LiquidChart");
}
}
}

View File

@@ -1,62 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEditor;
using UnityEngine;
namespace XCharts
{
/// <summary>
/// Editor class used to edit UI XChartsMgr.
/// </summary>
[CustomEditor(typeof(XChartsMgr), false)]
public class XChartsMgrEditor : Editor
{
protected XChartsMgr m_Target;
protected SerializedProperty m_Script;
protected SerializedProperty m_NowVersion;
protected SerializedProperty m_NewVersion;
protected virtual void OnEnable()
{
m_Target = (XChartsMgr)target;
m_Script = serializedObject.FindProperty("m_Script");
m_NowVersion = serializedObject.FindProperty("m_NowVersion");
m_NewVersion = serializedObject.FindProperty("m_NewVersion");
}
public override void OnInspectorGUI()
{
if (m_Target == null && target == null)
{
base.OnInspectorGUI();
return;
}
serializedObject.Update();
EditorGUILayout.PropertyField(m_NowVersion);
EditorGUILayout.PropertyField(m_NewVersion);
if (GUILayout.Button("检测更新"))
{
CheckVersionEditor.ShowWindow();
}
if (GUILayout.Button("去Github主页"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts");
}
if (GUILayout.Button("点Star支持"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/stargazers");
}
if (GUILayout.Button("问题反馈"))
{
Application.OpenURL("https://github.com/monitor1394/unity-ugui-XCharts/issues");
}
serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -1,310 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
public class Example00_CheatSheet : MonoBehaviour
{
private LineChart chart;
private float speed = 100f;
void Awake()
{
LoopDemo();
}
private void OnEnable()
{
LoopDemo();
}
void LoopDemo()
{
StopAllCoroutines();
StartCoroutine(CheatSheet());
}
IEnumerator CheatSheet()
{
StartCoroutine(InitChart());
StartCoroutine(ComponentTitle());
yield return new WaitForSeconds(2);
StartCoroutine(ComponentAxis());
yield return new WaitForSeconds(2);
StartCoroutine(ComponentGrid());
yield return new WaitForSeconds(2);
StartCoroutine(ComponentSerie());
yield return new WaitForSeconds(4);
StartCoroutine(ComponentLegend());
yield return new WaitForSeconds(4);
StartCoroutine(ComponentTheme());
yield return new WaitForSeconds(4);
StartCoroutine(ComponentDataZoom());
yield return new WaitForSeconds(5);
StartCoroutine(ComponentVisualMap());
yield return new WaitForSeconds(3);
LoopDemo();
}
IEnumerator InitChart()
{
chart = gameObject.GetComponent<LineChart>();
if (chart == null) gameObject.AddComponent<LineChart>();
chart.title.show = true;
chart.title.text = "术语解析-组件";
chart.grid.bottom = 30;
chart.grid.right = 30;
chart.grid.left = 50;
chart.grid.top = 80;
chart.dataZoom.enable = false;
chart.visualMap.enable = false;
chart.RemoveData();
chart.AddSerie(SerieType.Bar, "Bar");
chart.AddSerie(SerieType.Line, "Line");
for (int i = 0; i < 8; i++)
{
chart.AddXAxisData("x" + (i + 1));
chart.AddData(0, Random.Range(10, 100));
chart.AddData(1, Random.Range(30, 100));
}
yield return null;
}
IEnumerator ComponentTitle()
{
chart.title.text = "术语解析 - 组件";
chart.title.subText = "Title 标题:可指定主标题和子标题";
chart.xAxis0.show = true;
chart.yAxis0.show = true;
chart.series.list[0].show = false;
chart.series.list[1].show = false;
chart.legend.show = false;
for (int i = 0; i < 4; i++)
{
chart.title.show = !chart.title.show;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.title.show = true;
chart.RefreshChart();
}
IEnumerator ComponentAxis()
{
chart.title.subText = "Axis 坐标轴配置X和Y轴的轴线、刻度、标签等样式外观配置";
chart.series.list[0].show = false;
chart.series.list[1].show = false;
for (int i = 0; i < 4; i++)
{
chart.xAxis0.show = !chart.xAxis0.show;
chart.yAxis0.show = !chart.yAxis0.show;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.xAxis0.show = true;
chart.yAxis0.show = true;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
}
IEnumerator ComponentGrid()
{
chart.title.subText = "Grid 网格:调整坐标系边距和颜色等";
for (int i = 0; i < 4; i++)
{
chart.grid.backgroundColor = i % 2 == 0 ? Color.clear : Color.grey;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.grid.backgroundColor = Color.clear;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
}
IEnumerator ComponentSerie()
{
chart.title.subText = "Serie 系列:调整坐标系边距和颜色等";
chart.series.list[0].show = true;
chart.series.list[1].show = true;
chart.AnimationReset();
chart.RefreshChart();
yield return new WaitForSeconds(1.2f);
for (int i = 0; i < 4; i++)
{
chart.series.list[0].show = !chart.series.list[0].show;
chart.series.list[1].show = !chart.series.list[1].show;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.series.list[0].show = true;
chart.series.list[1].show = true;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
}
IEnumerator ComponentLegend()
{
chart.title.subText = "Legend 图例:展示不同系列的名字和颜色,可控制系列显示等";
chart.legend.show = true;
chart.grid.top = 80;
chart.legend.location.top = 50;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
for (int i = 0; i < 4; i++)
{
chart.legend.show = !chart.legend.show;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.legend.show = true;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
chart.ClickLegendButton(0, "Line", false);
yield return new WaitForSeconds(0.2f);
chart.ClickLegendButton(0, "Line", true);
yield return new WaitForSeconds(0.5f);
chart.ClickLegendButton(1, "Bar", false);
yield return new WaitForSeconds(0.2f);
chart.ClickLegendButton(1, "Bar", true);
yield return new WaitForSeconds(0.5f);
}
IEnumerator ComponentTheme()
{
chart.title.subText = "Theme 主题:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
yield return new WaitForSeconds(1f);
chart.title.subText = "Theme 主题Light主题";
chart.UpdateTheme(Theme.Light);
yield return new WaitForSeconds(1f);
chart.title.subText = "Theme 主题Dark主题";
chart.UpdateTheme(Theme.Dark);
yield return new WaitForSeconds(1f);
chart.title.subText = "Theme 主题Default主题";
chart.UpdateTheme(Theme.Default);
yield return new WaitForSeconds(1f);
}
IEnumerator ComponentDataZoom()
{
chart.title.subText = "DataZoom 区域缩放:可通过拖、拽、缩小、放大来观察细节数据";
chart.grid.bottom = 70;
chart.dataZoom.enable = true;
chart.dataZoom.supportInside = true;
chart.dataZoom.supportSlider = true;
chart.dataZoom.height = 30;
chart.dataZoom.start = 0;
chart.dataZoom.end = 100;
chart.RefreshChart();
for (int i = 0; i < 4; i++)
{
chart.dataZoom.supportSlider = !chart.dataZoom.supportSlider;
chart.RefreshChart();
yield return new WaitForSeconds(0.2f);
}
chart.dataZoom.supportSlider = true;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
while (chart.dataZoom.start < 40)
{
chart.dataZoom.start += speed * Time.deltaTime * 0.8f;
chart.RefreshDataZoom();
chart.RefreshChart();
yield return null;
}
while (chart.dataZoom.end > 60)
{
chart.dataZoom.end -= speed * Time.deltaTime * 0.8f;
chart.RefreshDataZoom();
chart.RefreshChart();
yield return null;
}
while (chart.dataZoom.start > 0)
{
chart.dataZoom.start -= speed * Time.deltaTime * 0.8f;
chart.dataZoom.end -= speed * Time.deltaTime * 0.8f;
chart.RefreshDataZoom();
chart.RefreshChart();
yield return null;
}
while (chart.dataZoom.end < 100)
{
chart.dataZoom.start += speed * Time.deltaTime * 0.8f;
chart.dataZoom.end += speed * Time.deltaTime * 0.8f;
chart.RefreshDataZoom();
chart.RefreshChart();
yield return null;
}
while (chart.dataZoom.start > 0 || chart.dataZoom.end < 100)
{
chart.dataZoom.start -= speed * Time.deltaTime * 0.8f;
chart.dataZoom.end += speed * Time.deltaTime * 0.8f;
chart.RefreshDataZoom();
chart.RefreshChart();
yield return null;
}
}
IEnumerator ComponentVisualMap()
{
chart.title.subText = "VisualMap 视觉映射:可从全局上配置图表的颜色、字体等效果,支持默认主题切换";
chart.visualMap.enable = true;
chart.visualMap.show = true;
chart.visualMap.orient = Orient.Vertical;
chart.visualMap.calculable = true;
chart.visualMap.min = 0;
chart.visualMap.max = 100;
chart.visualMap.range[0] = 0;
chart.visualMap.range[1] = 100;
var colors = new List<string>{"#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf",
"#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"};
chart.visualMap.inRange.Clear();
foreach (var str in colors)
{
chart.visualMap.inRange.Add(ThemeInfo.GetColor(str));
}
chart.grid.left = 80;
chart.grid.bottom = 100;
chart.RefreshChart();
yield return new WaitForSeconds(1f);
while (chart.visualMap.rangeMin < 40)
{
chart.visualMap.rangeMin += speed * Time.deltaTime;
chart.RefreshChart();
yield return null;
}
while (chart.visualMap.rangeMax > 60)
{
chart.visualMap.rangeMax -= speed * Time.deltaTime;
chart.RefreshChart();
yield return null;
}
while (chart.visualMap.rangeMin > 0 || chart.visualMap.rangeMax < 100)
{
chart.visualMap.rangeMin -= speed * Time.deltaTime;
chart.visualMap.rangeMax += speed * Time.deltaTime;
chart.RefreshChart();
yield return null;
}
}
}
}

View File

@@ -1,52 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example01_UpdateData : MonoBehaviour
{
private float updateTime = 0;
BaseChart chart;
void Awake()
{
chart = gameObject.GetComponent<BaseChart>();
}
void Update()
{
updateTime += Time.deltaTime;
if (chart && updateTime > 2)
{
updateTime = 0;
var serie = chart.series.GetSerie(0);
//serie.animation.dataChangeEnable = true;
var dataCount = serie.dataCount;
if (chart is RadarChart)
{
var dimension = serie.GetSerieData(0).data.Count - 1;
chart.UpdateData(0, 0, Random.Range(0, dimension + 1), Random.Range(0, 100));
}
else if (chart is HeatmapChart)
{
var dimension = serie.GetSerieData(0).data.Count - 1;
for (int i = 0; i < dataCount; i++)
{
chart.UpdateData(0, i, dimension, Random.Range(0, 10));
}
}
else
{
chart.UpdateData(0, Random.Range(0, dataCount), Random.Range(10, 90));
}
}
}
}
}

View File

@@ -1,64 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using UnityEngine.EventSystems;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example02_ChartEvent : MonoBehaviour
{
BaseChart chart;
void Awake()
{
chart = gameObject.GetComponent<BaseChart>();
if (chart == null)
{
chart = gameObject.AddComponent<LineChart>();
}
chart.onPointerEnter = OnPointerEnter;
chart.onPointerExit = OnPointerExit;
chart.onPointerDown = OnPointerDown;
chart.onPointerUp = OnPointerUp;
chart.onPointerClick = OnPointerClick;
chart.onScroll = OnScroll;
}
void OnPointerEnter(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("enter:" + chart);
}
void OnPointerExit(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("exit:" + chart);
}
void OnPointerDown(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("down:" + chart);
}
void OnPointerUp(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("up:" + chart);
}
void OnPointerClick(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("click:" + chart);
}
void OnScroll(BaseGraph chart, PointerEventData eventData)
{
//Debug.LogError("scroll:" + chart);
}
}
}

View File

@@ -1,68 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example11_AddSinCurve : MonoBehaviour
{
private float time;
public int angle;
private LineChart chart;
void Awake()
{
chart = gameObject.GetComponent<LineChart>();
if (chart != null)
{
GameObject.DestroyImmediate(chart);
}
chart = gameObject.AddComponent<LineChart>();
chart.title.show = true;
chart.title.text = "Sin Curve";
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.Value;
chart.yAxises[0].type = Axis.AxisType.Value;
chart.xAxises[0].boundaryGap = false;
chart.xAxises[0].maxCache = 0;
chart.series.list[0].maxCache = 0;
chart.RemoveData();
var serie = chart.AddSerie(SerieType.Line);
serie.symbol.show = false;
serie.lineType = LineType.Normal;
for (angle = 0; angle < 1080; angle++)
{
float xvalue = Mathf.PI / 180 * angle;
float yvalue = Mathf.Sin(xvalue);
chart.AddData(0, xvalue, yvalue);
}
}
void Update()
{
if (angle > 3000) return;
angle++;
float xvalue = Mathf.PI / 180 * angle;
float yvalue = Mathf.Sin(xvalue);
chart.AddData(0, xvalue, yvalue);
}
}
}

View File

@@ -1,39 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using UnityEngine.UI;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example12_CustomDrawing : MonoBehaviour
{
LineChart chart;
void Awake()
{
chart = gameObject.GetComponent<LineChart>();
if (chart == null) return;
chart.onCustomDraw = 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,50 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example13_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);
chart.AddSerie(SerieType.Line);
for (int i = 0; i < 10; i++)
{
chart.AddXAxisData("x" + i);
chart.AddData(0, Random.Range(10, 20));
chart.AddData(1, Random.Range(10, 20));
}
}
}
}

View File

@@ -1,124 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
public class Example40_Radar : MonoBehaviour
{
private RadarChart chart;
private Serie serie, serie1;
void Awake()
{
LoopDemo();
}
private void OnEnable()
{
LoopDemo();
}
void LoopDemo()
{
StopAllCoroutines();
StartCoroutine(RadarDemo());
}
IEnumerator RadarDemo()
{
StartCoroutine(RadarAdd());
yield return new WaitForSeconds(2);
StartCoroutine(RadarUpdate());
yield return new WaitForSeconds(2);
StartCoroutine(RadarAddMultiple());
yield return new WaitForSeconds(2);
LoopDemo();
}
IEnumerator RadarAdd()
{
chart = gameObject.GetComponent<RadarChart>();
if (chart == null) chart = gameObject.AddComponent<RadarChart>();
chart.RemoveRadar();
chart.RemoveData();
chart.title.text = "RadarChart - 雷达图";
chart.title.subText = "";
chart.legend.show = true;
chart.legend.location.align = Location.Align.TopLeft;
chart.legend.location.top = 60;
chart.legend.location.left = 2;
chart.legend.itemWidth = 70;
chart.legend.itemHeight = 20;
chart.legend.orient = Orient.Vertical;
chart.AddRadar(Radar.Shape.Polygon, new Vector2(0.5f, 0.4f), 0.4f);
chart.AddIndicator(0, "indicator1", 0, 100);
chart.AddIndicator(0, "indicator2", 0, 100);
chart.AddIndicator(0, "indicator3", 0, 100);
chart.AddIndicator(0, "indicator4", 0, 100);
chart.AddIndicator(0, "indicator5", 0, 100);
serie = chart.AddSerie(SerieType.Radar, "test");
serie.radarIndex = 0;
chart.AddData(0, new List<float> { 10, 20, 60, 40, 20 }, "data1");
chart.AddData(0, new List<float> { 40, 60, 90, 80, 70 }, "data2");
yield return new WaitForSeconds(1);
}
IEnumerator RadarUpdate()
{
chart.UpdateIndicator(0, 0, "new1", 0, 100);
chart.UpdateData(0, 0, new List<float> { 15, 30, 50, 60, 50 });
chart.UpdateDataName(0, 0, "new1");
yield return new WaitForSeconds(1);
}
IEnumerator RadarAddMultiple()
{
chart.RemoveRadar();
chart.RemoveData();
chart.title.text = "RadarChart - 多雷达图";
chart.title.subText = "";
chart.legend.show = true;
chart.legend.location.align = Location.Align.TopLeft;
chart.legend.location.top = 60;
chart.legend.location.left = 2;
chart.legend.itemWidth = 70;
chart.legend.itemHeight = 20;
chart.legend.orient = Orient.Vertical;
chart.AddRadar(Radar.Shape.Polygon, new Vector2(0.25f, 0.4f), 0.25f);
for (int i = 1; i <= 5; i++)
{
chart.AddIndicator(0, "radar1" + i, 0, 100);
}
chart.AddRadar(Radar.Shape.Circle, new Vector2(0.75f, 0.4f), 0.25f);
for (int i = 1; i <= 5; i++)
{
chart.AddIndicator(1, "radar2" + i, 0, 100);
}
serie = chart.AddSerie(SerieType.Radar, "test1");
serie.radarIndex = 0;
chart.AddData(0, new List<float> { 10, 20, 60, 40, 20 }, "data1");
serie1 = chart.AddSerie(SerieType.Radar, "test2");
serie1.radarIndex = 1;
chart.AddData(1, new List<float> { 10, 20, 60, 40, 20 }, "data2");
yield return new WaitForSeconds(1);
}
}
}

View File

@@ -1,38 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example50_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,104 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example60_Heatmap : MonoBehaviour
{
private HeatmapChart chart;
void Awake()
{
chart = gameObject.GetComponent<HeatmapChart>();
if (chart == null)
{
chart = gameObject.AddComponent<HeatmapChart>();
}
chart.title.text = "HeatmapChart";
chart.tooltip.type = Tooltip.Type.None;
chart.grid.left = 100;
chart.grid.right = 60;
chart.grid.bottom = 60;
//目前只支持Category
chart.xAxises[0].type = Axis.AxisType.Category;
chart.yAxises[0].type = Axis.AxisType.Category;
chart.xAxises[0].boundaryGap = true;
chart.xAxises[0].boundaryGap = true;
chart.xAxises[0].splitNumber = 10;
chart.yAxises[0].splitNumber = 10;
//清空数据重新添加
chart.RemoveData();
var serie = chart.AddSerie(SerieType.Heatmap, "serie1");
//设置样式
serie.itemStyle.show = true;
serie.itemStyle.borderWidth = 1;
serie.itemStyle.borderColor = Color.clear;
//设置高亮样式
serie.emphasis.show = true;
serie.emphasis.itemStyle.show = true;
serie.emphasis.itemStyle.borderWidth = 1;
serie.emphasis.itemStyle.borderColor = Color.black;
//设置视觉映射组件
chart.visualMap.enable = true;
chart.visualMap.max = 10;
chart.visualMap.range[0] = 0f;
chart.visualMap.range[1] = 10f;
chart.visualMap.orient = Orient.Vertical;
chart.visualMap.calculable = true;
chart.visualMap.location.align = Location.Align.BottomLeft;
chart.visualMap.location.bottom = 100;
chart.visualMap.location.left = 30;
//清空颜色重新添加
chart.visualMap.inRange.Clear();
var heatmapGridWid = 10f;
int xSplitNumber = (int)(chart.coordinateWidth / heatmapGridWid);
int ySplitNumber = (int)(chart.coordinateHeight / heatmapGridWid);
var colors = new List<string>{"#313695", "#4575b4", "#74add1", "#abd9e9", "#e0f3f8", "#ffffbf",
"#fee090", "#fdae61", "#f46d43", "#d73027", "#a50026"};
foreach (var str in colors)
{
chart.visualMap.inRange.Add(ThemeInfo.GetColor(str));
}
//添加xAxis的数据
for (int i = 0; i < xSplitNumber; i++)
{
chart.AddXAxisData((i + 1).ToString());
}
//添加yAxis的数据
for (int i = 0; i < ySplitNumber; i++)
{
chart.AddYAxisData((i + 1).ToString());
}
for (int i = 0; i < xSplitNumber; i++)
{
for (int j = 0; j < ySplitNumber; j++)
{
var value = 0f;
var rate = Random.Range(0, 101);
if (rate > 70) value = Random.Range(8f, 10f);
else value = Random.Range(1f, 8f);
var list = new List<float> { i, j, value };
//至少是一个三位数据x,y,value
chart.AddData(0, list);
}
}
}
}
}

View File

@@ -1,70 +0,0 @@
using System.Runtime.InteropServices;
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example70_Gauge : MonoBehaviour
{
private GaugeChart chart;
private float updateTime;
void Awake()
{
chart = gameObject.GetComponent<GaugeChart>();
if (chart == null)
{
chart = gameObject.AddComponent<GaugeChart>();
}
chart.title.text = "GaugeChart";
chart.RemoveData();
var serie = chart.AddSerie(SerieType.Gauge, "速度");
serie.min = 0;
serie.max = 220;
serie.startAngle = -125;
serie.endAngle = 125;
serie.center[0] = 0.5f;
serie.center[1] = 0.5f;
serie.radius[0] = 80;
serie.splitNumber = 5;
serie.animation.dataChangeEnable = true;
serie.roundCap = true;
serie.titleStyle.show = true;
serie.titleStyle.textStyle.offset = new Vector2(0, 20);
serie.label.show = true;
serie.label.offset = new Vector3(0, -20);
serie.gaugeAxis.show = true;
serie.gaugeAxis.axisLine.width = 15;
serie.gaugePointer.show = true;
serie.gaugePointer.width = 15;
var value = UnityEngine.Random.Range(serie.min, serie.max);
chart.AddData(0, value, "km/h");
}
void Update()
{
updateTime += Time.deltaTime;
if (updateTime > 2)
{
updateTime = 0;
var value = UnityEngine.Random.Range(0, 220);
chart.UpdateData(0, 0, value);
}
}
}
}

View File

@@ -1,58 +0,0 @@
using System.Runtime.InteropServices;
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example80_Polar : MonoBehaviour
{
private PolarChart chart;
private float updateTime;
void Awake()
{
chart = gameObject.GetComponent<PolarChart>();
if (chart == null)
{
chart = gameObject.AddComponent<PolarChart>();
}
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
AddData();
}
}
void AddData()
{
chart.RemoveData();
chart.tooltip.type = Tooltip.Type.Corss;
chart.angleAxis.type = Axis.AxisType.Value;
chart.angleAxis.minMaxType = Axis.AxisMinMaxType.Custom;
chart.angleAxis.min = 0;
chart.angleAxis.max = 360;
chart.angleAxis.startAngle = Random.Range(0, 90);
chart.AddSerie(SerieType.Line, "line1");
var rate = Random.Range(1, 4);
for (int i = 0; i <= 360; i++)
{
var t = i / 180f * Mathf.PI;
var r = Mathf.Sin(2 * t) * Mathf.Cos(2 * t) * rate;
chart.AddData(0, Mathf.Abs(r), i);
}
}
}
}

View File

@@ -1,71 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System;
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(CoordinateChart))]
public class Example_Dynamic : MonoBehaviour
{
public int maxCacheDataNumber = 100;
public float initDataTime = 2;
private CoordinateChart chart;
private float updateTime;
private float initTime;
private int initCount;
private int count;
private bool isInited;
private DateTime timeNow;
void Awake()
{
chart = gameObject.GetComponentInChildren<CoordinateChart>();
chart.RemoveData();
var serie = chart.AddSerie(SerieType.Line);
serie.symbol.show = false;
serie.maxCache = maxCacheDataNumber;
chart.xAxises[0].maxCache = maxCacheDataNumber;
timeNow = DateTime.Now;
timeNow = timeNow.AddSeconds(-maxCacheDataNumber);
}
void Update()
{
if (initCount < maxCacheDataNumber)
{
int count = (int)(maxCacheDataNumber / initDataTime * Time.deltaTime);
for (int i = 0; i < count; i++)
{
timeNow = timeNow.AddSeconds(1);
string category = timeNow.ToString("hh:mm:ss");
float value = UnityEngine.Random.Range(60, 150);
chart.AddXAxisData(category);
chart.AddData(0, value);
initCount++;
if (initCount > maxCacheDataNumber) break;
}
chart.RefreshChart();
}
updateTime += Time.deltaTime;
if (updateTime >= 1)
{
updateTime = 0;
count++;
string category = DateTime.Now.ToString("hh:mm:ss");
float value = UnityEngine.Random.Range(60, 150);
chart.AddXAxisData(category);
chart.AddData(0, value);
chart.RefreshChart();
}
}
}
}

View File

@@ -1,54 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(CoordinateChart))]
public class Example_LargeData : MonoBehaviour
{
public int maxCacheDataNumber = 3000;
public float initDataTime = 5;
private CoordinateChart chart;
private float initTime;
private int initCount = 0;
private System.DateTime timeNow;
void Awake()
{
chart = gameObject.GetComponentInChildren<CoordinateChart>();
timeNow = System.DateTime.Now;
chart.ClearAxisData();
chart.series.ClearData();
chart.SetMaxCache(maxCacheDataNumber);
chart.title.text = maxCacheDataNumber + "数据";
}
private void Update()
{
if (initCount < maxCacheDataNumber)
{
for (int i = 0; i < 10; i++)
{
initCount++;
if (initCount > maxCacheDataNumber) break;
chart.title.text = initCount + "数据";
timeNow = timeNow.AddSeconds(1);
float xvalue = Mathf.PI / 180 * initCount;
float yvalue = Mathf.Sin(xvalue);
chart.AddData(0, 15 + yvalue * 2);
chart.AddXAxisData(timeNow.ToString("hh:mm:ss"));
}
}
}
}
}

View File

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

View File

@@ -1,46 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
[RequireComponent(typeof(PieChart))]
public class Example_PieChart : MonoBehaviour
{
private PieChart chart;
private float time;
private int count = 0;
private void Awake()
{
chart = transform.GetComponent<PieChart>();
chart.ClearData();
}
private void Update()
{
time += Time.deltaTime;
if (time > 1)
{
time = 0;
if (count < 5)
{
chart.AddData(0, Random.Range(10, 100), "time" + count);
}
else
{
int index = count % 5;
chart.UpdateData(0, Random.Range(10, 100), index);
}
count++;
}
}
}
}

View File

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

View File

@@ -1,56 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using UnityEngine.UI;
namespace XCharts.Examples
{
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class Example_Test : MonoBehaviour
{
BaseChart chart;
void Awake()
{
chart = gameObject.GetComponent<BaseChart>();
var btnTrans = transform.parent.Find("Button");
if (btnTrans)
{
btnTrans.gameObject.GetComponent<Button>().onClick.AddListener(OnTestBtn);
}
}
void Update()
{
if (Input.GetKeyDown(KeyCode.Space))
{
AddData();
}
}
void OnTestBtn()
{
//chart.ClearData();
chart.SetSize(800,400);
}
void AddData()
{
chart.ClearData();
int count = Random.Range(5, 100);
for (int i = 0; i < count; i++)
{
(chart as CoordinateChart).AddXAxisData("x" + i);
if (Random.Range(1, 3) == 2)
chart.AddData(0, Random.Range(-110, 200));
else
chart.AddData(0, Random.Range(-100, 100));
}
}
}
}

View File

@@ -1,152 +0,0 @@
# XCharts
![license](https://img.shields.io/github/license/monitor1394/unity-ugui-XCharts)
[![npm Package](https://img.shields.io/npm/v/unity-ugui-xcharts.svg)](https://www.npmjs.org/package/unity-ugui-xcharts)
[![downloads per month](http://img.shields.io/npm/dm/unity-ugui-xcharts.svg)](https://www.npmjs.org/package/unity-ugui-xcharts)
![qq](https://img.shields.io/badge/QQ群-202030963-green)
A powerful, easy-to-use, configurable charting and data visualization library for Unity. Supporting line, bar, pie, radar, scatter, heatmap, gauge, ring, polar, liquid and other common chart.
[XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
[XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
[XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
[XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)
[XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG-EN.md)
[Tutorial - Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md)
## Features
* Rich built-in examples and templates, parameter visualization configuration, effect real-time preview, pure code drawing.
* Support line, bar, pie, radar, scatter, heatmaps, gauge, ring, polar, liquid and other common chart.
* Support line graph, curve graph, area graph, step graph and other LineChart.
* Support parallel bar, stack bar, stack percentage bar, zebra bar and other BarChart.
* Support ring, rose and other PieChart.
* Support line-bar chart, scatter-line chart and other combination chart.
* Support solid line, curve, ladder line, dotted line, dash line, dot line, double dot line and other lines.
* Support custom theme, built-in theme switching.
* Support custom chart content drawing, drawing points, line, curve, triangle, quadrilateral, circle, ring, sector, border, arrow and other drawing API.
* Support interactive operations such as data filtering, view zooming and detail display on PC and mobile terminals.
* Support 10,000-level big data rendering.
## Screenshot
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-line.png" width="550" height="auto"/>
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-bar.png" width="550" height="auto"/>
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-pie.png" width="550" height="auto"/>
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-radar.png" width="550" height="auto"/>
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-scatter.png" width="550" height="auto"/>
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-heatmap.png" width="550" height="auto"/>
## Cheat Sheet
<img src="https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/screenshot/xcharts-cheatsheet.gif" />
`XCharts` consist of components and data. Different components and data can be combined into different types of charts. The component is divided into main component and sub component. The main component contains the sub components.
`XCharts` main components:
* `Theme` theme component, which can configure the default colors, fonts and so on.
* `Title` title component, which contains the main title and subtitle.
* `Legend` legend component, which represent different sets of symbols, colors, and names. You can control which series are not displayed by clicking on the legend.
* `Grid` grid component, drawing grid in rectangular coordinate system. Up to two X axes and two Y axes can be placed within a grid component. You can draw line, bar and scatter chart on the grid.
* `Axis` axis component, the axis of a rectangular coordinate system. Supports the upper and lower X axes and the left and right Y axes.
* `Series` series component, a list of serie. A chart can contain many different series, and each series determines its own chart type by type.
* `Tooltip` tooltip component, feedback more details of the data indicated by the mouse at the time.
* `DataZoom` data zoom component, used for area zooming so you can focus on detailed data information, or overview the data as a whole, or remove the impact of outliers.
* `VisualMap` visual mapping component, you can map data in different colors.
* `Radar` radar component, suitable for radar chart only.
* `Settings` global Settings component, Some global parameters can be adjusted. Use the default values in general and adjust them as needed.
`XCharts` support chart:
* `LineChart`
* `BarChart`
* `PieChart`
* `RadarChart`
* `ScatterChart`
* `HeatmapChart`
* `GuageChart`
* `RingChart`
* `PolarChart`
* `LiquidChart`
The following is the relationship structure of LineChart:
``` js
.
├── LineChart
. ├── ThemeInfo
├── Title
│ └── Location
├── Legend
│ └── Location
├── Tooltip
├── DataZoom
├── VisualMap
├── Grid
├── Axis
│ ├── AxisLine
│ ├── AxisName
│ ├── AxisLabel
│ ├── AxisTick
│ └── AxisSplitArea
├── Series
│ ├── ItemStyle
│ ├── AreaStyle
│ ├── SerieSymbol
│ ├── LineStyle
│ ├── LineArrow
│ ├── SerieLabel
│ ├── Emphasis
│ ├── Animation
│ └── SerieData
└── Settings
```
## Environment
* Unity2017.4.27f1
* .Net 3.5
* macOS 10.15.4
## Usage
* This project was developed under `Unity 2017.4.27f1` and `.net 3.5`, tested normally on `Unity 5`, `Unity 2018` and `Unity 2019`. It can theoretically run on any version that supports `UGUI`.
* Download the source code or `unitypackage` to import into your project. If `Unity` version are `2018.3` or above, it is recommended to import packages through `Package Manager`:
1. Open the `manifest.json` file under `Packages` directory and add under `dependencies`:
``` json
"com.monitor1394.xcharts": "https://github.com/monitor1394/unity-ugui-XCharts.git#package",
```
2. Going back to `Unity`, it may take 3 to 5 minutes to download.
3. If you want to delete `XCharts`, just delete the content added in step 1.
4. If you want to update `XCharts`, open `manifest.json` file , delete the content about `com.monitor1394.xcharts` under `lock`, it will download anagain. Also can check For update in `components-> XCharts -> Check For Update`.
* Add a chart in Editor quickly:
1. In `Hierarchy`, right-click menu `XChart->LineChart`.
2. In unity menu bar, `Component->XCharts->LineChart`.
3. In `Inspector`,`Add Component->LineChart`.
4. Then a simple line chart is done.
5. In `Inspector` you can adjust the parameters of components, and in `Game` will feedback the adjustment effect in realtime 。the detail of parameters go to see: [XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md).
* See more examples of code dynamic control: [Tutorial - Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md).
## Documents
* [XCharts Homepage](https://github.com/monitor1394/unity-ugui-XCharts)
* [XCharts Q&A](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-questions-and-answers-EN.md)
* [XCharts API](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-api-EN.md)
* [XCharts Configuration](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/Documentation/xcharts-configuration-EN.md)
* [XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG-EN.md)
* [XCharts Tutorial: Get start with XCharts in 5 minute](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Doc/tutorial--get-start-with-xcharts-in-5-minute-EN.md)
## Changelog
[XCharts Changelog](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/CHANGELOG.md)
## Licenses
[MIT License](https://github.com/monitor1394/unity-ugui-XCharts/blob/master/Assets/XCharts/LICENSE.md)
## Contact
gmail: monitor1394@gmail.com

View File

@@ -1,712 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using System.Collections.Generic;
using System;
using UnityEngine.UI;
namespace XCharts
{
/// <summary>
/// The base class of all charts.
/// 所有Chart的基类。
/// </summary>
public partial class BaseChart
{
/// <summary>
/// The name of chart.
/// </summary>
public string chartName
{
get { return m_ChartName; }
set
{
if (!string.IsNullOrEmpty(value) && XChartsMgr.Instance.ContainsChart(value))
{
Debug.LogError("chartName repeated:" + value);
}
else
{
m_ChartName = value;
}
}
}
/// <summary>
/// The theme info.
/// </summary>
public ThemeInfo themeInfo { get { return m_ThemeInfo; } set { m_ThemeInfo = value; } }
/// <summary>
/// The title setting of chart.
/// 标题组件
/// </summary>
public Title title { get { return m_Title; } }
/// <summary>
/// The legend setting of chart.
/// 图例组件
/// </summary>
public Legend legend { get { return m_Legend; } }
/// <summary>
/// The tooltip setting of chart.
/// 提示框组件
/// </summary>
public Tooltip tooltip { get { return m_Tooltip; } }
/// <summary>
/// The series setting of chart.
/// 系列列表
/// </summary>
public Series series { get { return m_Series; } }
/// <summary>
/// Global parameter setting component.
/// 全局设置组件。
/// </summary>
public Settings settings { get { return m_Settings; } }
/// <summary>
/// The x of chart.
/// 图表的X
/// </summary>
public float chartX { get { return m_ChartX; } }
/// <summary>
/// The y of chart.
/// 图表的Y
/// </summary>
public float chartY { get { return m_ChartY; } }
/// <summary>
/// The width of chart.
/// 图表的宽
/// </summary>
public float chartWidth { get { return m_ChartWidth; } }
/// <summary>
/// The height of chart.
/// 图表的高
/// </summary>
public float chartHeight { get { return m_ChartHeight; } }
/// <summary>
/// The position of chart.
/// 图表的左下角起始坐标。
/// </summary>
public Vector3 chartPosition { get { return m_ChartPosition; } }
public Rect chartRect { get { return m_ChartRect; } }
/// <summary>
/// 自定义绘制回调。
/// </summary>
public Action<VertexHelper> onCustomDraw { set { m_OnCustomDrawCallback = value; } }
/// <summary>
/// Redraw chart in next frame.
/// 在下一帧刷新图表。
/// </summary>
public void RefreshChart()
{
m_RefreshChart = true;
}
/// <summary>
/// Remove all series and legend data.
/// It just emptying all of serie's data without emptying the list of series.
/// 清除所有数据,系列中只是移除数据,列表会保留。
/// </summary>
public virtual void ClearData()
{
m_Series.ClearData();
m_Legend.ClearData();
m_Tooltip.ClearValue();
m_CheckAnimation = false;
m_ReinitLabel = true;
RefreshChart();
}
/// <summary>
/// Remove all data from series and legend.
/// The series list is also cleared.
/// 清除所有系列和图例数据,系列的列表也会被清除。
/// </summary>
public virtual void RemoveData()
{
m_Legend.ClearData();
m_Series.RemoveAll();
m_Tooltip.ClearValue();
m_CheckAnimation = false;
m_ReinitLabel = true;
m_SerieLabelRoot = null;
RefreshChart();
}
/// <summary>
/// Remove legend and serie by name.
/// 清除指定系列名称的数据。
/// </summary>
/// <param name="serieName">the name of serie</param>
public virtual void RemoveData(string serieName)
{
m_Series.Remove(serieName);
m_Legend.RemoveData(serieName);
m_SerieLabelRoot = null;
RefreshChart();
}
/// <summary>
/// Add a serie to serie list.
/// 添加一个系列到系列列表中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="type">the type of serie</param>
/// <param name="show">whether to show this serie</param>
/// <returns>the added serie</returns>
public virtual Serie AddSerie(SerieType type, string serieName = null, bool show = true)
{
return m_Series.AddSerie(type, serieName);
}
/// <summary>
/// Add a data to serie.
/// If serieName doesn't exist in legend,will be add to legend.
/// 添加一个数据到指定的系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="data">the data to add</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(string serieName, float data, string dataName = null)
{
var serieData = m_Series.AddData(serieName, data, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieName);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Add a data to serie.
/// 添加一个数据到指定的系列中。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="data">the data to add</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(int serieIndex, float data, string dataName = null)
{
var serieData = m_Series.AddData(serieIndex, data, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieIndex);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Add an arbitray dimension data to serie,such as (x,y,z,...).
/// 添加多维数据x,y,z...)到指定的系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="multidimensionalData">the (x,y,z,...) data</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(string serieName, List<float> multidimensionalData, string dataName = null)
{
var serieData = m_Series.AddData(serieName, multidimensionalData, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieName);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Add an arbitray dimension data to serie,such as (x,y,z,...).
/// 添加多维数据x,y,z...)到指定的系列中。
/// </summary>
/// <param name="serieIndex">the index of serie,index starts at 0</param>
/// <param name="multidimensionalData">the (x,y,z,...) data</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(int serieIndex, List<float> multidimensionalData, string dataName = null)
{
var serieData = m_Series.AddData(serieIndex, multidimensionalData, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieIndex);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Add a (x,y) data to serie.
/// 添加x,y数据到指定系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="xValue">x data</param>
/// <param name="yValue">y data</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(string serieName, float xValue, float yValue, string dataName = null)
{
var serieData = m_Series.AddXYData(serieName, xValue, yValue, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieName);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Add a (x,y) data to serie.
/// 添加x,y数据到指定系列中。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="xValue">x data</param>
/// <param name="yValue">y data</param>
/// <param name="dataName">the name of data</param>
/// <returns>Returns True on success</returns>
public virtual SerieData AddData(int serieIndex, float xValue, float yValue, string dataName = null)
{
var serieData = m_Series.AddXYData(serieIndex, xValue, yValue, dataName);
if (serieData != null)
{
var serie = m_Series.GetSerie(serieIndex);
if (SerieHelper.GetSerieLabel(serie, serieData).show)
{
RefreshLabel();
}
RefreshChart();
}
return serieData;
}
/// <summary>
/// Update serie data by serie name.
/// 更新指定系列中的指定索引数据。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="dataIndex">the index of data</param>
/// <param name="value">the data will be update</param>
public virtual bool UpdateData(string serieName, int dataIndex, float value)
{
if (m_Series.UpdateData(serieName, dataIndex, value))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// Update serie data by serie index.
/// 更新指定系列中的指定索引数据。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="dataIndex">the index of data</param>
/// <param name="value">the data will be update</param>
public virtual bool UpdateData(int serieIndex, int dataIndex, float value)
{
if (m_Series.UpdateData(serieIndex, dataIndex, value))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// 更新指定系列指定索引的数据项的多维数据。
/// </summary>
/// <param name="serieName"></param>
/// <param name="dataIndex"></param>
/// <param name="multidimensionalData">一个数据项的多维数据列表,而不是多个数据项的数据</param>
public virtual bool UpdateData(string serieName, int dataIndex, List<float> multidimensionalData)
{
if (m_Series.UpdateData(serieName, dataIndex, multidimensionalData))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// 更新指定系列指定索引的数据项的多维数据。
/// </summary>
/// <param name="serieIndex"></param>
/// <param name="dataIndex"></param>
/// <param name="multidimensionalData">一个数据项的多维数据列表,而不是多个数据项的数据</param>
public virtual bool UpdateData(int serieIndex, int dataIndex, List<float> multidimensionalData)
{
if (m_Series.UpdateData(serieIndex, dataIndex, multidimensionalData))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// 更新指定系列指定索引指定维数的数据。维数从0开始。
/// </summary>
/// <param name="serieName"></param>
/// <param name="dataIndex"></param>
/// <param name="dimension">指定维数从0开始</param>
/// <param name="value"></param>
public virtual bool UpdateData(string serieName, int dataIndex, int dimension, float value)
{
if (m_Series.UpdateData(serieName, dataIndex, dimension, value))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// 更新指定系列指定索引指定维数的数据。维数从0开始。
/// </summary>
/// <param name="serieIndex"></param>
/// <param name="dataIndex"></param>
/// <param name="dimension">指定维数从0开始</param>
/// <param name="value"></param>
public virtual bool UpdateData(int serieIndex, int dataIndex, int dimension, float value)
{
if (m_Series.UpdateData(serieIndex, dataIndex, dimension, value))
{
RefreshChart();
return true;
}
return false;
}
/// <summary>
/// Update serie data name.
/// 更新指定系列中的指定索引数据名称。
/// </summary>
/// <param name="serieName"></param>
/// <param name="dataIndex"></param>
/// <param name="dataName"></param>
public virtual bool UpdateDataName(string serieName, int dataIndex, string dataName)
{
return m_Series.UpdateDataName(serieName, dataIndex, dataName);
}
/// <summary>
/// Update serie data name.
/// 更新指定系列中的指定索引数据名称。
/// </summary>
/// <param name="serieIndex"></param>
/// <param name="dataName"></param>
/// <param name="dataIndex"></param>
public virtual bool UpdateDataName(int serieIndex, int dataIndex, string dataName)
{
return m_Series.UpdateDataName(serieIndex, dataIndex, dataName);
}
/// <summary>
/// Whether to show serie.
/// 设置指定系列是否显示。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="active">Active or not</param>
public virtual void SetActive(string serieName, bool active)
{
var serie = m_Series.GetSerie(serieName);
if (serie != null)
{
SetActive(serie.index, active);
}
}
/// <summary>
/// Whether to show serie.
/// 设置指定系列是否显示。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="active">Active or not</param>
public virtual void SetActive(int serieIndex, bool active)
{
m_Series.SetActive(serieIndex, active);
var serie = m_Series.GetSerie(serieIndex);
if (serie != null && !string.IsNullOrEmpty(serie.name))
{
UpdateLegendColor(serie.name, active);
}
}
protected virtual void UpdateLegendColor(string legendName, bool active)
{
var legendIndex = m_LegendRealShowName.IndexOf(legendName);
if (legendIndex >= 0)
{
var iconColor = LegendHelper.GetIconColor(legend, legendIndex, m_ThemeInfo, active);
var contentColor = LegendHelper.GetContentColor(legend, m_ThemeInfo, active);
m_Legend.UpdateButtonColor(legendName, iconColor);
m_Legend.UpdateContentColor(legendName, contentColor);
}
}
/// <summary>
/// Whether serie is activated.
/// 获取指定系列是否显示。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <returns>True when activated</returns>
public virtual bool IsActive(string serieName)
{
return m_Series.IsActive(serieName);
}
/// <summary>
/// Whether serie is activated.
/// 获取指定系列是否显示。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <returns>True when activated</returns>
public virtual bool IsActive(int serieIndex)
{
return m_Series.IsActive(serieIndex);
}
/// <summary>
/// Whether serie is activated.
/// 获得指定图例名字的系列是否显示。
/// </summary>
/// <param name="legendName"></param>
/// <returns></returns>
public virtual bool IsActiveByLegend(string legendName)
{
foreach (var serie in m_Series.list)
{
if (serie.show && legendName.Equals(serie.name))
{
return true;
}
else
{
foreach (var serieData in serie.data)
{
if (serieData.show && legendName.Equals(serieData.name))
{
return true;
}
}
}
}
return false;
}
/// <summary>
/// 刷新文本标签Label重新初始化当有改动Label参数时手动调用改接口
/// </summary>
public void RefreshLabel()
{
m_ReinitLabel = true;
m_SerieLabelRoot = null;
}
/// <summary>
/// 刷新Tooltip组件。
/// </summary>
public void RefreshTooltip()
{
InitTooltip();
}
/// <summary>
/// Update chart theme.
/// 切换图表主题。
/// </summary>
/// <param name="theme">theme</param>
public void UpdateTheme(Theme theme)
{
m_ThemeInfo.theme = theme;
OnThemeChanged();
RefreshChart();
}
/// <summary>
/// Update chart theme info.
/// 切换图表主题。
/// </summary>
/// <param name="themeInfo">themeInfo</param>
public void UpdateThemeInfo(ThemeInfo themeInfo)
{
m_ThemeInfo = themeInfo;
UpdateTheme(m_ThemeInfo.theme);
}
/// <summary>
/// Whether series animation enabel.
/// 启用或关闭起始动画。
/// </summary>
/// <param name="flag"></param>
public void AnimationEnable(bool flag)
{
m_Series.AnimationEnable(flag);
}
/// <summary>
/// fadeIn animation.
/// 开始渐入动画。
/// </summary>
public void AnimationFadeIn()
{
m_Series.AnimationFadeIn();
RefreshChart();
}
/// <summary>
/// fadeIn animation.
/// 开始渐出动画。
/// </summary>
public void AnimationFadeOut()
{
m_Series.AnimationFadeOut();
RefreshChart();
}
/// <summary>
/// Pause animation.
/// 暂停动画。
/// </summary>
public void AnimationPause()
{
m_Series.AnimationPause();
RefreshChart();
}
/// <summary>
/// Stop play animation.
/// 继续动画。
/// </summary>
public void AnimationResume()
{
m_Series.AnimationResume();
RefreshChart();
}
/// <summary>
/// Reset animation.
/// 重置动画。
/// </summary>
public void AnimationReset()
{
m_Series.AnimationReset();
RefreshChart();
}
/// <summary>
/// 点击图例按钮
/// </summary>
/// <param name="legendIndex">图例按钮索引</param>
/// <param name="legendName">图例按钮名称</param>
/// <param name="show">显示还是隐藏</param>
public void ClickLegendButton(int legendIndex, string legendName, bool show)
{
OnLegendButtonClick(legendIndex, legendName, show);
RefreshChart();
}
/// <summary>
/// 坐标是否在图表范围内
/// </summary>
/// <param name="local"></param>
/// <returns></returns>
public bool IsInChart(Vector2 local)
{
return IsInChart(local.x, local.y);
}
public bool IsInChart(float x, float y)
{
if (x < m_ChartX || x > m_ChartX + m_ChartWidth ||
y < m_ChartY || y > m_ChartY + m_ChartHeight)
{
return false;
}
return true;
}
public void ClampInChart(ref Vector3 pos)
{
if (!IsInChart(pos.x, pos.y))
{
if (pos.x < m_ChartX) pos.x = m_ChartX;
if (pos.x > m_ChartX + m_ChartWidth) pos.x = m_ChartX + m_ChartWidth;
if (pos.y < m_ChartY) pos.y = m_ChartY;
if (pos.y > m_ChartY + m_ChartHeight) pos.y = m_ChartY + m_ChartHeight;
}
}
/// <summary>
/// 是否可以开启背景组件。背景组件在chart受上层布局控制时无法开启。
/// </summary>
/// <returns></returns>
public bool CanShowBackgroundComponent()
{
return !m_IsControlledByLayout && m_Background.runtimeActive;
}
/// <summary>
/// 开启背景组件。背景组件在chart受上层布局控制时不适用。
/// </summary>
/// <param name="flag"></param>
public void EnableBackground(bool flag)
{
if (flag && !CanShowBackgroundComponent())
{
var msg = "The background component cannot be activated because chart is controlled by LayoutGroup,"
+ " or its parent have more than one child.";
Debug.LogError(msg);
return;
}
m_Background.show = flag;
}
public Vector3 GetTitlePosition()
{
return chartPosition + m_Title.location.GetPosition(chartWidth, chartHeight);
}
[Obsolete("Use BaseChart.RefreshLabel() instead.", true)]
public void ReinitChartLabel() { }
[Obsolete("Use BaseChart.AnimationFadeIn() instead.", true)]
public void AnimationStart() { }
[Obsolete("Use BaseChart.AnimationFadeOut() instead.", true)]
public void MissAnimationStart() { }
[Obsolete("Use onCustomDraw instead.", false)]
public Action<VertexHelper> customDrawCallback { set { m_OnCustomDrawCallback = value; } }
}
}

View File

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

View File

@@ -1,138 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using UnityEngine;
using System;
using UnityEngine.EventSystems;
namespace XCharts
{
/// <summary>
/// The base class of all graphs or components.
/// 所有图形的基类。
/// </summary>
public partial class BaseGraph
{
/// <summary>
/// The x of graph.
/// 图形的X
/// </summary>
public float graphX { get { return m_GraphX; } }
/// <summary>
/// The y of graph.
/// 图形的Y
/// </summary>
public float graphY { get { return m_GraphY; } }
/// <summary>
/// The width of graph.
/// 图形的宽
/// </summary>
public float graphWidth { get { return m_GraphWidth; } }
/// <summary>
/// The height of graph.
/// 图形的高
/// </summary>
public float graphHeight { get { return m_GraphHeight; } }
/// <summary>
/// The position of graph.
/// 图形的左下角起始坐标。
/// </summary>
public Vector3 graphPosition { get { return m_GraphPosition; } }
public Rect graphRect { get { return m_GraphRect; } }
/// <summary>
/// The postion of pointer.
/// 鼠标位置。
/// </summary>
public Vector2 pointerPos { get; protected set; }
/// <summary>
/// Whether the mouse pointer is in the chart.
/// 鼠标是否在图表内。
/// </summary>
public bool isPointerInChart { get; protected set; }
/// <summary>
/// 警告信息。
/// </summary>
public string warningInfo { get; protected set; }
public bool isControlledByLayout { get { return m_IsControlledByLayout; } }
/// <summary>
/// 强制开启鼠标事件检测。
/// </summary>
public bool forceOpenRaycastTarget { get { return m_ForceOpenRaycastTarget; } set { m_ForceOpenRaycastTarget = value; } }
/// <summary>
/// 鼠标点击回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onPointerClick { set { m_OnPointerClick = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标按下回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onPointerDown { set { m_OnPointerDown = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标弹起回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onPointerUp { set { m_OnPointerUp = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标进入回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onPointerEnter { set { m_OnPointerEnter = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标退出回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onPointerExit { set { m_OnPointerExit = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标开始拖拽回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onBeginDrag { set { m_OnBeginDrag = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标拖拽回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onDrag { set { m_OnDrag = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标结束拖拽回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onEndDrag { set { m_OnEndDrag = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 鼠标滚动回调。
/// </summary>
public Action<BaseGraph, PointerEventData> onScroll { set { m_OnScroll = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
/// 设置图形的宽高在非stretch pivot下才有效其他情况需要自己调整RectTransform
/// </summary>
/// <param name="width"></param>
/// <param name="height"></param>
public virtual void SetSize(float width, float height)
{
if (LayerHelper.IsFixedWidthHeight(rectTransform))
{
rectTransform.sizeDelta = new Vector2(width, height);
}
else
{
Debug.LogError("Can't set size on stretch pivot,you need to modify rectTransform by yourself.");
}
}
/// <summary>
/// Redraw graph in next frame.
/// 在下一帧刷新图形。
/// </summary>
public void RefreshGraph()
{
m_RefreshChart = true;
}
/// <summary>
/// 检测警告信息。
/// </summary>
/// <returns></returns>
public string CheckWarning()
{
warningInfo = CheckHelper.CheckChart(this);
return warningInfo;
}
}
}

View File

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

View File

@@ -1,272 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts
{
/// <summary>
/// The basic class of rectangular coordinate chartsuch as LineChart,BarChart and ScatterChart.
/// 直角坐标系类型图表的基类如折线图LineChart柱状图BarChart散点图ScatterChart都属于这类型的图表。
/// 不可用直接将CoordinateChart绑定到GameObject上。
/// </summary>
public partial class CoordinateChart
{
/// <summary>
/// The lower left position x of coordinate system.
/// 坐标系的左下角坐标X。
/// </summary>
public float coordinateX { get { return m_CoordinateX; } }
/// <summary>
/// The lower left position y of coordinate system.
/// 坐标系的左下角坐标Y。
/// </summary>
public float coordinateY { get { return m_CoordinateY; } }
/// <summary>
/// the width of coordinate system。
/// 坐标系的宽。
/// </summary>
public float coordinateWidth { get { return m_CoordinateWidth; } }
/// <summary>
/// the height of coordinate system。
/// 坐标系的高。
/// </summary>
public float coordinateHeight { get { return m_CoordinateHeight; } }
/// <summary>
/// grid component.
/// 网格组件。
/// </summary>
public Grid grid { get { return m_Grid; } }
/// <summary>
/// the x axisesxAxises[0] is the first x axis, xAxises[1] is the second x axis.
/// 两个x轴。
/// </summary>
public List<XAxis> xAxises { get { return m_XAxises; } }
/// <summary>
/// the y axises, yAxises[0] is the first y axis, yAxises[1] is the second y axis.
/// 两个y轴。
/// </summary>
public List<YAxis> yAxises { get { return m_YAxises; } }
/// <summary>
/// dataZoom component.
/// 区域缩放组件。
/// </summary>
public DataZoom dataZoom { get { return m_DataZoom; } }
/// <summary>
/// visualMap component.
/// 视觉映射组件。
/// </summary>
public VisualMap visualMap { get { return m_VisualMap; } }
/// <summary>
/// X轴
/// </summary>
public XAxis xAxis0 { get { return m_XAxises[0]; } }
/// <summary>
/// X轴
/// </summary>
public XAxis xAxis1 { get { return m_XAxises[1]; } }
/// <summary>
/// Y轴
/// </summary>
public YAxis yAxis0 { get { return m_YAxises[0]; } }
/// <summary>
/// Y轴
/// </summary>
public YAxis yAxis1 { get { return m_YAxises[1]; } }
/// <summary>
/// Remove all data from series,legend and axis.
/// It just emptying all of serie's data without emptying the list of series.
/// 清空所有图例,系列和坐标轴类目数据。系列中指示清空系列中的数据,会保留系列列表。
/// </summary>
public override void ClearData()
{
base.ClearData();
ClearAxisData();
}
/// <summary>
/// Remove all data from series,legend and axis.
/// The series list is also cleared.
/// 清空所有图例,系列和坐标轴类目数据。系列的列表也会被清空。
/// </summary>
public override void RemoveData()
{
base.RemoveData();
ClearAxisData();
}
/// <summary>
/// Remove all data of axises.
/// 清除所有x轴和y轴的类目数据。
/// </summary>
public void ClearAxisData()
{
foreach (var item in m_XAxises) item.data.Clear();
foreach (var item in m_YAxises) item.data.Clear();
}
/// <summary>
/// Add a category data to xAxis.
/// 添加一个类目数据到指定的x轴。
/// </summary>
/// <param name="category">the category data</param>
/// <param name="xAxisIndex">which xAxis should category add to</param>
public void AddXAxisData(string category, int xAxisIndex = 0)
{
m_XAxises[xAxisIndex].AddData(category);
}
/// <summary>
/// Add a category data to yAxis.
/// 添加一个类目数据到指定的y轴。
/// </summary>
/// <param name="category">the category data</param>
/// <param name="yAxisIndex">which yAxis should category add to</param>
public void AddYAxisData(string category, int yAxisIndex = 0)
{
m_YAxises[yAxisIndex].AddData(category);
}
/// <summary>
/// reutrn true when all the show axis is `Value` type.
/// 纯数值坐标轴(数值轴或对数轴)。
/// </summary>
public bool IsValue()
{
foreach (var axis in m_XAxises)
{
if (axis.show && !axis.IsValue() && !axis.IsLog()) return false;
}
foreach (var axis in m_YAxises)
{
if (axis.show && !axis.IsValue() && !axis.IsLog()) return false;
}
return true;
}
/// <summary>
/// 纯类目轴。
/// </summary>
public bool IsCategory()
{
foreach (var axis in m_XAxises)
{
if (axis.show && !axis.IsCategory()) return false;
}
foreach (var axis in m_YAxises)
{
if (axis.show && !axis.IsCategory()) return false;
}
return true;
}
/// <summary>
/// 坐标是否在坐标轴内。
/// </summary>
public bool IsInCooridate(Vector2 local)
{
return IsInCooridate(local.x, local.y);
}
public bool IsInCooridate(Vector3 local)
{
return IsInCooridate(local.x, local.y);
}
public bool IsInCooridate(float x, float y)
{
if (x < m_CoordinateX - 1 || x > m_CoordinateX + m_CoordinateWidth + 1 ||
y < m_CoordinateY - 1 || y > m_CoordinateY + m_CoordinateHeight + 1)
{
return false;
}
return true;
}
/// <summary>
/// 在下一帧刷新DataZoom
/// </summary>
public void RefreshDataZoom()
{
RefreshDataZoomLabel();
}
/// <summary>
/// 立即刷新数值坐标轴的最大最小值
/// </summary>
public void RefreshAxisMinMaxValue()
{
CheckMinMaxValue();
}
public Vector3 ClampInCoordinate(Vector3 pos)
{
if (IsInCooridate(pos)) return pos;
else
{
// var pos = new Vector3(pos.x, pos.y);
if (pos.x < m_CoordinateX) pos.x = m_CoordinateX;
if (pos.x > m_CoordinateX + m_CoordinateWidth) pos.x = m_CoordinateX + m_CoordinateWidth;
if (pos.y < m_CoordinateY) pos.y = m_CoordinateY;
if (pos.y > m_CoordinateY + m_CoordinateHeight) pos.y = m_CoordinateY + m_CoordinateHeight;
return pos;
}
}
/// <summary>
/// 转换X轴和Y轴的配置
/// </summary>
/// <param name="index">坐标轴索引0或1</param>
public void CovertXYAxis(int index)
{
if (index >= 0 && index <= 1)
{
var xAxis = m_XAxises[index];
var yAxis = m_YAxises[index];
var tempX = m_XAxises[index].Clone();
xAxis.Copy(m_YAxises[index]);
yAxis.Copy(tempX);
xAxis.runtimeZeroXOffset = 0;
xAxis.runtimeZeroYOffset = 0;
yAxis.runtimeZeroXOffset = 0;
yAxis.runtimeZeroYOffset = 0;
xAxis.runtimeMinValue = 0;
xAxis.runtimeMaxValue = 0;
yAxis.runtimeMinValue = 0;
yAxis.runtimeMaxValue = 0;
RefreshChart();
}
}
/// <summary>
/// 更新坐标系原点和宽高
/// </summary>
public void UpdateCoordinate()
{
m_CoordinateX = m_ChartX + m_Grid.left;
m_CoordinateY = m_ChartY + m_Grid.bottom;
m_CoordinateWidth = m_ChartWidth - m_Grid.left - m_Grid.right;
m_CoordinateHeight = m_ChartHeight - m_Grid.top - m_Grid.bottom;
}
/// <summary>
/// 设置可缓存的最大数据量。当数据量超过该值时,会自动删除第一个值再加入最新值。
/// </summary>
public void SetMaxCache(int maxCache)
{
foreach (var serie in m_Series.list) serie.maxCache = maxCache;
foreach (var axis in m_XAxises) axis.maxCache = maxCache;
foreach (var axis in m_YAxises) axis.maxCache = maxCache;
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 032e5d8f514854bf39f5fd7052119271
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 UnityEngine;
namespace XCharts
{
public partial class LiquidChart
{
/// <summary>
/// 容器组件列表。
/// </summary>
public List<Vessel> vessels { get { return m_Vessels; } }
/// <summary>
/// 移除所有容器组件。
/// </summary>
public void RemoveVessel()
{
m_Vessels.Clear();
}
/// <summary>
/// 添加容器组件。
/// </summary>
public void AddVessel(Vessel vessel)
{
m_Vessels.Add(vessel);
}
/// <summary>
/// 添加容器组件。
/// </summary>
public Vessel AddVessel(Vessel.Shape shape, Vector2 center, float radius)
{
var vessel = new Vessel();
vessel.shape = shape;
vessel.radius = radius;
vessel.center[0] = center.x;
vessel.center[1] = center.y;
AddVessel(vessel);
return vessel;
}
/// <summary>
/// 获得指定索引的容器组件。
/// </summary>
/// <param name="radarIndex"></param>
/// <returns></returns>
public Vessel GetVessel(int vesselIndex)
{
if (vesselIndex < 0 || vesselIndex > m_Vessels.Count - 1) return null;
return m_Vessels[vesselIndex];
}
}
}

View File

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

View File

@@ -1,30 +0,0 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
using System.Collections.Generic;
using UnityEngine;
namespace XCharts
{
public partial class PolarChart
{
/// <summary>
/// 极坐标。
/// </summary>
public Polar polar { get { return m_Polar; } }
/// <summary>
/// Angle axis of Polar Coordinate.
/// 极坐标系的角度轴。
/// </summary>
public AngleAxis angleAxis { get { return m_AngleAxis; } }
/// <summary>
/// Radial axis of polar coordinate.
/// 极坐标系的径向轴。
/// </summary>
public RadiusAxis radiusAxis { get { return m_RadiusAxis; } }
}
}

View File

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

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