<div class="top-bottom">
<div id="myChart4" ref="paopaoChart" class="allnav"></div>
</div>
import barY from "@/assets/cockpit/circle1.png"
//如果要随机设置symbolSize 可以用到
getRandom(max, min) {
return Math.floor(Math.random() * (max - min) + min);
},
getChart4(data) {
this.myChart4 = this.$echarts.init(document.getElementById("myChart4"));
this.myChart4.setOption({
tooltip: {},
color:['#59EBE8','#f29701'],
animationDurationUpdate: function (idx) {
return idx * 100;
},
animationEasingUpdate: "bounceIn",
series: [
{
type: "graph",
layout: "force",
force: {
repulsion: 400, //节点之间的斥力因子。支持数组表达斥力范围,值越大斥力越大。
edgeLength: 70, //边的两个节点之间的距离,值越小则长度越长,这个距离也会受 repulsion影响。
gravity: 0.03, //节点受到的向中心的引力因子。该值越大节点越往中心点靠拢。
layoutAnimation : true //初始化时转动动画
},
label: {
show: true,
formatter: ["{a|{c}}", "{b|{b}}"].join("\n"),
fontWeight: "1000",
fontSize: "18",
align: "center",
verticalAlign: "center",
rich: {
a: {
color: "#59EBE8",
fontSize: 25,
lineHeight: 30,
textBorderColor: "transparent",
textBorderWidth: 0,
},
b: {
color: "#59EBE8",
fontSize: 14,
lineHeight: 30,
textBorderColor: "transparent",
textBorderWidth: 0,
},
},
},
data:
[
{
name: "PH 1",
value: 7.7,
symbol: "image://"+ barY,
symbolSize: 160,
draggable: true,
},
{
name: "PM2.5 1",
value: 65,
symbol: "image://"+ barY,
symbolSize: 110,
draggable: true,
},
],
},
],
});
},
echarts动态气泡图
于 2023-08-04 17:20:26 首次发布