apache / echarts

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

[Bug] TypeError: Cannot read properties of null (reading 'remove') #18889

Open olegdovger opened 1 year ago

olegdovger commented 1 year ago

Version

5.4.2

Link to Minimal Reproduction

Not possible

Steps to Reproduce

  1. Create custom series type.
  2. Create legend with data item to be able to hide/show custom series.
  3. Toggle on legend item.
  4. See exception "TypeError: Cannot read properties of null (reading 'remove')"

This issue is hard to reproduce. Maybe it have no sense to reproduce it.

Current Behavior

image

Can not call method "remove" on null value of parent property.

Expected Behavior

There are no unhandled exceptions.

Environment

- OS: Mac OS
- Browser: Chrome
- Framework: -

Any additional comments?

No response

echarts-bot[bot] commented 1 year ago

I'm sorry to close this issue for it lacks the necessary title. Please provide a descriptive and as concise as possible title to describe your problems or requests and then the maintainers or I will reopen this issue.

Every good bug report or feature request starts with a title. Your issue title is a critical element as it's the first thing maintainers see.

A good issue title makes it easier for maintainers to understand what the issue is, easily locate it, and know what steps they'll need to take to fix it.

Moreover, it's better to include keywords, as this makes it easier to find the issue self and similar issues in searches.

olegdovger commented 1 year ago

I noticed that this behaviour can be reproduced in next case.

Legend item for custom series turned off by default.

  1. Render custom series (type line). For example 5 lines
  2. Turn on legend to show lines.
  3. Then rerender chart with other data but with less number of lines than on step 1 (3 lines as an example).
  4. Repeat step 2.
  5. Exception.
olegdovger commented 1 year ago

By the way, error happened in file "customGraphicTransition.js"

olegdovger commented 1 year ago

PR - https://github.com/apache/echarts/pull/18890

ryuu-smallit commented 3 months ago

@olegdovger Hey! I have the same problem. As your PR hasn't be merged, Do you have any workaround?