Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
a315dca0
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a315dca0
编写于
10月 11, 2017
作者:
D
deqingli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format tooltip
上级
526feb39
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
12008 addition
and
75 deletion
+12008
-75
src/chart/tree/TreeSeries.js
src/chart/tree/TreeSeries.js
+12
-13
src/chart/tree/TreeView.js
src/chart/tree/TreeView.js
+6
-1
src/chart/tree/orthogonalLayout.js
src/chart/tree/orthogonalLayout.js
+1
-1
src/chart/tree/traversalHelper.js
src/chart/tree/traversalHelper.js
+1
-1
test/data/ec-option-doc-statistics-201604.json
test/data/ec-option-doc-statistics-201604.json
+11714
-0
test/data/ice-bucket-challenge.json
test/data/ice-bucket-challenge.json
+1
-0
test/tree-basic.html
test/tree-basic.html
+30
-20
test/tree-legend.html
test/tree-legend.html
+229
-38
test/tree-radial.html
test/tree-radial.html
+8
-1
test/tree-vertical.html
test/tree-vertical.html
+6
-0
未找到文件。
src/chart/tree/TreeSeries.js
浏览文件 @
a315dca0
...
@@ -62,20 +62,19 @@ define(function (require) {
...
@@ -62,20 +62,19 @@ define(function (require) {
/**
/**
* @override
* @override
* @param {number} dataIndex
* @param {number} dataIndex
* @param {boolean} [mutipleSeries=false]
*/
*/
//
formatTooltip: function (dataIndex) {
formatTooltip
:
function
(
dataIndex
)
{
//
var tree = this.getData().tree;
var
tree
=
this
.
getData
().
tree
;
//
var realRoot = tree.root.children[0];
var
realRoot
=
tree
.
root
.
children
[
0
];
//
var node = tree.getNodeByDataIndex(dataIndex);
var
node
=
tree
.
getNodeByDataIndex
(
dataIndex
);
// var name = node.name
;
var
value
=
node
.
getValue
()
;
// while (node.parentNode !== realRoot) {
var
name
=
node
.
name
;
// name = node.parentNode.name + '.' + name;
while
(
node
&&
(
node
!==
realRoot
))
{
// }
name
=
node
.
parentNode
.
name
+
'
.
'
+
name
;
// name = realRoot.name + '.' + nam
e;
node
=
node
.
parentNod
e
;
// var value = this.getValue(dataIndex);
}
// return encodeHTML(name + ':
' + value);
return
encodeHTML
(
name
+
'
:
'
+
value
);
//
},
},
defaultOption
:
{
defaultOption
:
{
zlevel
:
0
,
zlevel
:
0
,
...
...
src/chart/tree/TreeView.js
浏览文件 @
a315dca0
...
@@ -105,7 +105,12 @@ define(function (require) {
...
@@ -105,7 +105,12 @@ define(function (require) {
this
.
_data
=
data
;
this
.
_data
=
data
;
},
},
dispose
:
function
()
{}
dispose
:
function
()
{},
remove
:
function
()
{
this
.
_mainGroup
.
removeAll
();
this
.
_data
=
null
;
}
});
});
...
...
src/chart/tree/orthogonalLayout.js
浏览文件 @
a315dca0
...
@@ -5,7 +5,7 @@ define(function (require) {
...
@@ -5,7 +5,7 @@ define(function (require) {
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
,
api
)
{
ecModel
.
eachSeriesByType
(
'
tree
'
,
function
(
seriesModel
)
{
ecModel
.
eachSeriesByType
(
'
tree
'
,
function
(
seriesModel
)
{
commonLayout
(
seriesModel
,
api
);
commonLayout
(
seriesModel
,
api
);
});
});
};
};
});
});
\ No newline at end of file
src/chart/tree/traversalHelper.js
浏览文件 @
a315dca0
...
@@ -18,7 +18,7 @@ define(function (require) {
...
@@ -18,7 +18,7 @@ define(function (require) {
var
children
=
node
.
children
;
var
children
=
node
.
children
;
if
(
children
.
length
)
{
if
(
children
.
length
)
{
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
children
.
length
;
i
++
)
{
nodes
.
push
(
children
[
i
]);
nodes
.
push
(
children
[
i
]);
}
}
}
}
}
}
...
...
test/data/ec-option-doc-statistics-201604.json
0 → 100644
浏览文件 @
a315dca0
此差异已折叠。
点击以展开。
test/data/ice-bucket-challenge.json
0 → 100644
浏览文件 @
a315dca0
{
"name"
:
"冰桶挑战"
,
"children"
:[{
"name"
:
"刘作虎"
,
"children"
:[{
"name"
:
"周鸿祎"
,
"children"
:[{
"name"
:
"马化腾"
},{
"name"
:
"徐小平"
,
"children"
:[{
"name"
:
"牛文文"
,
"children"
:[{
"name"
:
"姚劲波"
,
"children"
:[{
"name"
:
"蔡文胜"
},{
"name"
:
"蔡明"
},{
"name"
:
"汪小菲"
}]},{
"name"
:
"杨守彬"
,
"children"
:[{
"name"
:
"所有的创业者"
},{
"name"
:
"所有的投资人"
},{
"name"
:
"所有的创业服务机构"
}]},{
"name"
:
"蒲易"
}]},{
"name"
:
"罗振宇"
,
"children"
:[{
"name"
:
"罗辑思维25000名会员"
}]},{
"name"
:
"黄西"
}]},{
"name"
:
"黄章"
}]},{
"name"
:
"罗永浩"
},{
"name"
:
"刘江峰"
,
"children"
:[{
"name"
:
"何刚"
,
"children"
:[{
"name"
:
"谢清江"
},{
"name"
:
"王翔"
},{
"name"
:
"艾伟"
}]},{
"name"
:
"王煜磊"
}]}]},{
"name"
:
"雷军"
,
"children"
:[{
"name"
:
"刘德华"
,
"children"
:[{
"name"
:
"朗朗"
},{
"name"
:
"苏桦伟"
},{
"name"
:
"周杰伦"
,
"children"
:[{
"name"
:
"方文山"
,
"children"
:[{
"name"
:
"九把刀"
},{
"name"
:
"柯有伦"
}]},{
"name"
:
"五月天"
,
"children"
:[{
"name"
:
"谢金燕"
,
"children"
:[{
"name"
:
"赵慧仙"
},{
"name"
:
"张菲"
,
"children"
:[{
"name"
:
"小S"
}]},{
"name"
:
"郭富城"
}]},{
"name"
:
"张震"
},{
"name"
:
"金城武"
}]}]}]},{
"name"
:
"李彦宏"
,
"children"
:[{
"name"
:
"俞敏洪"
},{
"name"
:
"潘石屹"
,
"children"
:[{
"name"
:
"任志强"
}]},{
"name"
:
"田亮"
,
"children"
:[{
"name"
:
"王岳伦"
},{
"name"
:
"小沈阳"
},{
"name"
:
"李小鹏"
}]}]},{
"name"
:
"郭台铭"
,
"children"
:[{
"name"
:
"孙正义"
,
"children"
:[{
"name"
:
"宫坂学"
}]},{
"name"
:
"谢晓亮"
},{
"name"
:
"林志玲"
}]}]},{
"name"
:
"古永锵"
,
"children"
:[{
"name"
:
"马云"
},{
"name"
:
"王长田"
,
"children"
:[{
"name"
:
"邓超"
,
"children"
:[{
"name"
:
"俞白眉"
,
"children"
:[{
"name"
:
"姚晨"
,
"children"
:[{
"name"
:
"吴秀波"
},{
"name"
:
"吴彦祖"
},{
"name"
:
"孙红雷"
}]},{
"name"
:
"朱芳雨"
,
"children"
:[{
"name"
:
"王仕鹏"
,
"children"
:[{
"name"
:
"易建联"
}]}]},{
"name"
:
"梁超"
}]}]},{
"name"
:
"刘亦菲"
},{
"name"
:
"刘同"
}]}]},{
"name"
:
"朱挺"
,
"children"
:[{
"name"
:
"张耀坤"
,
"children"
:[{
"name"
:
"姜宁"
},{
"name"
:
"唐淼"
}]},{
"name"
:
"周海滨"
,
"children"
:[{
"name"
:
"汪嵩"
,
"children"
:[{
"name"
:
"蔡贇"
},{
"name"
:
"李易峰"
},{
"name"
:
"王弢 "
}]},{
"name"
:
"邵佳一"
},{
"name"
:
"高迪"
,
"children"
:[{
"name"
:
"莫雷诺"
},{
"name"
:
"恩里克"
},{
"name"
:
"保罗"
}]}]},{
"name"
:
"阎小闯"
}]},{
"name"
:
"郑璐"
,
"children"
:[{
"name"
:
"于嘉"
,
"children"
:[{
"name"
:
"董成鹏"
,
"children"
:[{
"name"
:
"伊一"
,
"children"
:[{
"name"
:
"许嵩"
},{
"name"
:
"付辛博"
},{
"name"
:
"洪辰"
}]},{
"name"
:
"王祖蓝"
,
"children"
:[{
"name"
:
"王菀之"
},{
"name"
:
"李亚男"
,
"children"
:[{
"name"
:
"宋熙年"
},{
"name"
:
"钟嘉欣"
},{
"name"
:
"陈美诗"
}]},{
"name"
:
"贾玲"
}]},{
"name"
:
"白客"
,
"children"
:[{
"name"
:
"盛宇"
,
"children"
:[{
"name"
:
"邪童 "
},{
"name"
:
"杜海涛"
},{
"name"
:
"汪涵"
}]},{
"name"
:
"派克特"
},{
"name"
:
"谢帝"
,
"children"
:[{
"name"
:
"C-BLOCK小胖"
},{
"name"
:
"范元成"
},{
"name"
:
"隋凯"
,
"children"
:[{
"name"
:
"高以翔"
},{
"name"
:
"马楚成"
}]}]}]}]},{
"name"
:
"易建联、李艾、江映蓉"
}]},{
"name"
:
"Kevin Han"
}]},{
"name"
:
"舒德伟"
,
"children"
:[{
"name"
:
"姚明"
},{
"name"
:
"NBA中国全体员工"
}]},{
"name"
:
"叶丙成"
,
"children"
:[{
"name"
:
"翟本乔"
},{
"name"
:
"嵇晓华"
,
"children"
:[{
"name"
:
"王思聪"
,
"children"
:[{
"name"
:
"易振兴"
,
"children"
:[{
"name"
:
"徐磊"
},{
"name"
:
"佟大为"
,
"children"
:[{
"name"
:
"孟非"
,
"children"
:[{
"name"
:
"郭德纲"
,
"children"
:[{
"name"
:
"于谦"
}]},{
"name"
:
"黄健翔"
,
"children"
:[{
"name"
:
"张琳芃"
,
"children"
:[{
"name"
:
"黄博文"
},{
"name"
:
"李帅"
}]},{
"name"
:
"郜林"
,
"children"
:[{
"name"
:
"刘建宏"
},{
"name"
:
"李玮峰"
}]}]}]},{
"name"
:
"陈坤"
},{
"name"
:
"AKB48"
}]},{
"name"
:
"吴欣鸿"
,
"children"
:[{
"name"
:
"贾乃亮"
},{
"name"
:
"李小璐"
},{
"name"
:
"angelababy"
}]}]},{
"name"
:
"林更新"
,
"children"
:[{
"name"
:
"赵又廷"
},{
"name"
:
"佟丽娅"
},{
"name"
:
"AngelaBaby"
}]},{
"name"
:
"刘军"
}]},{
"name"
:
"魏坤琳"
,
"children"
:[{
"name"
:
"迟毓凯"
},{
"name"
:
"李淼"
},{
"name"
:
"姜振宇"
}]},{
"name"
:
"刘成城"
,
"children"
:[{
"name"
:
"张颖"
},{
"name"
:
"王自如"
,
"children"
:[{
"name"
:
"刘翔"
},{
"name"
:
"吴海"
},{
"name"
:
"傅盛"
}]},{
"name"
:
"汪峰"
}]}]}]},{
"name"
:
"萧上农"
,
"children"
:[{
"name"
:
"林之晨"
,
"children"
:[{
"name"
:
"柯文哲"
,
"children"
:[{
"name"
:
"赵少康"
},{
"name"
:
"魏德圣"
},{
"name"
:
"郭子乾"
}]},{
"name"
:
"连胜文"
,
"children"
:[{
"name"
:
"郝龙斌"
,
"children"
:[{
"name"
:
"卢贝松"
},{
"name"
:
"胡志强"
},{
"name"
:
"邱文达"
}]},{
"name"
:
"朱立伦"
},{
"name"
:
"吴思华"
}]},{
"name"
:
"管中闵"
,
"children"
:[{
"name"
:
"杜紫军"
},{
"name"
:
"陈保基"
},{
"name"
:
"杨泮池"
}]}]},{
"name"
:
"陈素兰"
,
"children"
:[{
"name"
:
"颜漏有"
,
"children"
:[{
"name"
:
"詹宏志"
,
"children"
:[{
"name"
:
"钮承泽"
},{
"name"
:
"李宗盛"
},{
"name"
:
"何飞鹏"
}]},{
"name"
:
"陈清祥"
,
"children"
:[{
"name"
:
"黄日灿"
},{
"name"
:
"黄胜华"
},{
"name"
:
"吴升奇"
}]}]}]},{
"name"
:
"蔡牧民"
}]},{
"name"
:
"林书豪"
,
"children"
:[{
"name"
:
"兰德里-菲尔兹"
},{
"name"
:
"帕森斯"
}]},{
"name"
:
"王猛"
,
"children"
:[{
"name"
:
"杨毅"
},{
"name"
:
"柯凡"
},{
"name"
:
"StephonMarbury"
}]},{
"name"
:
"叶璇"
,
"children"
:[{
"name"
:
"李晨"
},{
"name"
:
"苏芒"
,
"children"
:[{
"name"
:
"黄晓明"
,
"children"
:[{
"name"
:
"范冰冰"
},{
"name"
:
"李冰冰"
,
"children"
:[{
"name"
:
"王中军"
},{
"name"
:
"新浪娱乐"
}]}]}]},{
"name"
:
"陈欧"
}]},{
"name"
:
"章子怡"
,
"children"
:[{
"name"
:
"TFBoys"
,
"children"
:[{
"name"
:
"尚格云顿"
}]},{
"name"
:
"韩庚"
,
"children"
:[{
"name"
:
"迈克尔·贝"
},{
"name"
:
"何炅"
},{
"name"
:
"那英"
}]},{
"name"
:
"苏菲玛索"
}]},{
"name"
:
"张靓颖"
,
"children"
:[{
"name"
:
"张杰"
,
"children"
:[{
"name"
:
"快乐家族"
},{
"name"
:
"李宇春"
},{
"name"
:
"萧敬腾"
}]},{
"name"
:
"王铮亮"
,
"children"
:[{
"name"
:
"天天兄弟"
},{
"name"
:
"武艺"
,
"children"
:[{
"name"
:
"卓文萱"
,
"children"
:[{
"name"
:
"廖俊杰"
,
"children"
:[{
"name"
:
"连晨翔"
,
"children"
:[{
"name"
:
"马振桓"
},{
"name"
:
"萧煌奇"
},{
"name"
:
"诗安"
}]}]}]},{
"name"
:
"阿纬"
},{
"name"
:
"洪卓立"
}]},{
"name"
:
"DJ小强"
}]},{
"name"
:
"Timbaland"
}]},{
"name"
:
"邓紫棋"
,
"children"
:[{
"name"
:
"李蕴"
,
"children"
:[{
"name"
:
"何超莲"
,
"children"
:[{
"name"
:
"吴克群"
,
"children"
:[{
"name"
:
" 何猷啟"
},{
"name"
:
"陈泽杉"
}]},{
"name"
:
"卡提娜"
},{
"name"
:
"jw_amusic "
}]},{
"name"
:
"诗雅"
},{
"name"
:
"陈静"
}]},{
"name"
:
"蔡卓妍"
,
"children"
:[{
"name"
:
"钟欣桐"
,
"children"
:[{
"name"
:
"乔振宇"
,
"children"
:[{
"name"
:
"马天宇"
},{
"name"
:
"陈伟霆"
,
"children"
:[{
"name"
:
"霍汶希"
}]},{
"name"
:
"高伟光"
}]},{
"name"
:
" 周汤豪"
},{
"name"
:
"黃鴻升"
}]},{
"name"
:
"谢娜"
},{
"name"
:
"詹瑞文"
}]},{
"name"
:
"茜拉"
,
"children"
:[{
"name"
:
"EXO-M"
},{
"name"
:
"巫启贤"
}]}]},{
"name"
:
"卫诗雅"
,
"children"
:[{
"name"
:
"吴君如"
},{
"name"
:
"邹凯光"
},{
"name"
:
"钟舒漫"
}]},{
"name"
:
"容祖儿"
,
"children"
:[{
"name"
:
"梁家辉"
},{
"name"
:
"黄伟文"
}]},{
"name"
:
"蔡一智"
,
"children"
:[{
"name"
:
"陈奕迅"
,
"children"
:[{
"name"
:
"谢霆锋"
,
"children"
:[{
"name"
:
"桂纶镁"
,
"children"
:[{
"name"
:
"舒淇"
},{
"name"
:
"张惠妹"
},{
"name"
:
"孙燕姿"
}]},{
"name"
:
"林丹"
},{
"name"
:
"李云迪"
}]},{
"name"
:
"范晓萱"
},{
"name"
:
"张一白"
,
"children"
:[{
"name"
:
"彭于晏"
,
"children"
:[{
"name"
:
"林超贤"
}]},{
"name"
:
"魏晨"
,
"children"
:[{
"name"
:
"秦凯"
,
"children"
:[{
"name"
:
"孙杨"
,
"children"
:[{
"name"
:
"张学友"
},{
"name"
:
"华少"
}]},{
"name"
:
"吴敏霞"
},{
"name"
:
"陈一冰"
}]}]},{
"name"
:
"张嘉佳"
}]}]},{
"name"
:
"葛民辉"
},{
"name"
:
"郑伊健"
,
"children"
:[{
"name"
:
"陈小春"
},{
"name"
:
"谢天华"
}]}]},{
"name"
:
"林俊杰"
,
"children"
:[{
"name"
:
"王力宏"
},{
"name"
:
"蔡依林"
}]},{
"name"
:
"徐峥"
,
"children"
:[{
"name"
:
"李连杰"
},{
"name"
:
"韩寒"
},{
"name"
:
"赵薇"
}]},{
"name"
:
"刘循子墨"
,
"children"
:[{
"name"
:
"薛之谦"
},{
"name"
:
"杨姗姗"
}]},{
"name"
:
"王自健"
,
"children"
:[{
"name"
:
"郑凯"
},{
"name"
:
"刘江"
},{
"name"
:
"刘涛"
}]},{
"name"
:
"罗震环"
,
"children"
:[{
"name"
:
"邹凯"
,
"children"
:[{
"name"
:
"许嵩 "
},{
"name"
:
"张成龙"
},{
"name"
:
"邹市明 "
}]},{
"name"
:
"林琪雪"
,
"children"
:[{
"name"
:
"禹景曦"
,
"children"
:[{
"name"
:
"张翔玲"
,
"children"
:[{
"name"
:
"PLU小米"
},{
"name"
:
"高地平"
}]},{
"name"
:
"戴士"
,
"children"
:[{
"name"
:
"杨丰智"
},{
"name"
:
"李鑫"
},{
"name"
:
"卢本伟"
,
"children"
:[{
"name"
:
"孙亚龙"
},{
"name"
:
"瞿申图"
},{
"name"
:
"朱永权"
}]}]},{
"name"
:
"裴乐"
,
"children"
:[{
"name"
:
"沈伟荣"
,
"children"
:[{
"name"
:
"金亦波"
},{
"name"
:
"卞正伟"
}]},{
"name"
:
"李君"
}]}]},{
"name"
:
"孔连顺"
,
"children"
:[{
"name"
:
"老湿"
,
"children"
:[{
"name"
:
"至尊玉"
},{
"name"
:
"马俊"
},{
"name"
:
"颜土豆avi"
}]},{
"name"
:
"小爱"
},{
"name"
:
"马诗歌"
,
"children"
:[{
"name"
:
"张本煜"
}]}]},{
"name"
:
"孙博文"
,
"children"
:[{
"name"
:
"陈剑书"
},{
"name"
:
"陈琦栋"
},{
"name"
:
"滕林季"
}]}]},{
"name"
:
"沈建宏"
,
"children"
:[{
"name"
:
"陈奕"
,
"children"
:[{
"name"
:
"炎亚纶"
},{
"name"
:
"张榕容"
},{
"name"
:
"刘希平"
}]},{
"name"
:
"何润东"
,
"children"
:[{
"name"
:
"俞永福"
,
"children"
:[{
"name"
:
"曹国伟"
},{
"name"
:
"余承东"
},{
"name"
:
"金池"
,
"children"
:[{
"name"
:
"曹格"
},{
"name"
:
"魏雪漫"
},{
"name"
:
"曾一鸣 "
}]}]},{
"name"
:
"郭品超"
},{
"name"
:
"霍建华 "
}]},{
"name"
:
"张根硕"
}]}]},{
"name"
:
"涂松岩"
,
"children"
:[{
"name"
:
"海清"
},{
"name"
:
"张韵艺"
},{
"name"
:
"王媛可"
}]},{
"name"
:
"陈嘉上"
,
"children"
:[{
"name"
:
"包贝尔"
,
"children"
:[{
"name"
:
"陈赫"
},{
"name"
:
"杨子姗"
}]}]},{
"name"
:
"留几手"
,
"children"
:[{
"name"
:
"夏河"
},{
"name"
:
"陆琪"
,
"children"
:[{
"name"
:
"贝志诚"
},{
"name"
:
"孙杰"
}]},{
"name"
:
"张辛苑"
,
"children"
:[{
"name"
:
"黄轩"
},{
"name"
:
"古川雄辉"
},{
"name"
:
"蒋劲夫"
}]}]},{
"name"
:
"郑希怡"
,
"children"
:[{
"name"
:
"古巨基"
,
"children"
:[{
"name"
:
"崔始源"
,
"children"
:[{
"name"
:
"朴正洙"
},{
"name"
:
"金希澈"
}]},{
"name"
:
"黄子华"
}]}]},{
"name"
:
"宁浩"
,
"children"
:[{
"name"
:
"徐铮"
},{
"name"
:
"黄渤"
},{
"name"
:
"雷佳音"
}]},{
"name"
:
"鈕承澤"
,
"children"
:[{
"name"
:
"陈意涵"
,
"children"
:[{
"name"
:
"张钧甯"
},{
"name"
:
"陈柏霖"
,
"children"
:[{
"name"
:
"冯绍峰"
},{
"name"
:
"高华阳"
,
"children"
:[{
"name"
:
"王志鹏"
},{
"name"
:
"李东霖"
},{
"name"
:
"夏青"
}]}]},{
"name"
:
"池珍熙"
}]},{
"name"
:
"阮经天"
}]},{
"name"
:
"周显扬"
,
"children"
:[{
"name"
:
"王珞丹"
},{
"name"
:
"井柏然"
},{
"name"
:
"张晋"
}]},{
"name"
:
"徐熙娣"
,
"children"
:[{
"name"
:
"蔡康永"
}]},{
"name"
:
"刘俊纬"
,
"children"
:[{
"name"
:
"杨奇煜"
,
"children"
:[{
"name"
:
"曾志伟"
},{
"name"
:
"张艾亚"
,
"children"
:[{
"name"
:
"房思瑜"
}]}]},{
"name"
:
"林峰"
}]},{
"name"
:
"周汤豪"
,
"children"
:[{
"name"
:
"庄濠全"
,
"children"
:[{
"name"
:
"罗志祥"
},{
"name"
:
"簡愷樂"
}]},{
"name"
:
"林暐恒"
},{
"name"
:
"王雪娥"
,
"children"
:[{
"name"
:
"洪炜宁"
}]}]},{
"name"
:
"杨颖"
,
"children"
:[{
"name"
:
"倪妮"
}]},{
"name"
:
"董子健"
,
"children"
:[{
"name"
:
"郭京飞"
,
"children"
:[{
"name"
:
"袁咏仪"
},{
"name"
:
"钱芳"
}]},{
"name"
:
"陆毅"
},{
"name"
:
"关锦鹏"
}]}]}
\ No newline at end of file
test/tree-basic.html
浏览文件 @
a315dca0
...
@@ -30,26 +30,40 @@
...
@@ -30,26 +30,40 @@
chart
.
resize
();
chart
.
resize
();
};
};
$
.
getJSON
(
'
./data/flare.json
'
)
$
.
getJSON
(
'
./data/ec-option-doc-statistics-201604.json
'
)
.
done
(
function
(
data
)
{
.
done
(
function
(
rawData
)
{
function
convert
(
source
,
target
,
basePath
)
{
for
(
var
key
in
source
)
{
var
path
=
key
;
if
(
key
.
match
(
/^
\$
/
))
{
}
else
{
target
.
children
=
target
.
children
||
[];
var
child
=
{
name
:
path
};
target
.
children
.
push
(
child
);
convert
(
source
[
key
],
child
,
path
);
}
}
if
(
!
target
.
children
)
{
target
.
value
=
source
.
$count
||
1
;
}
}
var
data
=
{
name
:
'
option
'
};
convert
(
rawData
,
data
,
''
);
chart
.
setOption
({
chart
.
setOption
({
tooltip
:
{
tooltip
:
{
trigger
:
'
item
'
,
trigger
:
'
item
'
,
triggerOn
:
'
mousemove
'
,
triggerOn
:
'
mousemove
'
formatter
:
function
(
params
)
{
var
data
=
params
.
data
;
var
tree
=
this
.
getData
().
tree
;
var
realRoot
=
tree
.
root
.
children
[
0
];
var
node
=
tree
.
getNodeByDataIndex
(
dataIndex
);
var
name
=
node
.
name
;
while
(
node
.
parentNode
!==
realRoot
)
{
name
=
node
.
parentNode
.
name
+
'
.
'
+
name
;
}
name
=
realRoot
.
name
+
'
.
'
+
name
;
var
value
=
this
.
getValue
(
dataIndex
);
return
encodeHTML
(
name
+
'
:
'
+
value
);
}
},
},
series
:[
series
:[
...
@@ -85,13 +99,9 @@
...
@@ -85,13 +99,9 @@
}
}
},
},
expandAndCollapse
:
true
,
expandAndCollapse
:
true
,
animationDuration
:
550
,
animationDuration
:
550
,
animationDurationUpdate
:
750
animationDurationUpdate
:
750
}
}
]
]
});
});
...
...
test/tree-legend.html
浏览文件 @
a315dca0
...
@@ -31,60 +31,251 @@
...
@@ -31,60 +31,251 @@
chart
.
resize
();
chart
.
resize
();
};
};
$
.
getJSON
(
'
./data/flare.json
'
)
var
data1
=
{
.
done
(
function
(
data
)
{
"
name
"
:
"
flare
"
,
chart
.
setOption
({
"
children
"
:
[
{
series
:[
"
name
"
:
"
data
"
,
"
children
"
:
[
{
"
name
"
:
"
converters
"
,
"
children
"
:
[
{
"
name
"
:
"
Converters
"
,
"
value
"
:
721
},
{
"
name
"
:
"
DelimitedTextConverter
"
,
"
value
"
:
4294
}
]
},
{
"
name
"
:
"
DataUtil
"
,
"
value
"
:
3322
}
]
},
{
"
name
"
:
"
display
"
,
"
children
"
:
[
{
"
name
"
:
"
DirtySprite
"
,
"
value
"
:
8833
},
{
"
name
"
:
"
LineSprite
"
,
"
value
"
:
1732
},
{
"
name
"
:
"
RectSprite
"
,
"
value
"
:
3623
}
]
},
{
"
name
"
:
"
flex
"
,
"
children
"
:
[
{
"
name
"
:
"
FlareVis
"
,
"
value
"
:
4116
}
]
},
{
"
name
"
:
"
query
"
,
"
children
"
:
[
{
"
name
"
:
"
AggregateExpression
"
,
"
value
"
:
1616
},
{
"
name
"
:
"
And
"
,
"
value
"
:
1027
},
{
"
name
"
:
"
Arithmetic
"
,
"
value
"
:
3891
},
{
"
name
"
:
"
Average
"
,
"
value
"
:
891
},
{
"
name
"
:
"
BinaryExpression
"
,
"
value
"
:
2893
},
{
"
name
"
:
"
Comparison
"
,
"
value
"
:
5103
},
{
"
name
"
:
"
CompositeExpression
"
,
"
value
"
:
3677
},
{
"
name
"
:
"
Count
"
,
"
value
"
:
781
},
{
"
name
"
:
"
DateUtil
"
,
"
value
"
:
4141
},
{
"
name
"
:
"
Distinct
"
,
"
value
"
:
933
},
{
"
name
"
:
"
Expression
"
,
"
value
"
:
5130
},
{
"
name
"
:
"
ExpressionIterator
"
,
"
value
"
:
3617
},
{
"
name
"
:
"
Fn
"
,
"
value
"
:
3240
},
{
"
name
"
:
"
If
"
,
"
value
"
:
2732
},
{
"
name
"
:
"
IsA
"
,
"
value
"
:
2039
},
{
"
name
"
:
"
Literal
"
,
"
value
"
:
1214
},
{
"
name
"
:
"
Match
"
,
"
value
"
:
3748
},
{
"
name
"
:
"
Maximum
"
,
"
value
"
:
843
},
{
{
type
:
'
tree
'
,
"
name
"
:
"
methods
"
,
"
children
"
:
[
{
"
name
"
:
"
add
"
,
"
value
"
:
593
},
{
"
name
"
:
"
and
"
,
"
value
"
:
330
},
{
"
name
"
:
"
average
"
,
"
value
"
:
287
},
{
"
name
"
:
"
count
"
,
"
value
"
:
277
},
{
"
name
"
:
"
distinct
"
,
"
value
"
:
292
},
{
"
name
"
:
"
div
"
,
"
value
"
:
595
},
{
"
name
"
:
"
eq
"
,
"
value
"
:
594
},
{
"
name
"
:
"
fn
"
,
"
value
"
:
460
},
{
"
name
"
:
"
gt
"
,
"
value
"
:
603
},
{
"
name
"
:
"
gte
"
,
"
value
"
:
625
},
{
"
name
"
:
"
iff
"
,
"
value
"
:
748
},
{
"
name
"
:
"
isa
"
,
"
value
"
:
461
},
{
"
name
"
:
"
lt
"
,
"
value
"
:
597
},
{
"
name
"
:
"
lte
"
,
"
value
"
:
619
},
{
"
name
"
:
"
max
"
,
"
value
"
:
283
},
{
"
name
"
:
"
min
"
,
"
value
"
:
283
},
{
"
name
"
:
"
mod
"
,
"
value
"
:
591
},
{
"
name
"
:
"
mul
"
,
"
value
"
:
603
},
{
"
name
"
:
"
neq
"
,
"
value
"
:
599
},
{
"
name
"
:
"
not
"
,
"
value
"
:
386
},
{
"
name
"
:
"
or
"
,
"
value
"
:
323
},
{
"
name
"
:
"
orderby
"
,
"
value
"
:
307
},
{
"
name
"
:
"
range
"
,
"
value
"
:
772
},
{
"
name
"
:
"
select
"
,
"
value
"
:
296
},
{
"
name
"
:
"
stddev
"
,
"
value
"
:
363
},
{
"
name
"
:
"
sub
"
,
"
value
"
:
600
},
{
"
name
"
:
"
sum
"
,
"
value
"
:
280
},
{
"
name
"
:
"
update
"
,
"
value
"
:
307
},
{
"
name
"
:
"
variance
"
,
"
value
"
:
335
},
{
"
name
"
:
"
where
"
,
"
value
"
:
299
},
{
"
name
"
:
"
xor
"
,
"
value
"
:
354
},
{
"
name
"
:
"
_
"
,
"
value
"
:
264
}
]
},
{
"
name
"
:
"
Minimum
"
,
"
value
"
:
843
},
{
"
name
"
:
"
Not
"
,
"
value
"
:
1554
},
{
"
name
"
:
"
Or
"
,
"
value
"
:
970
},
{
"
name
"
:
"
Query
"
,
"
value
"
:
13896
},
{
"
name
"
:
"
Range
"
,
"
value
"
:
1594
},
{
"
name
"
:
"
StringUtil
"
,
"
value
"
:
4130
},
{
"
name
"
:
"
Sum
"
,
"
value
"
:
791
},
{
"
name
"
:
"
Variable
"
,
"
value
"
:
1124
},
{
"
name
"
:
"
Variance
"
,
"
value
"
:
1876
},
{
"
name
"
:
"
Xor
"
,
"
value
"
:
1101
}
]
},
{
"
name
"
:
"
scale
"
,
"
children
"
:
[
{
"
name
"
:
"
IScaleMap
"
,
"
value
"
:
2105
},
{
"
name
"
:
"
LinearScale
"
,
"
value
"
:
1316
},
{
"
name
"
:
"
LogScale
"
,
"
value
"
:
3151
},
{
"
name
"
:
"
OrdinalScale
"
,
"
value
"
:
3770
},
{
"
name
"
:
"
QuantileScale
"
,
"
value
"
:
2435
},
{
"
name
"
:
"
QuantitativeScale
"
,
"
value
"
:
4839
},
{
"
name
"
:
"
RootScale
"
,
"
value
"
:
1756
},
{
"
name
"
:
"
Scale
"
,
"
value
"
:
4268
},
{
"
name
"
:
"
ScaleType
"
,
"
value
"
:
1821
},
{
"
name
"
:
"
TimeScale
"
,
"
value
"
:
5833
}
]
}
]
};
var
data2
=
{
"
name
"
:
"
flare
"
,
"
children
"
:
[
{
"
name
"
:
"
data
"
,
"
children
"
:
[
{
"
name
"
:
"
converters
"
,
"
children
"
:
[
{
"
name
"
:
"
DelimitedTextConverter
"
,
"
value
"
:
4294
}
]
}
]
},
{
"
name
"
:
"
display
"
,
"
children
"
:
[
{
"
name
"
:
"
DirtySprite
"
,
"
value
"
:
8833
}
]
}
]
};
chart
.
setOption
({
data
:
[
data
],
tooltip
:
{
trigger
:
'
item
'
,
triggerOn
:
'
mousemove
'
},
top
:
'
2%
'
,
legend
:
{
left
:
'
7%
'
,
top
:
'
2%
'
,
bottom
:
'
2%
'
,
left
:
'
3%
'
,
right
:
'
20%
'
,
orient
:
'
vertical
'
,
data
:
[{
name
:
'
tree1
'
,
icon
:
'
rectangle
'
}
,
{
name
:
'
tree2
'
,
icon
:
'
rectangle
'
}],
borderColor
:
'
#c23531
'
},
symbolSize
:
7
,
series
:[
{
type
:
'
tree
'
,
initialTreeDepth
:
1
,
name
:
'
tree1
'
,
data
:
[
data1
],
top
:
'
5%
'
,
left
:
'
7%
'
,
bottom
:
'
2%
'
,
right
:
'
60%
'
,
symbolSize
:
7
,
initialTreeDepth
:
2
,
label
:
{
normal
:
{
position
:
'
left
'
,
verticalAlign
:
'
middle
'
,
align
:
'
right
'
}
},
leaves
:
{
label
:
{
label
:
{
normal
:
{
normal
:
{
position
:
'
lef
t
'
,
position
:
'
righ
t
'
,
verticalAlign
:
'
middle
'
,
verticalAlign
:
'
middle
'
,
align
:
'
righ
t
'
align
:
'
lef
t
'
}
}
},
}
},
leaves
:
{
expandAndCollapse
:
true
,
label
:
{
normal
:
{
position
:
'
right
'
,
verticalAlign
:
'
middle
'
,
align
:
'
left
'
}
}
},
legend
:
{
animationDuration
:
550
,
data
:
[]
animationDurationUpdate
:
750
},
tooltip
:
{
},
trigger
:
'
item
'
,
{
triggerOn
:
'
mousemove
'
type
:
'
tree
'
,
},
name
:
'
tree2
'
,
data
:
[
data2
],
top
:
'
5%
'
,
left
:
'
60%
'
,
bottom
:
'
2%
'
,
right
:
'
20%
'
,
symbolSize
:
7
,
expandAndCollapse
:
true
,
initialTreeDepth
:
1
,
label
:
{
normal
:
{
position
:
'
left
'
,
verticalAlign
:
'
middle
'
,
align
:
'
right
'
}
},
leaves
:
{
label
:
{
normal
:
{
position
:
'
right
'
,
verticalAlign
:
'
middle
'
,
align
:
'
left
'
}
}
},
animationDuration
:
550
,
expandAndCollapse
:
true
,
animationDurationUpdate
:
750
}
animationDuration
:
550
,
]
animationDurationUpdate
:
750
});
}
]
});
});
});
});
</script>
</script>
...
...
test/tree-radial.html
浏览文件 @
a315dca0
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
require
([
require
([
'
echarts
'
,
'
echarts
'
,
'
echarts/chart/tree
'
,
'
echarts/chart/tree
'
,
'
echarts/component/tooltip
'
],
function
(
echarts
)
{
],
function
(
echarts
)
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
renderer
:
'
canvas
'
renderer
:
'
canvas
'
...
@@ -33,13 +34,19 @@
...
@@ -33,13 +34,19 @@
.
done
(
function
(
data
)
{
.
done
(
function
(
data
)
{
chart
.
setOption
({
chart
.
setOption
({
tooltip
:
{
trigger
:
'
item
'
,
triggerOn
:
'
mousemove
'
},
series
:[
series
:[
{
{
type
:
'
tree
'
,
type
:
'
tree
'
,
data
:
[
data
],
data
:
[
data
],
top
:
'
16%
'
,
top
:
'
18%
'
,
bottom
:
'
14%
'
,
layout
:
'
radial
'
,
layout
:
'
radial
'
,
...
...
test/tree-vertical.html
浏览文件 @
a315dca0
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
require
([
require
([
'
echarts
'
,
'
echarts
'
,
'
echarts/chart/tree
'
,
'
echarts/chart/tree
'
,
'
echarts/component/tooltip
'
],
function
(
echarts
)
{
],
function
(
echarts
)
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
null
,
{
renderer
:
'
canvas
'
renderer
:
'
canvas
'
...
@@ -33,6 +34,11 @@
...
@@ -33,6 +34,11 @@
.
done
(
function
(
data
)
{
.
done
(
function
(
data
)
{
chart
.
setOption
({
chart
.
setOption
({
tooltip
:
{
trigger
:
'
item
'
,
triggerOn
:
'
mousemove
'
},
series
:[
series
:[
{
{
type
:
'
tree
'
,
type
:
'
tree
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录