HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 10%;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
anychart.theme('lightBlue');
3
// create data set on our data
4
var dataSet = anychart.data.set([
5
['專頁粉絲總數(知名度)',1.00,0.99,0.95,0.92,0.89,0.87,0.81,0.61,0.77,0.72,0.72,0.66,0.66,0.65,0.64,0.68],
6
['按讚率', 0.16,0.47,1.00,0.07,0.53,0.19,0.50,0.32,0.21,0.16,0.33,0.61,0.19,0.17,0.10,0.16],
7
['留言率', 0.53,0.43,0.44,0.14,0.99,0.13,1.00,0.07,0.38,0.49,0.23,0.30,0.19,0.81,0.09,0.22],
8
['發文頻率', 1.00,0.73,0.26,0.76,0.73,0.91,0.62,0.42,0.47,0.69,0.64,0.96,0.55,0.75,0.82,0.37],
9
['分享率', 0.21,0.19,0.26,0.02,0.54,0.12,0.25,0.01,0.27,0.35,0.16,0.14,0.05,1.00,0.06,0.21]
10
]);
11
12
// map data for the first series, take x from the zero column and value from the first column of data set
13
var data1 = dataSet.mapAs({
14
'x': 0,
15
'value': 1
16
});
17
// map data for the second series, take x from the zero column and value from the second column of data set
18
var data2 = dataSet.mapAs({
19
'x': 0,
20
'value': 2
21
});
22
// map data for the third series, take x from the zero column and value from the third column of data set
23
var data3 = dataSet.mapAs({
24
'x': 0,
25
'value': 3
26
});
27
28
var data4 = dataSet.mapAs({
29
'x': 0,
30
'value': 4
31
});
32
33
var data5 = dataSet.mapAs({
34
'x': 0,
35
'value': 5
36
});
37
38
var data6 = dataSet.mapAs({
39
'x': 0,
40
'value': 6
41
});
42
43
var data7 = dataSet.mapAs({
44
'x': 0,
45
'value': 7
46
});
47
48
var data8 = dataSet.mapAs({
49
'x': 0,
50
'value': 8
51
});
52
53
var data9 = dataSet.mapAs({
54
'x': 0,
55
'value': 9
56
});
57
58
var data10 = dataSet.mapAs({
59
'x': 0,
60
'value': 10
61
});
62
63
var data11 = dataSet.mapAs({
64
'x': 0,
65
'value': 11
66
});
67
68
var data12 = dataSet.mapAs({
69
'x': 0,
70
'value': 12
71
});
72
73
var data13 = dataSet.mapAs({
74
'x': 0,
75
'value': 13
76
});
77
78
var data14 = dataSet.mapAs({
79
'x': 0,
80
'value': 14
81
});
82
83
var data15 = dataSet.mapAs({
84
'x': 0,
85
'value': 15
86
});
87
88
var data16 = dataSet.mapAs({
89
'x': 0,
90
'value': 16
91
});
92
93
// create radar chart
94
var chart = anychart.radar();
95
96
// set chart title text settings
97
chart.title('美妝網紅雷達分佈圖');
98
99
// set chart yScale settings
100
chart.yScale()
101
.minimum(0)
102
.maximumGap(0)
103
.ticks().interval(1);
104
105
// set xAxis labels settings
106
chart.xAxis().labels().padding(4);
107
108
// set chart legend settings
109
var legend = chart.legend();
110
legend.align('center')
111
legend.padding(30)
112
legend.maxWidth("90%")
113
legend.itemsLayout("horizontal-expandable");
114
legend.enabled(true);
115
116
// create first series with mapped data
117
var series1 = chart.line(data1).name('IGisele 愛吉賽兒');
118
series1.markers()
119
.enabled(true)
120
.type('circle')
121
.size(3);
122
// create first series with mapped data
123
var series2 = chart.line(data2).name('Gina hello ?');
124
series2.markers()
125
.enabled(true)
126
.type('circle')
127
.size(3);
128
// create first series with mapped data
129
var series3 = chart.line(data3).name('家寧+0');
130
series3.markers()
131
.enabled(true)
132
.type('circle')
133
.size(3);
134
135
var series = chart.line(data4).name('Vina 薇娜');
136
series.markers()
137
.enabled(true)
138
.type('circle')
139
.size(3);
140
var series = chart.line(data5).name('台灣妞韓國媳');
141
series.markers()
142
.enabled(true)
143
.type('circle')
144
.size(3);
145
146
var series = chart.line(data6).name('Kerina* 薛妞妞');
147
series.markers()
148
.enabled(true)
149
.type('circle')
150
.size(3);
151
152
var series = chart.line(data7).name('丹妮婊姐星球');
153
series.markers()
154
.enabled(true)
155
.type('circle')
156
.size(3);
157
158
var series = chart.line(data8).name('哥哥的閒妻日誌');
159
series.markers()
160
.enabled(true)
161
.type('circle')
162
.size(3);
163
164
var series = chart.line(data9).name('BACK TO BRITISH Tramy 崔咪');
165
series.markers()
166
.enabled(true)
167
.type('circle')
168
.size(3);
169
170
var series = chart.line(data10).name('金老佛爺 Fashion Blog by Kimlafayette');
171
series.markers()
172
.enabled(true)
173
.type('circle')
174
.size(3);
175
176
var series = chart.line(data11).name('Natalie吳斐莉');
177
series.markers()
178
.enabled(true)
179
.type('circle')
180
.size(3);
181
182
var series = chart.line(data12).name('我愛小馬克');
183
series.markers()
184
.enabled(true)
185
.type('circle')
186
.size(3);
187
188
var series = chart.line(data13).name('一名空姐的流水帳日記');
189
series.markers()
190
.enabled(true)
191
.type('circle')
192
.size(3);
193
194
var series = chart.line(data14).name('【百變沛莉】Peri');
195
series.markers()
196
.enabled(true)
197
.type('circle')
198
.size(3);
199
200
var series = chart.line(data15).name('大饅大力 MLcrazybuy');
201
series.markers()
202
.enabled(true)
203
.type('circle')
204
.size(3);
205
206
var series = chart.line(data16).name('貴婦奈奈');
207
series.markers()
208
.enabled(true)
209
.type('circle')
210
.size(3);
211
212
// chart tooltip format
213
chart.tooltip().format('Value: {%Value}');
214
215
// set container id for the chart
216
chart.container('container');
217
chart.draw();
218
});
219
220