我想设置的长度是以标尺长度为准,而symbolSize设置的单位貌似是像素
配置项如下
app.title = '气泡图';
var data = [
[
[1650, 1, 48, 10, '污渍', 1],
[1650, 96, 3300, 10, '污渍', 1],
[1650, 195, 3300, 12, '污渍', 1],
[1650, 534, 3300, 10, '污渍', 1],
[488, 849.5, 10, 19, '污渍', 1]
]
];
option = {
backgroundColor: new echarts.graphic.RadialGradient(0.3, 0.3, 0.8, [{
offset: 0,
color: '#f7f8fa'
}, {
offset: 1,
color: '#cdd0d5'
}]),
title: {
text: ''
},
legend: {
right: 10,
data: ['1']
},
xAxis: {
splitLine: {
lineStyle: {
type: 'dashed'
}
},
min: 0,
max: 3600,
splitNumber: 12,
position: 'top',
},
yAxis: {
splitLine: {
lineStyle: {
type: 'dashed'
}
},
min: 0,
max: 1000,
splitNumber: 20,
scale: true,
inverse: true,
},
series: [{
name: '1',
data: data[0],
type: 'scatter',
symbolSize: function(data) {
var a = data[2];
var b = data[3];
return [a, b];
},
symbol: 'rect',
label: {
emphasis: {
show: true,
formatter: function(param) {
return param.data[4];
},
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)'
}])
}
}
}]
};