效果

源码
data() {
return {
chartTitleFontSize: 0,
chartInstance: null,
allData: null,
}
},
computed: {
titleStyle() {
return {
fontSize: `${
this.chartTitleFontSize * 1.5}px`
}
}
},
mounted() {
this.initChart()
this.getData()
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
},
destroyed() {
window.removeEventListener('resize', this.screenAdapter)
},
methods:{
initChart() {
this.chartInstance = this.$echarts.init(this.$refs.chart_ref)
const initOption = {
color: ['#00fff5'],
grid: {
top: "25%",
left: "5%",
bottom: "5%",
right: "5%",
containLabel: true
},
animation: false,
xAxis: [
{
type: 'category',
axisLabel: {
interval: 0,
color: '#739DC9',
margin: