X軸無偏移: axisTick: {
alignWithLabel: true
},
x軸顯示所有數據項且避免擁擠在xAxis設置: axisLabel: {
interval: 0,
rotate: 40
},
另外設置:grid: {
bottom: 70,
x: 40,
x2: 100,
y2: 150
},
hover加豎線: tooltip: {
trigger: 'axis',
backgroundColor: 'rgba(74,56,31,0.85)',
borderColor: 'rgba(74,56,31,0.85)',
axisPointer: {
lineStyle: {
color: '#a19c96'
}
}
},
每條記錄加豎線在xAxis或yAxis:
axisLine: {
// lineStyle: {
// color: '#f0ede8'
// }
// },
// splitLine: {
// show: true,
// lineStyle: {
// color: '#f0ede8'
// }
// },
防止y軸數據過大顯示不全:
grid: {
bottom: 70,
x: 40,
x2: 100,
y2: 300,
containLabel: true *******
},
數據更新,初始化重置數據時:
for (let j in this.lineOption.series) {
this.lineOption.series[j].data = []
this.lineOption.series[j].name = ''
}
再設置this.lineOption.series.length
