apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.26k stars 19.61k forks source link

[Bug] Label select state is ignored when data zoomed #18320

Open kitee0325 opened 1 year ago

kitee0325 commented 1 year ago

Version

5.4.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=graph-label-overlap&code=LYTwwgFghgTgLgOgM4QPYHcAyqoBMCWAdgOYAUAlANwBQAJAsQKZwBSAygPIBypAShxwAqAfQAKAQUEAJAAQBqGQHIA9LihwoyqEiTNV6zQBtGSALTB8umFABGxpAgBWSVIUUAaGQDMAroQDGcPiuMqTE1gAOEOQyAN7UMjKgkLCIEPi4jNh4RGRUCTKoEUEhALxxBYlwqKiGQREAXHEAvu6VMsZMhLhNANrtifGJw8NqGk3hUFEI_uqMxKgw-CYIwFOkvgElhKFQMUMjhzDMPjA7UAiEUMCMNIfDzeQDMs3tALptI1bLSH3PB_crjcmopMCYZABZSyMax2EweZ5VEARRggyZRBH3RKGKAgVA-OAgwiuRiYrFjKATSIQS6oTJIT5YwxEADWvxk6JpzMIbMZ91mcHmix-VKmNIFQqWJj5RxwwCacBgPkYMpGOJsjEMTQBWJQGAVSpViOGEVQSHw2xBS2IEDgZKx3kWazggpgINiNmaimNrWN6s1mFx-MJFQdiXSmQ4ADcYTjGjJFcqfarhkhZsZMPgLCGdfcLIQmgAGBAAFhTIzWAA8mgAmZN-oiMNhwEDGbXGxL-WqLEEuU7-Unl4b-U4xwgmdnFgDM9YdumMgUYuAhdNRSnNJGM9sO88YgXbYY6tk1B8PMj16ANyqHI1N5stSmqEW9h9eDrfhw_iTeBWadyS4DQPAyDMBwxTBIQpBFNs-SPJQQA

Steps to Reproduce

  1. set normal label position: right
  2. set select label position: inside
  3. select some node
  4. zoom graph

Current Behavior

selected node's label position is right

Expected Behavior

selected node's' label position should be inside

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

helgasoft commented 1 year ago

not-a-bug. Zoom does not make any selection. Also not to forget to enable select with selectedMode:

        selectedMode: true,
        select: {label: { position: 'inside'}},

Then just click on any node to select it and see label inside.

kitee0325 commented 1 year ago

不是错误。缩放不会进行任何选择。另外不要忘记使用_选定模式_启用选择:

        selectedMode: true,
        select: {label: { position: 'inside'}},

然后只需单击任何节点即可选择它并查看其中的标签。

Sorry I missed some steps, please try again after modification, you should see the problem

helgasoft commented 1 year ago

yes, I see it now - label of selected does not stay inside on zoom. One must hover with mouse to put label back in. Could be considered a bug 🐛