配置项如下
var data = [
[
[
33,
0.14224137931034483,
232,
"计算机科学与教育软件学院",
"15届"
],
[
99,
0.668918918918919,
148,
"地理科学学院",
"15届"
],
[
57,
0.15447154471544716,
369,
"机械与电气工程学院",
"15届"
],
[
368,
0.6996197718631179,
526,
"经济与统计学院",
"15届"
],
[
66,
0.1935483870967742,
341,
"土木工程学院",
"15届"
],
[
300,
0.7537688442211056,
398,
"新闻与传播学院",
"15届"
],
[
236,
0.8939393939393939,
264,
"外国语学院",
"15届"
],
[
230,
0.888030888030888,
259,
"人文学院",
"15届"
],
[
89,
0.5493827160493827,
162,
"数学与信息科学学院",
"15届"
],
[
334,
0.6693386773547094,
499,
"工商管理学院",
"15届"
],
[
131,
0.7443181818181818,
176,
"法学院",
"15届"
],
[
120,
0.7361963190184049,
163,
"公共管理学院",
"15届"
],
[
3,
1.0,
3,
"卫斯理安学院",
"15届"
],
[
14,
0.6666666666666666,
21,
"政治与公民教育学院",
"15届"
],
[
153,
0.7846153846153846,
195,
"旅游学院",
"15届"
],
[
158,
0.7821782178217822,
202,
"教育学院",
"15届"
],
[
46,
0.4842105263157895,
95,
"环境科学与工程学院",
"15届"
],
[
118,
0.5728155339805825,
206,
"化学化工学院",
"15届"
],
[
37,
0.22424242424242424,
165,
"物理与电子工程学院",
"15届"
],
[
67,
0.4785714285714286,
140,
"建筑与城市规划学院",
"15届"
],
[
167,
0.5921985815602837,
282,
"美术与设计学院",
"15届"
],
[
67,
0.6146788990825688,
109,
"生命科学学院",
"15届"
],
[
7,
0.07142857142857142,
98,
"体育学院",
"15届"
],
[
101,
0.7769230769230769,
130,
"音乐舞蹈学院",
"15届"
]
],
[
[
83,
0.47701149425287354,
174,
"地理科学学院",
"14届"
],
[
30,
0.08356545961002786,
359,
"机械与电气工程学院",
"14届"
],
[
6,
0.6666666666666666,
9,
"工商管理学院",
"14届"
],
[
98,
0.6901408450704225,
142,
"法学院",
"14届"
],
[
101,
0.6121212121212121,
165,
"公共管理学院",
"14届"
],
[
79,
0.48466257668711654,
163,
"数学与信息科学学院",
"14届"
],
[
33,
0.25384615384615383,
130,
"环境科学与工程学院",
"14届"
],
[
76,
0.4342857142857143,
175,
"化学化工学院",
"14届"
],
[
127,
0.7650602409638554,
166,
"教育学院",
"14届"
],
[
35,
0.33653846153846156,
104,
"计算机科学与教育软件学院",
"14届"
],
[
10,
0.7692307692307693,
13,
"经济与统计学院",
"14届"
],
[
51,
0.20647773279352227,
247,
"土木工程学院",
"14届"
],
[
40,
0.2185792349726776,
183,
"物理与电子工程学院",
"14届"
],
[
51,
0.4214876033057851,
121,
"建筑与城市规划学院",
"14届"
],
[
136,
0.7640449438202247,
178,
"旅游学院",
"14届"
],
[
157,
0.6356275303643725,
247,
"美术与设计学院",
"14届"
],
[
168,
0.835820895522388,
201,
"人文学院",
"14届"
],
[
47,
0.2974683544303797,
158,
"生命科学学院",
"14届"
],
[
16,
0.15384615384615385,
104,
"体育学院",
"14届"
],
[
165,
0.8918918918918919,
185,
"外国语学院",
"14届"
],
[
235,
0.7704918032786885,
305,
"新闻与传播学院",
"14届"
],
[
90,
0.8108108108108109,
111,
"音乐舞蹈学院",
"14届"
]
],
[
[
64,
0.44755244755244755,
143,
"地理科学学院",
"13届"
],
[
101,
0.7372262773722628,
137,
"法学院",
"13届"
],
[
147,
0.7616580310880829,
193,
"教育学院",
"13届"
],
[
113,
0.6848484848484848,
165,
"公共管理学院",
"13届"
],
[
55,
0.3525641025641026,
156,
"环境科学与工程学院",
"13届"
],
[
4,
0.8,
5,
"工商管理学院",
"13届"
],
[
69,
0.3150684931506849,
219,
"化学化工学院",
"13届"
],
[
48,
0.2222222222222222,
216,
"物理与电子工程学院",
"13届"
],
[
5,
0.053763440860215055,
93,
"计算机科学与教育软件学院",
"13届"
],
[
23,
0.0749185667752443,
307,
"机械与电气工程学院",
"13届"
],
[
130,
0.6701030927835051,
194,
"旅游学院",
"13届"
],
[
152,
0.9047619047619048,
168,
"外国语学院",
"13届"
],
[
2,
1.0,
2,
"经济与统计学院",
"13届"
],
[
51,
0.38636363636363635,
132,
"建筑与城市规划学院",
"13届"
],
[
82,
0.5616438356164384,
146,
"数学与信息科学学院",
"13届"
],
[
172,
0.6539923954372624,
263,
"美术与设计学院",
"13届"
],
[
175,
0.8293838862559242,
211,
"人文学院",
"13届"
],
[
213,
0.7526501766784452,
283,
"新闻与传播学院",
"13届"
],
[
72,
0.35467980295566504,
203,
"生命科学学院",
"13届"
],
[
47,
0.1649122807017544,
285,
"土木工程学院",
"13届"
],
[
12,
0.10909090909090909,
110,
"体育学院",
"13届"
],
[
86,
0.7962962962962963,
108,
"音乐舞蹈学院",
"13届"
]
]
];
isShowCollege2 = 0
isShowCollege3 = 0
isShowCollege4 = 0
option = {
tooltip: {
trigger: "item",
formatter: function(params) {
return params.value[3] + ":" + parseInt(params.value[1] * 1000) / 10 + "%"
}
},
toolbox: {
left: "160",
feature: {
saveAsImage: {
show: true
},
myshowcollege2: {
show: true,
icon: "image://http://omudx2uw8.bkt.clouddn.com/ring0.jpg",
title: "显示15届学院名称",
onclick: function() {
// alert("好")
if (isShowCollege2 == 0) {
myChart.setOption({
series: [{
label: {
normal: {
formatter: function(param) {
return param.data[3];
}
}
}
}]
})
isShowCollege2 = 1
} else {
myChart.setOption({
series: [{
label: {
normal: {
formatter: ""
}
}
}]
})
isShowCollege2 = 0
}
}
},
myshowcollege3: {
show: true,
icon: "image://http://omudx2uw8.bkt.clouddn.com/ring0.jpg",
title: "显示14届学院名称",
onclick: function() {
// alert("好")
if (isShowCollege3 == 0) {
myChart.setOption({
series: [{}, {
label: {
normal: {
formatter: function(param) {
return param.data[3];
}
}
}
}]
})
isShowCollege3 = 1
} else {
myChart.setOption({
series: [{}, {
label: {
normal: {
formatter: ""
}
}
}]
})
isShowCollege3 = 0
}
}
},
myshowcollege4: {
show: true,
icon: "image://http://omudx2uw8.bkt.clouddn.com/ring0.jpg",
title: "显示13届学院名称",
onclick: function() {
// alert("好")
if (isShowCollege4 == 0) {
myChart.setOption({
series: [{}, {}, {
label: {
normal: {
formatter: function(param) {
return param.data[3];
}
}
}
}]
})
isShowCollege4 = 1
} else {
myChart.setOption({
series: [{}, {}, {
label: {
normal: {
formatter: ""
}
}
}]
})
isShowCollege4 = 0
}
}
}
}
},
backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
offset: 0,
color: '#f7f8fa'
}, {
offset: 1,
color: '#cdd0d5'
}]),
title:{
text: "广州大学数据分析",
subtext: "各学院女生比例及女生基数-Acring",
left: "center"
},
legend: {
right: 10,
data: ['15届', '14届', "13届"]
},
xAxis: {
name: "女生数量",
splitLine: {
lineStyle: {
type: 'dashed'
}
}
},
yAxis: {
name: "女生占比",
splitLine: {
lineStyle: {
type: 'dashed'
}
},
scale: true
},
series: [{
name: '15届',
data: data[0],
type: 'scatter',
symbolSize: function(data) {
return Math.sqrt(data[2]) * 2;
},
label: {
normal: {
show: true,
formatter: "",
position: 'top',
},
emphasis: {
show: true,
formatter: function(param) {
return param.data[3];
},
position: 'top'
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: 'rgba(120, 36, 50, 0.5)',
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
offset: 0,
color: 'rgb(251, 118, 123)'
}, {
offset: 1,
color: 'rgb(204, 46, 72)'
}])
}
}
}, {
name: '14届',
data: data[1],
type: 'scatter',
symbolSize: function(data) {
return Math.sqrt(data[2]) * 2;
},
label: {
normal: {
show: true,
formatter: "",
position: 'top'
},
emphasis: {
show: true,
formatter: function(param) {
return param.data[3];
},
position: 'top'
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: 'rgba(25, 100, 150, 0.5)',
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
offset: 0,
color: 'rgb(129, 227, 238)'
}, {
offset: 1,
color: 'rgb(25, 183, 207)'
}])
}
}
}, {
name: '13届',
data: data[2],
type: 'scatter',
symbolSize: function(data) {
return Math.sqrt(data[2]) * 2;
},
label: {
normal: {
show: true,
formatter: "",
position: 'top'
},
emphasis: {
show: true,
formatter: function(param) {
return param.data[3];
},
position: 'top'
}
},
itemStyle: {
normal: {
shadowBlur: 10,
shadowColor: 'rgba(25, 100, 150, 0.5)',
shadowOffsetY: 5,
color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [{
offset: 0,
color: 'rgb(52, 128, 256)'
}, {
offset: 1,
color: 'rgb(52, 52, 207)'
}])
}
}
}]
};