var option
= {
backgroundColor
: 'rgba(204,204,204,0.7 )',
title
: {
text
: '各教育阶段男女人数统计',
link
: 'https://www.xxx.com',
target
: 'blank',
top
: '5%',
left
: '3%',
textStyle
: {
color
: '#fff',
fontSize
: 20,
}
},
legend
: {
show
: true,
icon
: 'rect',
top
: '40%',
left
: '15%',
itemWidth
: 10,
itemHeight
: 10,
itemGap
: 30,
orient
: 'vertical',
textStyle
: {
fontSize
: 15,
color
: '#fff'
},
data
: [{
name
: '男',
icon
: 'rect',
textStyle
: {
color
: 'rgba(51,0,255,1)',
fontWeight
: 'bold'
}
},
{
name
: '女',
icon
: 'rect',
textStyle
: {
color
: 'rgba(255,0,0,1)',
fontWeight
: 'bold'
}
}],
},
radar
: [{
center
: ['50%', '50%'],
radius
: 160,
startAngle
: 90,
name
: {
formatter
: '{value}',
textStyle
: {
fontSize
: 15,
color
: '#000'
}
},
nameGap
: 15,
splitNumber
: 4,
shape
: 'circle',
axisLine
: {
lineStyle
: {
color
: '#fff',
width
: 1,
type
: 'solid',
}
},
splitLine
: {
lineStyle
: {
color
: '#fff',
width
: 2,
}
},
splitArea
: {
show
: true,
areaStyle
: {
color
: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)'],
}
},
indicator
: [{
name
: '高中',
max
: 15000,
},
{
name
: '专科',
max
: 10000
},
{
name
: '本科',
max
: 8000
},
{
name
: '硕士',
max
: 2000
},
{
name
: '博士',
max
: 500
}]
}],
series
: [{
name
: '雷达图',
type
: 'radar',
itemStyle
: {
normal
: {
lineStyle
: {
width
: 1
},
opacity
: 0.2
},
emphasis
: {
lineStyle
: {
width
: 5
},
opacity
: 1
}
},
data
: [{
name
: '女',
value
: [11035, 6013, 5067, 1520, 184],
symbol
: 'circle',
symbolSize
: 5,
label
: {
normal
: {
show
: true,
position
: 'top',
distance
: 5,
color
: 'rgba(255,0,0,1)',
fontSize
: 14,
formatter
: function(params
) {
return params
.value
;
}
}
},
itemStyle
: {
normal
: {
borderColor
: 'rgba(255,0,0,1)',
borderWidth
: 3,
}
},
lineStyle
: {
normal
: {
opacity
: 0.5
}
},
areaStyle
: {
normal
: {
color
: 'rgba(255,0,0,0.6)'
}
}
},
{
name
: '男',
value
: [13408, 5065, 5947, 856, 302],
symbol
: 'circle',
symbolSize
: 5,
label
: {
normal
: {
show
: true,
position
: 'top',
distance
: 5,
color
: 'rgba(51,0,255,1)',
fontSize
: 14,
formatter
: function(params
) {
return params
.value
;
}
}
},
itemStyle
: {
normal
: {
borderColor
: 'rgba(51,0,255,1)',
borderWidth
: 3,
}
},
lineStyle
: {
normal
: {
opacity
: 0.5
}
},
areaStyle
: {
normal
: {
color
: 'rgba(51,0,255,0.5)'
}
}
}]
},
]
};
来源:https://www.cnblogs.com/freely/p/11936659.html
参考资料:Echarts图例位置 - legend属性
转载请注明原文地址:https://ipadbbs.8miu.com/read-11793.html