0

I'm trying to change the color of the legend text when a serie is unselected/not shown in echarts.

Using the legend.textStyle.color option, I am able to change the text color but only when the serie is shown.
However I can't seem to find a similar option for when the serie is not shown.

For example the settings:

legend: {
  top: '10%',
    textStyle: {
      color: 'red'
  }
}

results in the following (with series medium and high not selected) enter image description here

But I'd like medium and high shown in a darker color

Am I missing it or is it just not there?

I've tried setting the color to an array (color: ['red', 'blue']) but that didn't work.

Liam
  • 27,717
  • 28
  • 128
  • 190
Raph
  • 326
  • 3
  • 15
  • I created a [feature request](https://github.com/apache/echarts/issues/16360) for this – Raph Jan 26 '22 at 22:18

1 Answers1

0

you can use inactiveColor:"red", something like below

legend: {
    data: [{name: 'Email',
    inactiveColor:"red",
    textStyle:{
       color:'green'
    },
    itemStyle: {
      //color: ['red', 'green'],
      color: '#ccc',
      borderType: [50, 10],
    }}, 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
  },
  • hey, thanks for the anwser but that will only modify the color of the icon in the legend. What I'm after is changing the color of the text itself (the textStyle part of the configuration). Unfortunately inactiveColor is not part of the textStyle config. – Raph Dec 29 '21 at 16:06