{
name: '气泡1',
type: 'scatter',
coordinateSystem: 'geo',
symbol: 'rect',
symbolSize: [80, 20],
symbolOffset: [0, '-100%'],
zlevel: 6,
animation: true,
label: {
normal: {
show: true,
textStyle: {
color: '#000',
fontSize: 9,
},
formatter: function(params) {
return '{a|' + params.value[2] + '}' + '/ {b|50} / {x|80}';
},
rich: {
a: {color: '#000'},
b: {color: 'red'},
x: {
color: 'green'
}
}
}
},
itemStyle: {
normal: {
color: '#fff', //标志颜色
borderWidth: 1,
borderColor: '#333'
}
},
tooltip: {
position: 'bottom',
formatter: function(params) {
var toolTiphtml = '';
//打印log查看params的对象属性
toolTiphtml += params.name + ": <br>" + params.value[2];
toolTiphtml += '(数量/个)';
return toolTiphtml;
},
backgroundColor: '#F08080',
textStyle: {
color: '#fff',
fontSize: 14
}
},
data: convertData1(data1)
}
Echarts 实现label富文本
最新推荐文章于 2024-06-12 15:24:39 发布