You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.0 KiB

3 years ago
// 象形
3 years ago
export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) {
3 years ago
if(dRegion.length < 5) {
let n = 5 - dRegion.length;
for(let i = 0; i < n; i++) {
dRegion.push('')
}
}
3 years ago
return {
tooltip: {
3 years ago
trigger: "axis",
3 years ago
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
3 years ago
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
3 years ago
},
xAxis: {
show: false,
type: 'value'
},
yAxis: {
data: dRegion,
inverse: true,
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
3 years ago
margin: 10 ,
3 years ago
color: '#333333',
fontSize: 12
}
},
grid: {
3 years ago
top: '10%',
bottom: 5,
3 years ago
height: 220,
3 years ago
width: 40,
3 years ago
left: 58,
3 years ago
},
series: [{
itemStyle: {
normal: {
color: '#0084FF',
barBorderRadius: 12
},
},
// current data
type: 'bar',
barWidth: 8,
data: dValue,
label: {
show: true,
formatter: function (params) {
return ((params.value / dSum) * 100).toFixed(2) + ' %';
},
3 years ago
// position: 'right',
// offset: [20, 0],
color: '#333333',
3 years ago
fontSize: 10,
3 years ago
position: [50, -2]
3 years ago
},
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
markLine: {
symbol: 'none',
},
}, ]
3 years ago
3 years ago
}
}