修改bug

This commit is contained in:
‘937886381’
2024-06-28 13:15:43 +08:00
parent 445ebe339d
commit 7b8f4cac21
12 changed files with 194 additions and 89 deletions

View File

@@ -12,7 +12,7 @@
v-for="item in legend"
:key="item.label"
class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }"
:style="{ fontSize: isFullscreen ? '0.72vw' : '0.7vw' }"
>{{ item.label }}</span
>
</div>
@@ -65,7 +65,36 @@ export default {
top: "15%",
containLabel: true,
},
tooltip: {},
tooltip: {
trigger: "axis",
axisPointer: {
// type: "cross",
crossStyle: {
color: "rgba(237,237,237,0.5)",
},
},
// backgroundColor: '#000000',
// textStyle: {
// color: '#ffff'
// }
formatter: params => {
// console.log(params);
// 获取xAxis data中的数据
let dataStr = `<div><p style="font-weight:bold;margin:0 8px 15px;">${params[0].name}</p></div>`
params.forEach(item => {
let color = item.color.colorStops ? item.color.colorStops[0].color : ''
console.log(item.color, color);
dataStr += `<div>
<div style="margin: 0 8px;">
<span style="display:inline-block;margin-right:5px;width:10px;height:10px;background-color:${item.color.colorStops[0].color};"></span>
<span>${item.seriesName}</span>
<span style="float:right;color:#000000;margin-left:20px;">${item.data}</span>
</div>
</div>`
})
return dataStr
}
},
xAxis: {
axisTick: {
show: false,
@@ -77,15 +106,16 @@ export default {
},
axisLabel: {
color: "#fff",
fontSize: 12,
fontSize: 14,
},
data: this.xAxis,
},
yAxis: {
name: "单位/片",
position:'left',
nameTextStyle: {
color: "#fff",
fontSize: 12,
fontSize: 14,
align:'right'
},
axisTick: {
@@ -93,7 +123,7 @@ export default {
},
axisLabel: {
color: "#fff",
fontSize: 12,
fontSize: 14,
},
axisLine: {
show: true,
@@ -118,7 +148,7 @@ export default {
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#DFF1FE',
fontSize: 12
fontSize: 14
}
},
itemStyle: {
@@ -162,7 +192,7 @@ export default {
position: 'top', //在上方显示
textStyle: { //数值样式
color: '#DFF1FE',
fontSize: 12
fontSize: 14
}
},
itemStyle: {
@@ -201,9 +231,9 @@ export default {
this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12;
});
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 14;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 14;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 14;
this.initOptions(this.actualOptions);
},
series(val) {