How does echarts modify the color of map legend font echarts visualmap pieces

If in the pie chart we can use legend to set

legend: {
                    left: 'center',
                    textStyle:{
                            fontSize: 18,//字体大小
                            color: '#ffffff'//字体颜色
                          },
                  },

But we want to change the font color of the visualmap pieces legend. The above method has no effect

Here we just add the textStyle attribute to the pieces

pieces: [ // 自定义『分段式视觉映射组件(visualMapPiecewise)』
的每一段的范围,以及每一段的文字,以及每一段的特别的样式
        {gt: 900, lte: 1000, label: '非常好', color: '#6ad86e'}, // (900, 1000]
        {gt: 500, lte: 900, label: '正常', color: '#9adcfa'}, // (500, 900]
        {gt: 310, lte: 500, label: '警告', color: '#ffeb3b'}, // (310, 500]
        {gt: 200, lte: 300, label: '较差', color: '#ff9800'}, // (200, 300]
        {gt: 10, lte: 200, label: '非常差', color: 'orangered'}, // (10, 200]
        {value: 0, label: '无数据', color: '#999'} // [0]
        ],
          //设置字体颜色
        textStyle: {
           color: '#ffffff'
        },

Guess you like

Origin blog.csdn.net/Z_Gleng/article/details/123939268