鍍金池/ 問(wèn)答/HTML5  HTML/ echarts如何讓 選中的 圖形和坐標(biāo)軸 同時(shí)高亮?

echarts如何讓 選中的 圖形和坐標(biāo)軸 同時(shí)高亮?

如圖 選中三月之后 讓三月的柱子和x軸中的'三月' 同時(shí)高亮
圖片描述

series 配置如下,僅能修改選中柱子的顏色
請(qǐng)教如何同時(shí)修改 x軸文字顏色

 series: [{
            name: '未定義',
            type: 'bar',  
            data: [20,20, 36, 10, 10, 2,5, 20, 36, 10, 10, 40],
            itemStyle: {   
                normal:{
                    color:'#2C9AFB'
                },
                emphasis:{
                    color:'#9EE734'
                }
            }
        }]
回答
編輯回答
久愛(ài)她

echarts v3以上支持 富文本標(biāo)簽:rich ;支持單個(gè)設(shè)置樣式(背景圖,顏色,寬高等);
api:http://echarts.baidu.com/opti...
最近也在做這樣的效果 可以參考下:

 yAxis: {
        type: 'category',
        data: ['批發(fā)和零售業(yè)','建筑業(yè)'...],
        
        ... 
        
        axisLabel: {
            formatter: function (value) {
              if(value=='批發(fā)和零售業(yè)'){
                return '{a|'+value+'}'
              }
              else{
               return '{b|'+value+'}'
              }
        },
        rich:{
          a:{
            color:'#f88234'
          },
          b:{
            color:'#3e434e'
          }
        },
2017年8月12日 03:41