echarts⽓泡图rich富⽂本样式设置字体样式        var option = {
geo: {
map: 'china',
roam: false,
scaleLimit: {
min: 1,
max: 1.2
},
itemStyle: { //默认样式
fontweight属性bold
normal: {
areaColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0,
color: 'rgba(0, 252, 255, 0)' // 0% 处的颜⾊
}, {
offset: 1,
color: 'rgba(0, 252, 255, 0)' // 100% 处的颜⾊
}],
},
borderColor: '#A39039' //描边颜⾊
},
},
top: 130,
},
series: [{//⿏标hover样式
type: 'scatter',
coordinateSystem: 'geo',
rippleEffect: {
brushType: 'stroke'
},
showEffectOn: 'render',
itemStyle: {
normal: {
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0,
color: '#3982ff'
}, {
offset: 1,
color: '#3982ff'
}],
global: false // 缺省为 false
},
borderWidth: 0,
borderType: 'solid',
borderColor: '#fff',
shadowColor: '#fc5c3f',
shadowBlur: 5
}
},
itemStyle: {
normal: {
borderWidth: '0',
borderType: 'solid',
borderColor: '#fff',
color: '#407db1',
shadowColor: '#1c98aa',
shadowBlur: 10
}
},
emphasis: {
itemStyle: {
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0,
color: '#ff5a9f' // 0% 处的颜⾊
}, {
offset: 1,
color: '#fc5c3f' // 100% 处的颜⾊
}],
global: false
},
borderWidth: 0,
borderColor: '#b4dccd'
}
},
label: {
normal: {
show: true,
color: '#fff',
fontWeight: 'bold',
position: 'inside',
formatter: function(para) {
console.log(para)
return  '\n'+'{txtFontsize|'+para.data.name+'}' +'\n'+ '{cnNum|' + para.data.value[2] + '}'                                },
rich: { //设置富⽂本字体样式
cnNum: {
fontSize: 25,
fontWeight: 'bold',
color: '#fff',
padding: [25, 0, 5, 0],
align:'center'
},
txtFontsize: {
fontSize: 15,
color: '#fff',
padding: [5, 0, 5, 0],
align:'center'
},
}
},
emphasis: {
formatter: function(para) {
return ('\n'+"{txtFontsize|" + para.data.name + "}\n{cnNum|" + para.data.value[2] + "}");                                },
rich: {
cnNum: {
fontSize: 40,
fontWeight: 'bold',
color: '#fff',
padding: [25, 0, 5, 0],
align:'center'
},
txtFontsize: {
fontSize: 15,
color: '#fff',
padding: [5, 0, 5, 0],
align:'center'
}
}
}
},
symbol: 'circle',
symbolSize: function(val) {
if(val[2] == 0){

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。