How does echarts highlight selected shapes and axes at the same time?

as shown in the figure, let March column and March in x axis highlight at the same time

after March is selected.

series is configured as follows. You can only change the color of the selected column
how to modify the x-axis text color at the same time

 series: [{
            name: "",
            type: "bar",  
            data: [20,20, 36, 10, 10, 2,5, 20, 36, 10, 10, 40],
            itemStyle: {   
                normal:{
                    color:"-sharp2C9AFB"
                },
                emphasis:{
                    color:"-sharp9EE734"
                }
            }
        }]
Mar.23,2021

echarts v3 and above support rich text tags: rich; supports a single setting style (background image, color, width and height);
api: http://echarts.baidu.com/opti.
is also doing this effect recently. Please refer to the following:

 yAxis: {
        type: 'category',
        data: ['',''...],
        
        ... 
        
        axisLabel: {
            formatter: function (value) {
              if(value==''){
                return '{a|'+value+'}'
              }
              else{
               return '{b|'+value+'}'
              }
        },
        rich:{
          a:{
            color:'-sharpf88234'
          },
          b:{
            color:'-sharp3e434e'
          }
        },

does the boss highlight the contents of the corresponding axes when clicking on the bar chart? Recently, when you need to achieve this effect, ask the boss to teach


to dynamically update the textStyle property in the data of the corresponding axis by setting the mouseover and mouseout listening events of Echarts to achieve the effect.

blog: https://blog.csdn.net/qq_4154.
online Demo: https://www.makeapie.com/edit.

Menu