显示错位问题修复

This commit is contained in:
hey7845
2021-12-28 16:57:30 +08:00
parent 2068d9e872
commit 611f5b5e69

View File

@@ -64,7 +64,7 @@
<script>
import * as echarts from 'echarts'
import { markRaw } from 'vue'
let trendChart;
import {
getColumnOptions,
getTrendChart,
@@ -83,10 +83,9 @@
areaList: ['南宁市'],
placeList: [],
regionLevel: '市级', // 区域等级
xco: '年度' // 横坐标
xco: '区域/测点名称' // 横坐标
},
trendData: [],
chartColumn: null,
regionLevelOptions: [],
placeOptions: [],
areaOptions: [],
@@ -190,24 +189,14 @@
})
},
initChart() {
// const colors = ['#5470C6', '#91CC75', '#EE6666'];
this.trendData.yAxis[0].axisLabel = {
formatter: function (value) { return value.toFixed(1);},
}
// this.trendData.yAxis[0].axisLine = {
// show: true,
// lineStyle: {
// color: colors[0]
// }
// }
// this.trendData.yAxis[1].axisLine = {
// show: true,
// lineStyle: {
// color: colors[1]
// }
// }
this.chartColumn = markRaw(echarts.init(document.getElementById('chartColumn')))
this.chartColumn.setOption({
if (trendChart != null && trendChart != "" && trendChart != undefined) {
trendChart.dispose();// 销毁
}
trendChart = echarts.init(document.getElementById('chartColumn'))
let option = {
tooltip: {
trigger: 'axis',
axisPointer: {
@@ -228,7 +217,8 @@
xAxis: this.trendData.xAxis,
yAxis: this.trendData.yAxis,
series: this.trendData.series
})
}
trendChart.setOption(option)
}
}