echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Could I emphasis child without emphasizing its parent in returnItem of series-custom?

Open jianqi-jin opened this issue 2 years ago • 0 comments

What problem does this feature solve?

  • I just want to emphasis a text only in a bunch of rect group.
  • And I also want to bind some event listener to the different child node.

How can I do this? Thanks!!!

This is a PR maybe related to this feature.

https://github.com/apache/echarts/pull/12775

What does the proposed API look like?

renderItem(params, api) {
  return {
    type: 'group',
    children: [{
      type: 'rect',
      textContent: {
        // type: 'text' can be ignored
        style: {
          text: 'xxxx',
          fill: 'red'
        },
        emphasis: { // this rect emphasis
          style: {
            ...
          }
        }
      }
    }, {
      type: 'rect',
      textContent: {
        // type: 'text' can be ignored
        style: {
          text: 'xxxx',
          fill: 'red'
        },
        // emphasis: { // this rect NOT emphasis
        //   style: {
        //     ...
        //   }
        // }
      }
    }]
  }
}

jianqi-jin avatar Sep 20 '22 06:09 jianqi-jin