关键代码
x轴的tooltip就是用鼠标事件来判断是鼠标位置是在x轴还是在series上从而进行formatter输出
const myChart = echarts.init(document.getElementById("tradeDevelop"));
myChart.on('mouseover', this.xAxisOver)
myChart.on('mouseout', this.xAxisout)
// 入世多少周年x轴tooltip效果
formateTooltip=()=>{
return this.xLabel
}
xAxisOver=(params)=>{
const myChart=echarts.init(document.getElementById('tradeDevelop'))
if (params.componentType === 'xAxis') {
if(params.value==="2001"){
this.xLabel = "入世";