-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (54 loc) · 1.41 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>EWordcloud</title>
<style>
.test{
height:600px;
width:600px;
}
</style>
</head>
<body>
<div class="test">11</div>
11
<script src="./dist/ec-wordcloud.js"></script>
<script type="text/javascript">
let list=[
['Google', 10],
['Tencent', 9],
['Alibaba', 7],
['Baidu', 6],
['NetEase', 4],
['JD', 5],
['Youku', 4],
['Meituan', 3],
['Douban', 3]
]
for (var i = 0; i < 50; i++) {
list.push(['蛤蛤', 5])
}
for (var i = 0; i < 50; i++) {
list.push(['记者', 5])
}
let options={
tooltip:{
show: true
},
// list,
data:[{name:'2',value:11},{name:'22',value:10}],
ellipticity: 1,
// shape:'triangle',
"gridSize": 6, // size of the grid in pixels
"fontWeight": 'normal', // 'normal', 'bold' or a callback
"fontFamily": 'Times, serif', // font to use
"color": 'random-light', // 'random-dark' or 'random-light'
"backgroundColor": '#333', // the color of canvas
"rotateRatio": 0 // probability for the word to rotate. 1 means always rotate
}
let test=document.querySelector('.test')
let app=new ECWordcloud(test)
app.setOption(options)
</script>
</body>
</html>