-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtree-radial.html
99 lines (82 loc) · 2.87 KB
/
tree-radial.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!--
THIS EXAMPLE WAS DOWNLOADED FROM https://echarts.apache.org/examples/zh/editor.html?c=tree-radial&lang=js
-->
<!DOCTYPE html>
<html style="height: 100%; width: 100%; overflow-y: scroll;">
<head>
<meta charset="utf-8">
</head>
<body style="height: 100%; margin: 0; width: 100%;">
<div id="container" style="height: 100%; width: 100%;">
<div id="chartContainer" style="width: 100%; min-height: 1600px"></div>
</div>
<!--<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>-->
<script src="./js/jquery.js"></script>
<!--<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js"></script>-->
<script type="text/javascript" src="./js/echarts.min.js"></script>
<!-- Uncomment this line if you want to dataTool extension
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/extension/dataTool.min.js"></script>
-->
<!-- Uncomment this line if you want to use gl extension
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-gl@2/dist/echarts-gl.min.js"></script>
-->
<!-- Uncomment this line if you want to echarts-stat extension
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-stat@latest/dist/ecStat.min.js"></script>
-->
<!-- Uncomment this line if you want to use map
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/map/js/china.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/map/js/world.js"></script>
-->
<!-- Uncomment these two lines if you want to use bmap extension
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=<Your Key Here>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts@{{version}}/dist/extension/bmap.min.js"></script>
-->
<script type="text/javascript">
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
var app = {};
var option;
myChart.showLoading();
$.get('./bookmarks.json', function (data) {
myChart.hideLoading();
myChart.setOption(
(option = {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove'
},
series: [
{
type: 'tree',
data: [data],
top: '18%',
bottom: '14%',
layout: 'radial',
symbol: 'emptyCircle',
symbolSize: 7,
initialTreeDepth: 4,
animationDurationUpdate: 750,
emphasis: {
focus: 'descendant'
}
}
]
})
);
});
if (option && typeof option === 'object') {
myChart.setOption(option);
}
$(window).on('resize', function () {
if (myChart != null && myChart != undefined) {
myChart.resize();
}
});
myChart.on('click', function (params) {
if (params.data && params.data.url) {
window.open(params.data.url);
}
});
</script>
</body>
</html>