echarts更改yAxis样式

 yAxis: {
        type: 'category',
        inverse: true,
        data: arr,
        axisLabel: {
            formatter: function (value,index) {
            console.log(value,'ff')
            // 判断一个刻度值知否为一年的开始
            
                return '{year|' + value + '}\n'
                    + '{month|' + stationNum[index] + '月}';
           
        },
        rich: {
            year: {
                color: 'red',
                fontSize:'18',
                
                fontWeight: 'bold',
                backgroundColor:'green',
                    width:100,
                 height:20,
                 position:'absolute',
                 top:321321
            },
            month: {
                color: '#999',
                 backgroundColor:'green',
                 width:100,
                 height:20,
            }
        }
        }
    },

  

 

 

 

 

 返回的格式: 

 

posted @ 2021-04-08 17:39  红苹果学园  阅读(1514)  评论(0编辑  收藏  举报